clawcontrol 0.1.5 → 0.1.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.
@@ -5,14 +5,47 @@
5
5
  // re-exec with bun pointing at the bundled dist/index.js.
6
6
 
7
7
  import { execFileSync } from "node:child_process";
8
+ import { createRequire } from "node:module";
8
9
  import { fileURLToPath } from "node:url";
9
10
  import { dirname, resolve } from "node:path";
10
11
 
12
+ const args = process.argv.slice(2);
13
+
14
+ // Handle --version and --help without needing bun
15
+ if (args.includes("--version") || args.includes("-v")) {
16
+ const require = createRequire(import.meta.url);
17
+ const pkg = require("../package.json");
18
+ console.log(`clawcontrol v${pkg.version}`);
19
+ process.exit(0);
20
+ }
21
+
22
+ if (args.includes("--help") || args.includes("-h")) {
23
+ const require = createRequire(import.meta.url);
24
+ const pkg = require("../package.json");
25
+ console.log(`
26
+ clawcontrol v${pkg.version}
27
+ ${pkg.description}
28
+
29
+ Usage:
30
+ clawcontrol Launch the interactive TUI
31
+ clawcontrol --help Show this help message
32
+ clawcontrol --version Show the version number
33
+
34
+ Options:
35
+ -h, --help Show this help message
36
+ -v, --version Show the version number
37
+
38
+ Documentation & source:
39
+ https://github.com/ipenywis/clawcontrol
40
+ `);
41
+ process.exit(0);
42
+ }
43
+
11
44
  const __dirname = dirname(fileURLToPath(import.meta.url));
12
45
  const script = resolve(__dirname, "../dist/index.js");
13
46
 
14
47
  try {
15
- execFileSync("bun", [script, ...process.argv.slice(2)], {
48
+ execFileSync("bun", [script, ...args], {
16
49
  stdio: "inherit",
17
50
  });
18
51
  } catch (e) {
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // src/index.tsx
2
+ import { createRequire } from "module";
2
3
  import { createCliRenderer } from "@opentui/core";
3
4
  import { createRoot } from "@opentui/react";
4
5
 
@@ -4263,8 +4264,8 @@ function openGhostty(command) {
4263
4264
  " end tell",
4264
4265
  "end tell"
4265
4266
  ];
4266
- const args = appleScript.flatMap((line) => ["-e", line]);
4267
- const result = spawnSync("osascript", args, { timeout: 1e4, stdio: "pipe" });
4267
+ const args2 = appleScript.flatMap((line) => ["-e", line]);
4268
+ const result = spawnSync("osascript", args2, { timeout: 1e4, stdio: "pipe" });
4268
4269
  if (result.status === 0) {
4269
4270
  return { success: true };
4270
4271
  }
@@ -6439,6 +6440,34 @@ function App() {
6439
6440
 
6440
6441
  // src/index.tsx
6441
6442
  import { jsx as jsx12 } from "@opentui/react/jsx-runtime";
6443
+ var args = process.argv.slice(2);
6444
+ if (args.includes("--version") || args.includes("-v")) {
6445
+ const require2 = createRequire(import.meta.url);
6446
+ const pkg = require2("../package.json");
6447
+ console.log(`clawcontrol v${pkg.version}`);
6448
+ process.exit(0);
6449
+ }
6450
+ if (args.includes("--help") || args.includes("-h")) {
6451
+ const require2 = createRequire(import.meta.url);
6452
+ const pkg = require2("../package.json");
6453
+ console.log(`
6454
+ clawcontrol v${pkg.version}
6455
+ ${pkg.description}
6456
+
6457
+ Usage:
6458
+ clawcontrol Launch the interactive TUI
6459
+ clawcontrol --help Show this help message
6460
+ clawcontrol --version Show the version number
6461
+
6462
+ Options:
6463
+ -h, --help Show this help message
6464
+ -v, --version Show the version number
6465
+
6466
+ Documentation & source:
6467
+ https://github.com/ipenywis/clawcontrol
6468
+ `);
6469
+ process.exit(0);
6470
+ }
6442
6471
  async function main() {
6443
6472
  const renderer = await createCliRenderer({
6444
6473
  useMouse: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawcontrol",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "CLI tool for deploying and managing OpenClaw instances on VPS providers",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",