rainbo-cli 0.1.6 → 0.1.7
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 +59 -5
- package/checksums.txt +6 -6
- package/package.json +4 -2
- package/packaging/npm/install.js +1 -2
- package/packaging/npm/run.js +8 -7
package/README.md
CHANGED
|
@@ -5,23 +5,64 @@ Rainbo command line tools for data migration workflows.
|
|
|
5
5
|
## Requirements
|
|
6
6
|
|
|
7
7
|
- Node.js 16+
|
|
8
|
-
-
|
|
8
|
+
- Rust toolchain for source development. End users installing from npm get a prebuilt binary.
|
|
9
9
|
|
|
10
10
|
## Install
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
npm install -g rainbo-cli
|
|
14
|
-
rainbo-cli
|
|
14
|
+
rainbo-cli version
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Development
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
20
|
+
cargo run --manifest-path rust/Cargo.toml -- --version
|
|
21
21
|
npm run build:release
|
|
22
22
|
node packaging/npm/run.js help
|
|
23
|
+
npm run check:skills
|
|
23
24
|
```
|
|
24
25
|
|
|
26
|
+
## Output
|
|
27
|
+
|
|
28
|
+
Command output is structured for humans, scripts, and AI agents:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
rainbo-cli version # JSON envelope on stdout
|
|
32
|
+
rainbo-cli version --format pretty # Human-readable output
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Successful JSON output uses:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{"ok":true,"data":{...}}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Errors are written to stderr:
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{"ok":false,"error":{"type":"validation","subtype":"invalid_argument","message":"..."}}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Update
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
rainbo-cli update --check
|
|
51
|
+
rainbo-cli update
|
|
52
|
+
rainbo-cli update --force
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`update --check` only reports status. `update` detects npm installations,
|
|
56
|
+
runs `npm install -g rainbo-cli@<latest>` when auto-update is available,
|
|
57
|
+
verifies the new binary, and syncs repository skills with:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx skills add work2a/rainbo-cli -y -g
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
If automatic update is unavailable, the JSON action is `manual_required` and
|
|
64
|
+
the response includes release and changelog URLs.
|
|
65
|
+
|
|
25
66
|
## Release
|
|
26
67
|
|
|
27
68
|
1. Update `package.json` version.
|
|
@@ -38,12 +79,25 @@ archives and publish the npm wrapper package.
|
|
|
38
79
|
Publishing uses npm Trusted Publishing (OIDC) from GitHub Actions. No long-lived
|
|
39
80
|
`NPM_TOKEN` secret is required.
|
|
40
81
|
|
|
82
|
+
## Skills
|
|
83
|
+
|
|
84
|
+
Repository skills live in `skills/`. They can be installed from the repository:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
npx skills add work2a/rainbo-cli#main -y -g
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Pull requests publish a preview npm package with `pkg.pr.new` and comment with
|
|
91
|
+
both the CLI update command and the matching skill install command.
|
|
92
|
+
|
|
41
93
|
## Project layout
|
|
42
94
|
|
|
43
95
|
```text
|
|
44
|
-
|
|
45
|
-
R/rainbo_cli/ CLI command, version, output, and update logic
|
|
96
|
+
rust/ Rust CLI implementation
|
|
46
97
|
packaging/npm/ npm postinstall downloader and bin launcher
|
|
47
98
|
tools/release/ release archive builder and tag helper
|
|
99
|
+
skills/ Rainbo skills installable with `npx skills add`
|
|
100
|
+
skill-template/ Template for new Rainbo skills
|
|
101
|
+
scripts/ PR preview packaging and skill format checks
|
|
48
102
|
.github/workflows/ GitHub Release + npm Trusted Publishing workflow
|
|
49
103
|
```
|
package/checksums.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
3ed156f93253d1aa1f33c8d4551d397ca623fed93a4bbc59da0030779430e15b rainbo-cli-0.1.7-darwin-amd64.tar.gz
|
|
2
|
+
37e7cc7c758996b05208c8464fee05b8160a1e4bfc845f4035cbc939855903b0 rainbo-cli-0.1.7-darwin-arm64.tar.gz
|
|
3
|
+
4b21440ba1919bbfaf35759e0596e9072dab937bf70f79f72122e681f897bd30 rainbo-cli-0.1.7-linux-amd64.tar.gz
|
|
4
|
+
8842f49579994fe08cf273fd1f0a3ed436886087337c32810c683820c94c5f92 rainbo-cli-0.1.7-linux-arm64.tar.gz
|
|
5
|
+
44779d87de1f1fb5018f69a4ed021162531f4cf99e3de491d2da8747cf370652 rainbo-cli-0.1.7-windows-amd64.zip
|
|
6
|
+
691d327c1cbbd4ef1bead22c5561a762890f860d73fd1899c6cda6f7ce13c3d0 rainbo-cli-0.1.7-windows-arm64.zip
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rainbo-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Rainbo command line tools for data migration workflows",
|
|
5
5
|
"bin": {
|
|
6
6
|
"rainbo-cli": "packaging/npm/run.js"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build:release": "bash tools/release/build-release.sh",
|
|
10
|
+
"build:pkg-pr-new": "bash scripts/build-pkg-pr-new.sh",
|
|
11
|
+
"check:skills": "node scripts/skill-format-check/index.js",
|
|
10
12
|
"postinstall": "node packaging/npm/install.js",
|
|
11
13
|
"release:tag": "bash tools/release/tag-release.sh",
|
|
12
|
-
"test": "node packaging/npm/run.js
|
|
14
|
+
"test": "cargo test --manifest-path rust/Cargo.toml && node packaging/npm/run.js version && node packaging/npm/run.js help && node packaging/npm/run.js update --check"
|
|
13
15
|
},
|
|
14
16
|
"os": [
|
|
15
17
|
"darwin",
|
package/packaging/npm/install.js
CHANGED
|
@@ -158,10 +158,9 @@ if (require.main === module) {
|
|
|
158
158
|
install();
|
|
159
159
|
} catch (err) {
|
|
160
160
|
console.error(`Failed to install ${NAME}: ${err.message}`);
|
|
161
|
-
console.error(`Make sure
|
|
161
|
+
console.error(`Make sure the v${VERSION} GitHub Release exists for your platform.`);
|
|
162
162
|
process.exit(1);
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
module.exports = { getExpectedChecksum, verifyChecksum, resolveMirrorUrls, assertAllowedHost };
|
|
167
|
-
|
package/packaging/npm/run.js
CHANGED
|
@@ -7,11 +7,11 @@ const path = require("path");
|
|
|
7
7
|
const isWindows = process.platform === "win32";
|
|
8
8
|
const repoRoot = path.join(__dirname, "..", "..");
|
|
9
9
|
const vendorRoot = path.join(repoRoot, "vendor", "rainbo-cli");
|
|
10
|
-
const launcher = path.join(vendorRoot, isWindows ? "rainbo-cli.
|
|
11
|
-
const
|
|
10
|
+
const launcher = path.join(vendorRoot, isWindows ? "rainbo-cli.exe" : "rainbo-cli");
|
|
11
|
+
const sourceManifest = path.join(repoRoot, "rust", "Cargo.toml");
|
|
12
12
|
|
|
13
13
|
function installIfMissing() {
|
|
14
|
-
if (fs.existsSync(launcher) || fs.existsSync(
|
|
14
|
+
if (fs.existsSync(launcher) || fs.existsSync(sourceManifest)) return;
|
|
15
15
|
const result = spawnSync(process.execPath, [path.join(__dirname, "install.js")], {
|
|
16
16
|
stdio: "inherit",
|
|
17
17
|
env: { ...process.env, RAINBO_CLI_RUN: "true" },
|
|
@@ -37,9 +37,11 @@ function recoverWindowsOldLauncher() {
|
|
|
37
37
|
recoverWindowsOldLauncher();
|
|
38
38
|
installIfMissing();
|
|
39
39
|
|
|
40
|
-
const useSource = fs.existsSync(
|
|
41
|
-
const command = useSource ? "
|
|
42
|
-
const args = useSource
|
|
40
|
+
const useSource = fs.existsSync(sourceManifest);
|
|
41
|
+
const command = useSource ? "cargo" : launcher;
|
|
42
|
+
const args = useSource
|
|
43
|
+
? ["run", "--quiet", "--manifest-path", sourceManifest, "--", ...process.argv.slice(2)]
|
|
44
|
+
: process.argv.slice(2);
|
|
43
45
|
const result = spawnSync(command, args, { stdio: "inherit", shell: isWindows });
|
|
44
46
|
|
|
45
47
|
if (result.error) {
|
|
@@ -47,4 +49,3 @@ if (result.error) {
|
|
|
47
49
|
process.exit(1);
|
|
48
50
|
}
|
|
49
51
|
process.exit(result.status || 0);
|
|
50
|
-
|