@opendash-ai/cli 0.0.0-master-202607051413

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 MiMo Code, Xiaomi Corporation
4
+ Copyright (c) 2025 opencode
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ <h1 align="center">OpenDash</h1>
2
+
3
+ <p align="center"><strong>Open Dash: Where Models and Agents Co-Evolve</strong></p>
4
+
5
+ <p align="center">
6
+ <a href="https://opendashai.netlify.app/analyst">Website</a> | <a href="https://opendashai.netlify.app/en/blog/opendash">Blog</a> | <a href="https://github.com/jagbiryadav/opendash">GitHub</a>
7
+ </p>
8
+
9
+ ---
10
+
11
+ OpenDash is a terminal-native AI coding assistant. It can read and write code, run commands, manage Git, and use a persistent memory system to keep a deep understanding of your project across sessions while continuously improving itself.
12
+
13
+ OpenDash is built in as a free-for-limited-time channel, so you can start with zero configuration. OpenDash also supports connecting to any mainstream LLM provider API.
14
+
15
+ ---
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # One-line install
21
+ curl -fsSL https://opendashai.netlify.app/install | bash
22
+
23
+ # Or install via npm
24
+ npm install -g @opendash-ai/cli
25
+
26
+ # Run
27
+ opendash
28
+ ```
29
+
30
+ The first launch guides you through configuration automatically. Supported options:
31
+ - **OpenDash (free for a limited time)** — anonymous channel, zero configuration
32
+ - **Xiaomi MiMo Platform** — OAuth login
33
+ - **Import from Claude Code** — migrate existing authentication in one step
34
+ - **Custom Provider** — add any OpenAI-compatible API in the TUI
35
+
36
+ ---
37
+
38
+ ## Core Features
39
+
40
+ - **Multiple Agents** — build (default), plan (read-only analysis), compose (specs-driven orchestration); press `Tab` to switch
41
+ - **Persistent Memory** — cross-session project knowledge, checkpoints, and task progress powered by SQLite FTS5
42
+ - **Intelligent Context Management** — automatic checkpoints, context reconstruction, and budgeted injection to stay within model limits
43
+ - **Task Tracking** — tree-shaped task system integrated with the checkpoint system
44
+ - **Subagent System** — parallel subagents with lifecycle tracking, cancellation, and background execution
45
+ - **Goal / Stop Condition** — judge model prevents premature stops during autonomous work
46
+ - **Compose Mode** — structured workflow for specs-driven development with built-in skills
47
+ - **Voice Input** — real-time streaming voice input powered by TenVAD and MiMo ASR
48
+ - **Dream & Distill** — extract knowledge into memory (`/dream`) and discover reusable workflows (`/distill`)
49
+
50
+ For detailed documentation, configuration options, and troubleshooting, see the [GitHub repository](https://github.com/jagbiryadav/opendash).
51
+
52
+ ---
53
+
54
+ ## License
55
+
56
+ Source code is licensed under the [MIT License](https://github.com/jagbiryadav/opendash/blob/main/LICENSE).
57
+
58
+ Use of OpenDash is also subject to the [Use Restrictions](https://github.com/jagbiryadav/opendash/blob/main/USE_RESTRICTIONS.md).
59
+ Use of Xiaomi MiMo-hosted services is subject to the [MiMo Terms of Service](https://platform.opendashai.netlify.app/docs/terms/user-agreement).
60
+ Use of the MiMo name, logo, and trademarks is subject to the MiMo Trademark Policy.
package/bin/opendash ADDED
@@ -0,0 +1,180 @@
1
+ #!/usr/bin/env node
2
+
3
+ const childProcess = require("child_process")
4
+ const fs = require("fs")
5
+ const path = require("path")
6
+ const os = require("os")
7
+
8
+ function run(target) {
9
+ const result = childProcess.spawnSync(target, process.argv.slice(2), {
10
+ stdio: "inherit",
11
+ })
12
+ if (result.error) {
13
+ console.error(result.error.message)
14
+ process.exit(1)
15
+ }
16
+ const code = typeof result.status === "number" ? result.status : 0
17
+ process.exit(code)
18
+ }
19
+
20
+ const envPath = process.env.OPENDASH_BIN_PATH
21
+ if (envPath) {
22
+ run(envPath)
23
+ }
24
+
25
+ const scriptPath = fs.realpathSync(__filename)
26
+ const scriptDir = path.dirname(scriptPath)
27
+
28
+ //
29
+ const cached = path.join(scriptDir, ".opendash")
30
+ if (fs.existsSync(cached)) {
31
+ run(cached)
32
+ }
33
+
34
+ const platformMap = {
35
+ darwin: "darwin",
36
+ linux: "linux",
37
+ win32: "windows",
38
+ }
39
+ const archMap = {
40
+ x64: "x64",
41
+ arm64: "arm64",
42
+ arm: "arm",
43
+ }
44
+
45
+ let platform = platformMap[os.platform()]
46
+ if (!platform) {
47
+ platform = os.platform()
48
+ }
49
+ let arch = archMap[os.arch()]
50
+ if (!arch) {
51
+ arch = os.arch()
52
+ }
53
+ const scope = "@opendash-ai/"
54
+ const base = scope + "opendash-" + platform + "-" + arch
55
+ const binary = platform === "windows" ? "opendash.exe" : "opendash"
56
+
57
+ function supportsAvx2() {
58
+ if (arch !== "x64") return false
59
+
60
+ if (platform === "linux") {
61
+ try {
62
+ return /(^|\s)avx2(\s|$)/i.test(fs.readFileSync("/proc/cpuinfo", "utf8"))
63
+ } catch {
64
+ return false
65
+ }
66
+ }
67
+
68
+ if (platform === "darwin") {
69
+ try {
70
+ const result = childProcess.spawnSync("sysctl", ["-n", "hw.optional.avx2_0"], {
71
+ encoding: "utf8",
72
+ timeout: 1500,
73
+ })
74
+ if (result.status !== 0) return false
75
+ return (result.stdout || "").trim() === "1"
76
+ } catch {
77
+ return false
78
+ }
79
+ }
80
+
81
+ if (platform === "windows") {
82
+ const cmd =
83
+ '(Add-Type -MemberDefinition "[DllImport(""kernel32.dll"")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)'
84
+
85
+ for (const exe of ["powershell.exe", "pwsh.exe", "pwsh", "powershell"]) {
86
+ try {
87
+ const result = childProcess.spawnSync(exe, ["-NoProfile", "-NonInteractive", "-Command", cmd], {
88
+ encoding: "utf8",
89
+ timeout: 3000,
90
+ windowsHide: true,
91
+ })
92
+ if (result.status !== 0) continue
93
+ const out = (result.stdout || "").trim().toLowerCase()
94
+ if (out === "true" || out === "1") return true
95
+ if (out === "false" || out === "0") return false
96
+ } catch {
97
+ continue
98
+ }
99
+ }
100
+
101
+ return false
102
+ }
103
+
104
+ return false
105
+ }
106
+
107
+ const names = (() => {
108
+ const avx2 = supportsAvx2()
109
+ const baseline = arch === "x64" && !avx2
110
+
111
+ if (platform === "linux") {
112
+ const musl = (() => {
113
+ try {
114
+ if (fs.existsSync("/etc/alpine-release")) return true
115
+ } catch {
116
+ // ignore
117
+ }
118
+
119
+ try {
120
+ const result = childProcess.spawnSync("ldd", ["--version"], { encoding: "utf8" })
121
+ const text = ((result.stdout || "") + (result.stderr || "")).toLowerCase()
122
+ if (text.includes("musl")) return true
123
+ } catch {
124
+ // ignore
125
+ }
126
+
127
+ return false
128
+ })()
129
+
130
+ if (musl) {
131
+ if (arch === "x64") {
132
+ if (baseline) return [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
133
+ return [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
134
+ }
135
+ return [`${base}-musl`, base]
136
+ }
137
+
138
+ if (arch === "x64") {
139
+ if (baseline) return [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
140
+ return [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
141
+ }
142
+ return [base, `${base}-musl`]
143
+ }
144
+
145
+ if (arch === "x64") {
146
+ if (baseline) return [`${base}-baseline`, base]
147
+ return [base, `${base}-baseline`]
148
+ }
149
+ return [base]
150
+ })()
151
+
152
+ function findBinary(startDir) {
153
+ let current = startDir
154
+ for (;;) {
155
+ const modules = path.join(current, "node_modules")
156
+ if (fs.existsSync(modules)) {
157
+ for (const name of names) {
158
+ const candidate = path.join(modules, name, "bin", binary)
159
+ if (fs.existsSync(candidate)) return candidate
160
+ }
161
+ }
162
+ const parent = path.dirname(current)
163
+ if (parent === current) {
164
+ return
165
+ }
166
+ current = parent
167
+ }
168
+ }
169
+
170
+ const resolved = findBinary(scriptDir)
171
+ if (!resolved) {
172
+ console.error(
173
+ "It seems that your package manager failed to install the right version of the opendash CLI for your platform. You can try manually installing " +
174
+ names.map((n) => `\"${n}\"`).join(" or ") +
175
+ " package",
176
+ )
177
+ process.exit(1)
178
+ }
179
+
180
+ run(resolved)
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@opendash-ai/cli",
3
+ "version": "0.0.0-master-202607051413",
4
+ "description": "The open-source AI workspace for analysts.",
5
+ "license": "MIT",
6
+ "author": "Jagbir Yadav",
7
+ "homepage": "https://opendash-ai.vercel.app",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/jagbiryadav/opendash.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/jagbiryadav/opendash/issues"
14
+ },
15
+ "keywords": [
16
+ "ai",
17
+ "cli",
18
+ "analytics",
19
+ "data-analysis",
20
+ "sql",
21
+ "reporting",
22
+ "automation",
23
+ "dashboard",
24
+ "terminal",
25
+ "opendash"
26
+ ],
27
+ "bin": {
28
+ "opendash": "./bin/opendash"
29
+ },
30
+ "scripts": {
31
+ "postinstall": "node ./postinstall.mjs"
32
+ },
33
+ "optionalDependencies": {
34
+ "@opendash-ai/opendash-windows-x64": "0.0.0-master-202607051413"
35
+ }
36
+ }
@@ -0,0 +1,124 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs"
4
+ import path from "path"
5
+ import os from "os"
6
+ import { fileURLToPath } from "url"
7
+ import { createRequire } from "module"
8
+ import { execSync } from "child_process"
9
+
10
+ const __dirname = path.dirname(fileURLToPath(import.meta.url))
11
+ const require = createRequire(import.meta.url)
12
+
13
+ function detectPlatform() {
14
+ switch (os.platform()) {
15
+ case "darwin": return "darwin"
16
+ case "linux": return "linux"
17
+ case "win32": return "windows"
18
+ default: return os.platform()
19
+ }
20
+ }
21
+
22
+ function detectArch() {
23
+ switch (os.arch()) {
24
+ case "x64": return "x64"
25
+ case "arm64": return "arm64"
26
+ default: return os.arch()
27
+ }
28
+ }
29
+
30
+ function detectMusl() {
31
+ if (os.platform() !== "linux") return false
32
+ try {
33
+ if (fs.existsSync("/etc/alpine-release")) return true
34
+ const output = execSync("ldd --version 2>&1 || true", { encoding: "utf8", timeout: 3000 })
35
+ return output.toLowerCase().includes("musl")
36
+ } catch {
37
+ return false
38
+ }
39
+ }
40
+
41
+ function detectBaseline() {
42
+ if (os.arch() !== "x64") return false
43
+ let hasAvx2 = false
44
+
45
+ if (os.platform() === "linux") {
46
+ try {
47
+ const cpuinfo = fs.readFileSync("/proc/cpuinfo", "utf8")
48
+ hasAvx2 = /(^|\s)avx2(\s|$)/i.test(cpuinfo)
49
+ } catch {}
50
+ } else if (os.platform() === "darwin") {
51
+ try {
52
+ const result = execSync("sysctl -n hw.optional.avx2_0", { encoding: "utf8", timeout: 1500 })
53
+ hasAvx2 = result.trim() === "1"
54
+ } catch {}
55
+ } else if (os.platform() === "win32") {
56
+ try {
57
+ const cmd = '(Add-Type -MemberDefinition "[DllImport(\\"kernel32.dll\\")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)'
58
+ const result = execSync(`powershell -NoProfile -NonInteractive -Command "${cmd}"`, {
59
+ encoding: "utf8",
60
+ timeout: 3000,
61
+ windowsHide: true,
62
+ })
63
+ hasAvx2 = result.trim().toLowerCase() === "true" || result.trim() === "1"
64
+ } catch {}
65
+ }
66
+
67
+ return !hasAvx2
68
+ }
69
+
70
+ function buildPackageName(platform, arch) {
71
+ const musl = detectMusl() ? "-musl" : ""
72
+ const baseline = detectBaseline() ? "-baseline" : ""
73
+ return `@opendash-ai/opendash-${platform}-${arch}${musl}${baseline}`
74
+ }
75
+
76
+ function findBinary(packageName, platform) {
77
+ const binaryName = platform === "windows" ? "opendash.exe" : "opendash"
78
+
79
+ try {
80
+ const packageJsonPath = require.resolve(`${packageName}/package.json`)
81
+ const packageDir = path.dirname(packageJsonPath)
82
+ const binaryPath = path.join(packageDir, "bin", binaryName)
83
+
84
+ if (!fs.existsSync(binaryPath)) {
85
+ throw new Error(`Binary not found at ${binaryPath}`)
86
+ }
87
+
88
+ return { binaryPath, binaryName }
89
+ } catch (error) {
90
+ throw new Error(`Could not find package ${packageName}: ${error.message}`, { cause: error })
91
+ }
92
+ }
93
+
94
+ async function main() {
95
+ const platform = detectPlatform()
96
+ const arch = detectArch()
97
+ const packageName = buildPackageName(platform, arch)
98
+
99
+ try {
100
+ const { binaryPath } = findBinary(packageName, platform)
101
+ const target = path.join(__dirname, "bin", ".opendash")
102
+
103
+ if (fs.existsSync(target)) fs.unlinkSync(target)
104
+
105
+ try {
106
+ fs.linkSync(binaryPath, target)
107
+ } catch {
108
+ fs.copyFileSync(binaryPath, target)
109
+ }
110
+
111
+ fs.chmodSync(target, 0o755)
112
+ console.log(`OpenDash binary linked: ${target}`)
113
+ } catch (error) {
114
+ console.error(`Failed to setup OpenDash binary: ${error.message}`)
115
+ process.exit(0)
116
+ }
117
+ }
118
+
119
+ try {
120
+ void main()
121
+ } catch (error) {
122
+ console.error("Postinstall script error:", error.message)
123
+ process.exit(0)
124
+ }