@computesphere/csph 0.11.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/README.md +20 -0
- package/bin/csph.js +56 -0
- package/package.json +41 -0
package/README.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# @computesphere/csph
|
|
2
|
+
|
|
3
|
+
The [ComputeSphere](https://computesphere.com) CLI — deploy and manage services
|
|
4
|
+
from your terminal.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
# one-off, no install
|
|
8
|
+
npx @computesphere/csph deploy
|
|
9
|
+
|
|
10
|
+
# or install globally
|
|
11
|
+
npm install -g @computesphere/csph
|
|
12
|
+
csph auth login
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The platform binary ships in a per-OS/arch optional dependency; installing this
|
|
16
|
+
package pulls in only the one matching your machine. No postinstall step runs,
|
|
17
|
+
so it works with `npx` and `npm install --ignore-scripts`.
|
|
18
|
+
|
|
19
|
+
Other install methods (Homebrew, install script, direct download) and full docs:
|
|
20
|
+
<https://docs.computesphere.com/docs/cli/getting-started>.
|
package/bin/csph.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
// Launcher for the ComputeSphere CLI. The actual `csph` binary ships in a
|
|
5
|
+
// platform-specific optional dependency (@computesphere/csph-<os>-<cpu>); npm
|
|
6
|
+
// installs only the one matching this machine. We resolve that binary and hand
|
|
7
|
+
// off to it. No postinstall step is involved, so this works with `npx` and with
|
|
8
|
+
// `npm install --ignore-scripts`.
|
|
9
|
+
|
|
10
|
+
const { spawnSync } = require("child_process");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
|
|
13
|
+
const platform = process.platform; // 'darwin' | 'linux' | 'win32' | ...
|
|
14
|
+
const arch = process.arch; // 'x64' | 'arm64' | 'arm' | 'ia32' | ...
|
|
15
|
+
|
|
16
|
+
const pkg = `@computesphere/csph-${platform}-${arch}`;
|
|
17
|
+
const binName = platform === "win32" ? "csph.exe" : "csph";
|
|
18
|
+
|
|
19
|
+
function resolveBinary() {
|
|
20
|
+
try {
|
|
21
|
+
return require.resolve(`${pkg}/bin/${binName}`);
|
|
22
|
+
} catch (_) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const binPath = resolveBinary();
|
|
28
|
+
|
|
29
|
+
if (!binPath || !fs.existsSync(binPath)) {
|
|
30
|
+
console.error(
|
|
31
|
+
`\ncsph: no prebuilt binary found for your platform (${platform}-${arch}).\n\n` +
|
|
32
|
+
`The matching package "${pkg}" is not installed. This usually means:\n` +
|
|
33
|
+
` • your platform isn't supported yet, or\n` +
|
|
34
|
+
` • the install skipped optional dependencies.\n\n` +
|
|
35
|
+
`Try reinstalling: npm install -g @computesphere/csph\n` +
|
|
36
|
+
`Or install another way: https://docs.computesphere.com/docs/cli/getting-started\n`,
|
|
37
|
+
);
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Best-effort: ensure the binary is executable (npm normally preserves mode).
|
|
42
|
+
if (platform !== "win32") {
|
|
43
|
+
try {
|
|
44
|
+
fs.chmodSync(binPath, 0o755);
|
|
45
|
+
} catch (_) {
|
|
46
|
+
/* ignore */
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
51
|
+
|
|
52
|
+
if (result.error) {
|
|
53
|
+
console.error(`csph: failed to launch binary: ${result.error.message}`);
|
|
54
|
+
process.exit(1);
|
|
55
|
+
}
|
|
56
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@computesphere/csph",
|
|
3
|
+
"version": "0.11.6",
|
|
4
|
+
"description": "ComputeSphere CLI (csph) — deploy and manage ComputeSphere from your terminal.",
|
|
5
|
+
"bin": {
|
|
6
|
+
"csph": "bin/csph.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin/csph.js"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"computesphere",
|
|
13
|
+
"cli",
|
|
14
|
+
"csph",
|
|
15
|
+
"paas",
|
|
16
|
+
"deploy"
|
|
17
|
+
],
|
|
18
|
+
"homepage": "https://computesphere.com",
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/computesphere/cli.git"
|
|
22
|
+
},
|
|
23
|
+
"bugs": {
|
|
24
|
+
"url": "https://github.com/computesphere/cli/issues"
|
|
25
|
+
},
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=16"
|
|
29
|
+
},
|
|
30
|
+
"optionalDependencies": {
|
|
31
|
+
"@computesphere/csph-darwin-x64": "0.11.6",
|
|
32
|
+
"@computesphere/csph-darwin-arm64": "0.11.6",
|
|
33
|
+
"@computesphere/csph-linux-x64": "0.11.6",
|
|
34
|
+
"@computesphere/csph-linux-arm64": "0.11.6",
|
|
35
|
+
"@computesphere/csph-linux-arm": "0.11.6",
|
|
36
|
+
"@computesphere/csph-linux-ia32": "0.11.6",
|
|
37
|
+
"@computesphere/csph-win32-x64": "0.11.6",
|
|
38
|
+
"@computesphere/csph-win32-arm64": "0.11.6",
|
|
39
|
+
"@computesphere/csph-win32-ia32": "0.11.6"
|
|
40
|
+
}
|
|
41
|
+
}
|