@me0wo/opencode 0.0.0-stage → 2.2.6
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/README.md +11 -2
- package/bin/cli.mjs +19 -0
- package/package.json +15 -4
package/README.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @me0wo/opencode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Unofficial npm distribution of the [OpenCode V2](https://github.com/anomalyco/opencode) JS bundle, built from upstream stable release tags by [Sn0wo2/opencode-dist](https://github.com/Sn0wo2/opencode-dist).
|
|
4
|
+
|
|
5
|
+
No runtime is embedded; the launcher runs the platform bundle with your own Node (>= 26) or bun (>= 1.4.4).
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm i -g @me0wo/opencode
|
|
9
|
+
opencode-node --version
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The platform bundle (`@me0wo/opencode-linux-x64`, `@me0wo/opencode-darwin-arm64`, or `@me0wo/opencode-windows-x64`) is selected automatically via optionalDependencies and ships `opencode.mjs` plus its native assets (pty, file watching, web UI). Run `bunx opencode-node` to execute the bundle with bun instead of Node.
|
package/bin/cli.mjs
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module"
|
|
3
|
+
import { spawn } from "node:child_process"
|
|
4
|
+
import path from "node:path"
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url)
|
|
7
|
+
const key = process.platform === "win32" ? `windows-${process.arch}` : `${process.platform}-${process.arch}`
|
|
8
|
+
let entry
|
|
9
|
+
try {
|
|
10
|
+
entry = path.join(path.dirname(require.resolve(`@me0wo/opencode-${key}/package.json`)), "opencode.mjs")
|
|
11
|
+
} catch {
|
|
12
|
+
console.error(`@me0wo/opencode: no bundle available for ${key} (supported: linux-x64, darwin-arm64, windows-x64)`)
|
|
13
|
+
process.exit(1)
|
|
14
|
+
}
|
|
15
|
+
const child = spawn(process.execPath, [entry, ...process.argv.slice(2)], { stdio: "inherit" })
|
|
16
|
+
child.on("exit", (code, signal) => {
|
|
17
|
+
if (signal) process.kill(process.pid, signal)
|
|
18
|
+
else process.exitCode = code ?? 1
|
|
19
|
+
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@me0wo/opencode",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "2.2.6",
|
|
4
|
+
"description": "OpenCode V2 JS bundle (bun/node-runnable); unofficial build from upstream stable tags",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": { "opencode-node": "bin/cli.mjs" },
|
|
7
|
+
"files": ["bin/"],
|
|
8
|
+
"optionalDependencies": {
|
|
9
|
+
"@me0wo/opencode-linux-x64": "2.2.6",
|
|
10
|
+
"@me0wo/opencode-darwin-arm64": "2.2.6",
|
|
11
|
+
"@me0wo/opencode-windows-x64": "2.2.6"
|
|
12
|
+
},
|
|
13
|
+
"engines": { "node": ">=26" },
|
|
14
|
+
"repository": { "type": "git", "url": "git+https://github.com/Sn0wo2/opencode-dist.git" },
|
|
15
|
+
"keywords": ["opencode", "opencode2", "ai", "agent", "cli"],
|
|
16
|
+
"publishConfig": { "access": "public" }
|
|
17
|
+
}
|