@sys9/run9-cli 0.10.1 → 0.10.2-beta.1-linux-x64
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 +31 -5
- package/package.json +11 -17
- package/vendor/x86_64-unknown-linux-musl/run9/run9 +0 -0
- package/bin/run9.js +0 -130
package/README.md
CHANGED
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
# @sys9/run9-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@sys9/run9-cli` installs the standalone `run9` binary.
|
|
4
4
|
|
|
5
5
|
Install:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install -g @sys9/cli
|
|
8
|
+
npm install -g @sys9/run9-cli
|
|
9
9
|
# or
|
|
10
|
-
bun install -g @sys9/cli
|
|
10
|
+
bun install -g @sys9/run9-cli
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Run:
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
|
|
16
|
+
run9 --help
|
|
17
|
+
run9 auth login --endpoint https://api.run.sys9.ai --ak ak-... --sk sk-...
|
|
18
|
+
run9 box create
|
|
19
|
+
run9 box exec my-box /bin/sh -lc 'echo hello'
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
Key commands:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
run9 project ls
|
|
26
|
+
run9 box ls
|
|
27
|
+
run9 snap ls
|
|
28
|
+
run9 shared-snap ls
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For automation, use `--json`:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
run9 box ls --json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If you prefer the full Sys9 CLI suite, install `@sys9/cli` and run the same commands as `sys9 run ...`.
|
|
38
|
+
|
|
39
|
+
Supported platforms:
|
|
40
|
+
|
|
41
|
+
- macOS: Apple Silicon, Intel
|
|
42
|
+
- Linux: x86_64, arm64
|
|
43
|
+
- Windows: unsupported
|
|
44
|
+
|
|
45
|
+
Repository and full documentation: [sys9-ai/run9-cli](https://github.com/sys9-ai/run9-cli)
|
package/package.json
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sys9/run9-cli",
|
|
3
|
-
"version": "0.10.1",
|
|
4
|
-
"description": "run9 CLI
|
|
3
|
+
"version": "0.10.2-beta.1-linux-x64",
|
|
4
|
+
"description": "run9 CLI for boxes, snaps, projects, and execs",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
6
|
+
"os": [
|
|
7
|
+
"linux"
|
|
8
|
+
],
|
|
9
|
+
"cpu": [
|
|
10
|
+
"x64"
|
|
11
|
+
],
|
|
12
12
|
"files": [
|
|
13
|
-
"
|
|
13
|
+
"vendor"
|
|
14
14
|
],
|
|
15
|
-
"publishConfig": {
|
|
16
|
-
"access": "public"
|
|
17
|
-
},
|
|
18
15
|
"repository": {
|
|
19
16
|
"type": "git",
|
|
20
17
|
"url": "https://github.com/sys9-ai/run9-cli.git",
|
|
21
18
|
"directory": "npm"
|
|
22
19
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"@sys9/run9-cli-linux-arm64": "npm:@sys9/run9-cli@0.10.1-linux-arm64",
|
|
26
|
-
"@sys9/run9-cli-darwin-x64": "npm:@sys9/run9-cli@0.10.1-darwin-x64",
|
|
27
|
-
"@sys9/run9-cli-darwin-arm64": "npm:@sys9/run9-cli@0.10.1-darwin-arm64"
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=16"
|
|
28
22
|
}
|
|
29
23
|
}
|
|
Binary file
|
package/bin/run9.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawn } = require("node:child_process");
|
|
4
|
-
const { existsSync } = require("node:fs");
|
|
5
|
-
const path = require("node:path");
|
|
6
|
-
|
|
7
|
-
const PLATFORM_PACKAGE_BY_TARGET = {
|
|
8
|
-
"x86_64-unknown-linux-musl": "@sys9/run9-cli-linux-x64",
|
|
9
|
-
"aarch64-unknown-linux-musl": "@sys9/run9-cli-linux-arm64",
|
|
10
|
-
"x86_64-apple-darwin": "@sys9/run9-cli-darwin-x64",
|
|
11
|
-
"aarch64-apple-darwin": "@sys9/run9-cli-darwin-arm64",
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
function detectPackageManager() {
|
|
15
|
-
const userAgent = process.env.npm_config_user_agent || "";
|
|
16
|
-
if (/\bbun\//.test(userAgent)) {
|
|
17
|
-
return "bun";
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const execPath = process.env.npm_execpath || "";
|
|
21
|
-
if (execPath.includes("bun")) {
|
|
22
|
-
return "bun";
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (
|
|
26
|
-
__dirname.includes(".bun/install/global") ||
|
|
27
|
-
__dirname.includes(".bun\\install\\global")
|
|
28
|
-
) {
|
|
29
|
-
return "bun";
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return userAgent ? "npm" : null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function resolveTargetTriple(platformName, archName) {
|
|
36
|
-
switch (platformName) {
|
|
37
|
-
case "linux":
|
|
38
|
-
case "android":
|
|
39
|
-
switch (archName) {
|
|
40
|
-
case "x64":
|
|
41
|
-
return "x86_64-unknown-linux-musl";
|
|
42
|
-
case "arm64":
|
|
43
|
-
return "aarch64-unknown-linux-musl";
|
|
44
|
-
default:
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
case "darwin":
|
|
48
|
-
switch (archName) {
|
|
49
|
-
case "x64":
|
|
50
|
-
return "x86_64-apple-darwin";
|
|
51
|
-
case "arm64":
|
|
52
|
-
return "aarch64-apple-darwin";
|
|
53
|
-
default:
|
|
54
|
-
return null;
|
|
55
|
-
}
|
|
56
|
-
default:
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function resolveBinaryPath(vendorRoot, targetTriple) {
|
|
62
|
-
const binaryName = process.platform === "win32" ? "run9.exe" : "run9";
|
|
63
|
-
const binaryPath = path.join(vendorRoot, targetTriple, "run9", binaryName);
|
|
64
|
-
return existsSync(binaryPath) ? binaryPath : null;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
const targetTriple = resolveTargetTriple(process.platform, process.arch);
|
|
68
|
-
if (!targetTriple) {
|
|
69
|
-
throw new Error(`Unsupported platform: ${process.platform} (${process.arch})`);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const platformPackage = PLATFORM_PACKAGE_BY_TARGET[targetTriple];
|
|
73
|
-
if (!platformPackage) {
|
|
74
|
-
throw new Error(`Unsupported target triple: ${targetTriple}`);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
let binaryPath = null;
|
|
78
|
-
try {
|
|
79
|
-
const packageJsonPath = require.resolve(`${platformPackage}/package.json`);
|
|
80
|
-
binaryPath = resolveBinaryPath(
|
|
81
|
-
path.join(path.dirname(packageJsonPath), "vendor"),
|
|
82
|
-
targetTriple,
|
|
83
|
-
);
|
|
84
|
-
} catch {
|
|
85
|
-
binaryPath = resolveBinaryPath(path.join(__dirname, "..", "vendor"), targetTriple);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (!binaryPath) {
|
|
89
|
-
const packageManager = detectPackageManager();
|
|
90
|
-
const updateCommand =
|
|
91
|
-
packageManager === "bun"
|
|
92
|
-
? "bun install -g @sys9/run9-cli@latest"
|
|
93
|
-
: "npm install -g @sys9/run9-cli@latest";
|
|
94
|
-
throw new Error(
|
|
95
|
-
`Missing optional dependency ${platformPackage}. Reinstall run9: ${updateCommand}`,
|
|
96
|
-
);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
100
|
-
stdio: "inherit",
|
|
101
|
-
env: process.env,
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
child.on("error", (err) => {
|
|
105
|
-
console.error(err);
|
|
106
|
-
process.exit(1);
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
const forwardSignal = (signal) => {
|
|
110
|
-
if (child.killed) {
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
try {
|
|
114
|
-
child.kill(signal);
|
|
115
|
-
} catch {
|
|
116
|
-
// Ignore failures while the child is already exiting.
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
|
|
121
|
-
process.on(signal, () => forwardSignal(signal));
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
child.on("exit", (code, signal) => {
|
|
125
|
-
if (signal) {
|
|
126
|
-
process.kill(process.pid, signal);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
process.exit(code ?? 1);
|
|
130
|
-
});
|