openagent-cli 1.0.1 → 1.0.5

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.
Binary file
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ const { spawn, execSync } = require("child_process")
3
+ const path = require("path")
4
+
5
+ const pkg = require("../package.json")
6
+ const currentVersion = pkg.version
7
+
8
+ const args = process.argv.slice(2)
9
+ if (args.includes("--version") || args.includes("-v")) {
10
+ console.log(currentVersion)
11
+ process.exit(0)
12
+ }
13
+
14
+ const binDir = __dirname
15
+ const exe = path.join(binDir, "open-agent.exe")
16
+
17
+ const env = { ...process.env, OPENAGENT_NPM_VERSION: currentVersion }
18
+ try {
19
+ const latest = execSync("npm view openagent-cli version", { timeout: 3000, encoding: "utf-8" }).trim()
20
+ if (latest && latest !== currentVersion) {
21
+ env.OPENAGENT_UPDATE_AVAILABLE = latest
22
+ }
23
+ } catch {}
24
+
25
+ const child = spawn(exe, args, { stdio: "inherit", env })
26
+ child.on("exit", (code) => process.exit(code ?? 1))
27
+
28
+ process.on("SIGINT", () => child.kill("SIGINT"))
29
+ process.on("SIGTERM", () => child.kill("SIGTERM"))
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "openagent-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.5",
4
4
  "description": "OpenAgent - AI coding agent. Run from any directory.",
5
5
  "bin": {
6
- "openagent": "bin/open-agent.exe"
6
+ "openagent": "bin/openagent.js"
7
7
  },
8
8
  "license": "MIT"
9
9
  }
package/bin/openagent DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
- const { spawn } = require("child_process")
3
- const path = require("path")
4
-
5
- const args = process.argv.slice(2)
6
- if (args.includes("--version") || args.includes("-v")) {
7
- console.log(require("../package.json").version)
8
- process.exit(0)
9
- }
10
-
11
- const binDir = __dirname
12
- const exe = path.join(binDir, "open-agent.exe")
13
-
14
- const child = spawn(exe, args, { stdio: "inherit" })
15
- child.on("exit", (code) => process.exit(code ?? 1))
16
-
17
- process.on("SIGINT", () => child.kill("SIGINT"))
18
- process.on("SIGTERM", () => child.kill("SIGTERM"))