@sage-protocol/cli 0.9.21
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 +30 -0
- package/bin/sage.js +47 -0
- package/bin/saged.js +47 -0
- package/package.json +24 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @sage-protocol/cli
|
|
2
|
+
|
|
3
|
+
Sage Protocol CLI — prompt libraries, skills, governance, and on-chain operations.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @sage-protocol/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
sage --help
|
|
15
|
+
sage --version
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Platforms
|
|
19
|
+
|
|
20
|
+
Pre-built binaries are available for:
|
|
21
|
+
|
|
22
|
+
- macOS Apple Silicon (arm64)
|
|
23
|
+
- macOS Intel (x64)
|
|
24
|
+
- Linux x64
|
|
25
|
+
- Linux arm64
|
|
26
|
+
- Windows x64
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
GPL-3.0-or-later
|
package/bin/sage.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const PLATFORMS = {
|
|
7
|
+
"darwin-arm64": "@sage-protocol/sage-darwin-arm64",
|
|
8
|
+
"darwin-x64": "@sage-protocol/sage-darwin-x64",
|
|
9
|
+
"linux-arm64": "@sage-protocol/sage-linux-arm64",
|
|
10
|
+
"linux-x64": "@sage-protocol/sage-linux-x64",
|
|
11
|
+
"win32-x64": "@sage-protocol/sage-win32-x64",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const key = `${process.platform}-${process.arch}`;
|
|
15
|
+
const pkg = PLATFORMS[key];
|
|
16
|
+
|
|
17
|
+
if (!pkg) {
|
|
18
|
+
console.error(
|
|
19
|
+
`Unsupported platform: ${process.platform}-${process.arch}\n` +
|
|
20
|
+
`Supported: ${Object.keys(PLATFORMS).join(", ")}`
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
26
|
+
let binPath;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
binPath = require.resolve(`${pkg}/bin/sage${ext}`);
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(
|
|
32
|
+
`Could not find the sage binary for your platform (${key}).\n` +
|
|
33
|
+
`Expected package: ${pkg}\n\n` +
|
|
34
|
+
`This may happen if optional dependencies were not installed.\n` +
|
|
35
|
+
`Try reinstalling: npm i -g @sage-protocol/sage`
|
|
36
|
+
);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
42
|
+
} catch (e) {
|
|
43
|
+
if (e.status !== null) {
|
|
44
|
+
process.exit(e.status);
|
|
45
|
+
}
|
|
46
|
+
throw e;
|
|
47
|
+
}
|
package/bin/saged.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
const PLATFORMS = {
|
|
7
|
+
"darwin-arm64": "@sage-protocol/sage-darwin-arm64",
|
|
8
|
+
"darwin-x64": "@sage-protocol/sage-darwin-x64",
|
|
9
|
+
"linux-arm64": "@sage-protocol/sage-linux-arm64",
|
|
10
|
+
"linux-x64": "@sage-protocol/sage-linux-x64",
|
|
11
|
+
"win32-x64": "@sage-protocol/sage-win32-x64",
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const key = `${process.platform}-${process.arch}`;
|
|
15
|
+
const pkg = PLATFORMS[key];
|
|
16
|
+
|
|
17
|
+
if (!pkg) {
|
|
18
|
+
console.error(
|
|
19
|
+
`Unsupported platform: ${process.platform}-${process.arch}\n` +
|
|
20
|
+
`Supported: ${Object.keys(PLATFORMS).join(", ")}`
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const ext = process.platform === "win32" ? ".exe" : "";
|
|
26
|
+
let binPath;
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
binPath = require.resolve(`${pkg}/bin/saged${ext}`);
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(
|
|
32
|
+
`Could not find the saged binary for your platform (${key}).\n` +
|
|
33
|
+
`Expected package: ${pkg}\n\n` +
|
|
34
|
+
`This may happen if optional dependencies were not installed.\n` +
|
|
35
|
+
`Try reinstalling: npm i -g @sage-protocol/sage`
|
|
36
|
+
);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
try {
|
|
41
|
+
execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
42
|
+
} catch (e) {
|
|
43
|
+
if (e.status !== null) {
|
|
44
|
+
process.exit(e.status);
|
|
45
|
+
}
|
|
46
|
+
throw e;
|
|
47
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sage-protocol/cli",
|
|
3
|
+
"version": "0.9.21",
|
|
4
|
+
"description": "Sage Protocol CLI — prompt libraries, skills, governance, and on-chain operations",
|
|
5
|
+
"bin": {
|
|
6
|
+
"sage": "bin/sage.js",
|
|
7
|
+
"saged": "bin/saged.js"
|
|
8
|
+
},
|
|
9
|
+
"optionalDependencies": {
|
|
10
|
+
"@sage-protocol/cli-darwin-arm64": "0.9.21",
|
|
11
|
+
"@sage-protocol/cli-darwin-x64": "0.9.21",
|
|
12
|
+
"@sage-protocol/cli-linux-x64": "0.9.21",
|
|
13
|
+
"@sage-protocol/cli-win32-x64": "0.9.21"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"bin/",
|
|
17
|
+
"README.md"
|
|
18
|
+
],
|
|
19
|
+
"license": "GPL-3.0-or-later",
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "https://github.com/sage-protocol/sage"
|
|
23
|
+
}
|
|
24
|
+
}
|