clawcontrol 0.1.4 → 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.
- package/bin/clawcontrol.js +61 -0
- package/dist/index.js +31 -4
- package/package.json +3 -2
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// Thin wrapper so npm correctly registers the "clawcontrol" binary.
|
|
4
|
+
// The actual CLI is powered by Bun (required by @opentui/core), so we
|
|
5
|
+
// re-exec with bun pointing at the bundled dist/index.js.
|
|
6
|
+
|
|
7
|
+
import { execFileSync } from "node:child_process";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { dirname, resolve } from "node:path";
|
|
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
|
+
|
|
44
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
45
|
+
const script = resolve(__dirname, "../dist/index.js");
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
execFileSync("bun", [script, ...args], {
|
|
49
|
+
stdio: "inherit",
|
|
50
|
+
});
|
|
51
|
+
} catch (e) {
|
|
52
|
+
if (e.code === "ENOENT") {
|
|
53
|
+
console.error(
|
|
54
|
+
"\n ClawControl requires the Bun runtime." +
|
|
55
|
+
"\n Install it: curl -fsSL https://bun.sh/install | bash\n"
|
|
56
|
+
);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
// Forward the child's exit code
|
|
60
|
+
process.exit(e.status ?? 1);
|
|
61
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
|
|
3
1
|
// src/index.tsx
|
|
2
|
+
import { createRequire } from "module";
|
|
4
3
|
import { createCliRenderer } from "@opentui/core";
|
|
5
4
|
import { createRoot } from "@opentui/react";
|
|
6
5
|
|
|
@@ -4265,8 +4264,8 @@ function openGhostty(command) {
|
|
|
4265
4264
|
" end tell",
|
|
4266
4265
|
"end tell"
|
|
4267
4266
|
];
|
|
4268
|
-
const
|
|
4269
|
-
const result = spawnSync("osascript",
|
|
4267
|
+
const args2 = appleScript.flatMap((line) => ["-e", line]);
|
|
4268
|
+
const result = spawnSync("osascript", args2, { timeout: 1e4, stdio: "pipe" });
|
|
4270
4269
|
if (result.status === 0) {
|
|
4271
4270
|
return { success: true };
|
|
4272
4271
|
}
|
|
@@ -6441,6 +6440,34 @@ function App() {
|
|
|
6441
6440
|
|
|
6442
6441
|
// src/index.tsx
|
|
6443
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
|
+
}
|
|
6444
6471
|
async function main() {
|
|
6445
6472
|
const renderer = await createCliRenderer({
|
|
6446
6473
|
useMouse: true
|
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clawcontrol",
|
|
3
|
-
"version": "0.1.
|
|
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",
|
|
7
7
|
"bin": {
|
|
8
|
-
"clawcontrol": "
|
|
8
|
+
"clawcontrol": "bin/clawcontrol.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
+
"bin",
|
|
11
12
|
"dist",
|
|
12
13
|
"README.md",
|
|
13
14
|
"LICENSE"
|