@actionbookdev/cli 0.5.2 → 0.5.3

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
Binary file
Binary file
Binary file
Binary file
Binary file
package/bin/actionbook.js CHANGED
@@ -10,7 +10,7 @@
10
10
  "use strict";
11
11
 
12
12
  const { spawn } = require("child_process");
13
- const { existsSync } = require("fs");
13
+ const { existsSync, readFileSync } = require("fs");
14
14
  const path = require("path");
15
15
 
16
16
  const PLATFORMS = {
@@ -23,6 +23,14 @@ const PLATFORMS = {
23
23
  };
24
24
 
25
25
  function main() {
26
+ // Keep CLI version aligned with npm package version.
27
+ if (isVersionOnlyFlag(process.argv.slice(2))) {
28
+ const pkgPath = path.join(__dirname, "..", "package.json");
29
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
30
+ console.log(`actionbook ${pkg.version}`);
31
+ process.exit(0);
32
+ }
33
+
26
34
  // Allow env var override for development
27
35
  const envPath = process.env.ACTIONBOOK_BINARY_PATH;
28
36
  if (envPath) {
@@ -56,6 +64,10 @@ function main() {
56
64
  run(binaryPath);
57
65
  }
58
66
 
67
+ function isVersionOnlyFlag(args) {
68
+ return args.length === 1 && (args[0] === "--version" || args[0] === "-V");
69
+ }
70
+
59
71
  function run(binaryPath) {
60
72
  const child = spawn(binaryPath, process.argv.slice(2), {
61
73
  stdio: "inherit",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@actionbookdev/cli",
3
- "version": "0.5.2",
3
+ "version": "0.5.3",
4
4
  "description": "CLI for Actionbook - Browser automation and action manuals for AI agents",
5
5
  "private": false,
6
6
  "bin": {