@rabbitqa/cli 0.0.0-stage → 0.1.0
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 +4 -2
- package/package.json +25 -4
- package/run.cjs +33 -0
package/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
#
|
|
1
|
+
# RabbitQA CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Install: `npm install -g @rabbitqa/cli`. Run `rqcli --help`.
|
|
4
|
+
Native executable; optional platform packages must be enabled.
|
|
5
|
+
Use `rqcli skills print` for the agent guide.
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rabbitqa/cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "RabbitQA CLI",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"rqcli": "run.cjs"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"run.cjs",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"optionalDependencies": {
|
|
17
|
+
"@rabbitqa/cli-linux-x64": "0.1.0",
|
|
18
|
+
"@rabbitqa/cli-linux-arm64": "0.1.0",
|
|
19
|
+
"@rabbitqa/cli-darwin-x64": "0.1.0",
|
|
20
|
+
"@rabbitqa/cli-darwin-arm64": "0.1.0",
|
|
21
|
+
"@rabbitqa/cli-win32-x64": "0.1.0",
|
|
22
|
+
"@rabbitqa/cli-win32-arm64": "0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/run.cjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const path = require('node:path');
|
|
5
|
+
const { spawnSync } = require('node:child_process');
|
|
6
|
+
const target = `${process.platform}-${process.arch}`;
|
|
7
|
+
const supported = new Set(['darwin-arm64', 'darwin-x64', 'linux-arm64', 'linux-x64', 'win32-arm64', 'win32-x64']);
|
|
8
|
+
if (!supported.has(target)) {
|
|
9
|
+
console.error(`rqcli: unsupported platform ${target}`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
let binary;
|
|
13
|
+
try {
|
|
14
|
+
const manifest = require.resolve(`@rabbitqa/cli-${target}/package.json`);
|
|
15
|
+
binary = path.join(path.dirname(manifest), process.platform === 'win32' ? 'rqcli.exe' : 'rqcli');
|
|
16
|
+
} catch {
|
|
17
|
+
console.error(`rqcli: native package for ${target} is missing; reinstall with npm install -g @rabbitqa/cli --include=optional`);
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
|
20
|
+
const ephemeral = __dirname.split(path.sep).includes('_npx');
|
|
21
|
+
const result = spawnSync(binary, process.argv.slice(2), {
|
|
22
|
+
stdio: 'inherit',
|
|
23
|
+
env: { ...process.env, RQCLI_INSTALL_METHOD: ephemeral ? 'npx' : 'npm' },
|
|
24
|
+
});
|
|
25
|
+
if (result.error) {
|
|
26
|
+
console.error(`rqcli: could not start native executable: ${result.error.message}`);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
if (result.signal) {
|
|
30
|
+
process.kill(process.pid, result.signal);
|
|
31
|
+
} else {
|
|
32
|
+
process.exit(result.status ?? 1);
|
|
33
|
+
}
|