@scalequality/cli 0.1.0 → 0.3.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 +58 -8
- package/bin/scalequality.mjs +19 -8
- package/dist/connect.build.json +2 -2
- package/dist/connect.cjs +2283 -483
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,16 +1,65 @@
|
|
|
1
1
|
# @scalequality/cli
|
|
2
2
|
|
|
3
3
|
Run the ScaleQuality AI Workspace coding engine on your own machine, in your
|
|
4
|
-
repository
|
|
4
|
+
repository folders. The conversation stays in the browser; the files, the
|
|
5
5
|
commands and the git working tree stay on your computer.
|
|
6
6
|
|
|
7
|
+
## Connect this computer (recommended)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @scalequality/cli login # prints a code; confirm it in ScaleQuality
|
|
11
|
+
npx @scalequality/cli add ~/code/app # a folder the AI Workspace may use
|
|
12
|
+
npx @scalequality/cli up # keep the computer connected
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`login` prints a code and an address (`<ScaleQuality>/devices?code=XXXX-XXXX`).
|
|
16
|
+
Open it while signed in to ScaleQuality and confirm the code; the computer is
|
|
17
|
+
then yours, in that organization, and `login` goes on running `up`. Only
|
|
18
|
+
confirm a code you started yourself.
|
|
19
|
+
|
|
20
|
+
| Command | What it does |
|
|
21
|
+
|---------|--------------|
|
|
22
|
+
| `scalequality login [--api URL] [--name NAME] [--no-up]` | Connects this computer (device code, like signing in to a TV app). |
|
|
23
|
+
| `scalequality up [--api URL] [--verbose]` | Keeps it connected: sessions started in the AI Workspace run here, in your folders. Ctrl+C disconnects. |
|
|
24
|
+
| `scalequality add [PATH]` | Adds a folder (default: the current one). Only folders inside your home folder, never the home folder itself. |
|
|
25
|
+
| `scalequality logout [--api URL]` | Disconnects this computer in ScaleQuality and deletes the local credential. |
|
|
26
|
+
|
|
27
|
+
The credential is stored in `~/.scalequality/credentials.json`, readable only
|
|
28
|
+
by you (mode 0600), one entry per ScaleQuality address; ScaleQuality keeps only
|
|
29
|
+
its hash. It opens only this computer's queue: each session gets its own
|
|
30
|
+
one-time secret, and no repository token is ever sent to your computer. You can
|
|
31
|
+
also disconnect the computer from the AI Workspace.
|
|
32
|
+
|
|
33
|
+
While `up` runs, the AI Workspace can:
|
|
34
|
+
|
|
35
|
+
- start a session in one of your folders (at most 3 at once);
|
|
36
|
+
- add a folder you pick there (it is checked here: it must exist, be inside
|
|
37
|
+
your home folder and not be the home folder);
|
|
38
|
+
- list your Claude Code (`~/.claude/projects`) and Codex (`~/.codex/sessions`)
|
|
39
|
+
conversations, and import the ones you choose. Secrets (cloud keys, provider
|
|
40
|
+
tokens, private keys, JWTs, connection strings, `password=`-style values) are
|
|
41
|
+
removed on this computer before anything is sent, and the list itself goes
|
|
42
|
+
without them. Only text is imported; tool results are left out and each tool
|
|
43
|
+
call becomes a one-line summary.
|
|
44
|
+
|
|
45
|
+
A Claude Code conversation continued on the same computer and folder resumes
|
|
46
|
+
from its own transcript: a copy without secrets is written into the engine's
|
|
47
|
+
folder (`~/.scalequality/workspace`); the original file is never changed.
|
|
48
|
+
|
|
49
|
+
Every command a session wants to run is confirmed in the terminal where `up`
|
|
50
|
+
runs, one question at a time. Without a terminal (for example, `up` started in
|
|
51
|
+
the background) those commands are denied.
|
|
52
|
+
|
|
53
|
+
## One session with a code
|
|
54
|
+
|
|
7
55
|
```bash
|
|
8
56
|
cd path/to/your/repository
|
|
9
57
|
npx @scalequality/cli connect <code>
|
|
10
58
|
```
|
|
11
59
|
|
|
12
60
|
Get the command, with its code, in the AI Workspace: choose **Use a folder on
|
|
13
|
-
your computer**. The code opens only that session; treat it like a password.
|
|
61
|
+
your computer**. The code opens only that session; treat it like a password. No
|
|
62
|
+
login is needed.
|
|
14
63
|
|
|
15
64
|
Options:
|
|
16
65
|
|
|
@@ -74,15 +123,16 @@ in the browser as they happen, and each file can be discarded there.
|
|
|
74
123
|
|
|
75
124
|
## Stopping
|
|
76
125
|
|
|
77
|
-
- `Ctrl+C` once stops the current request (a pending command is
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- Closing the session in the browser also
|
|
126
|
+
- `connect`: `Ctrl+C` once stops the current request (a pending command is
|
|
127
|
+
denied); `Ctrl+C` again disconnects, after saving the session's checkpoint.
|
|
128
|
+
- `up`: `Ctrl+C` saves every running session and disconnects the computer.
|
|
129
|
+
- Your folder keeps every change. Closing the session in the browser also
|
|
130
|
+
ends it here.
|
|
81
131
|
|
|
82
132
|
## For maintainers
|
|
83
133
|
|
|
84
|
-
`dist/connect.cjs` is built in the ScaleQuality ai-governance
|
|
85
|
-
`src/main/workspace-connect.ts`:
|
|
134
|
+
`dist/connect.cjs` (every command) is built in the ScaleQuality ai-governance
|
|
135
|
+
service from `src/main/workspace-connect.ts`:
|
|
86
136
|
|
|
87
137
|
```bash
|
|
88
138
|
# in scalequality-ai-governance-service
|
package/bin/scalequality.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// ScaleQuality CLI. The engine of
|
|
3
|
-
// ai-governance service
|
|
4
|
-
// dist/connect.cjs by `npm run sync`.
|
|
2
|
+
// ScaleQuality CLI. The engine of every command (connect, login, up, add,
|
|
3
|
+
// logout) is built in the ScaleQuality ai-governance service
|
|
4
|
+
// (src/main/workspace-connect.ts) and copied into dist/connect.cjs by `npm run sync`.
|
|
5
5
|
import { createRequire } from 'node:module'
|
|
6
6
|
import { existsSync, readFileSync } from 'node:fs'
|
|
7
7
|
import { fileURLToPath } from 'node:url'
|
|
@@ -13,14 +13,25 @@ const engine = fileURLToPath(new URL('../dist/connect.cjs', import.meta.url))
|
|
|
13
13
|
const HELP = `ScaleQuality CLI ${pkg.version}
|
|
14
14
|
|
|
15
15
|
Usage:
|
|
16
|
+
scalequality login [--api URL] [--name NAME]
|
|
17
|
+
Connect this computer to your ScaleQuality account (you confirm a code in
|
|
18
|
+
ScaleQuality), then keep it connected.
|
|
19
|
+
scalequality up [--api URL]
|
|
20
|
+
Keep this computer connected: the AI Workspace can run sessions in the
|
|
21
|
+
folders you added and import your Claude Code and Codex conversations.
|
|
22
|
+
scalequality add [PATH]
|
|
23
|
+
Add a folder (default: the current one) for the AI Workspace to use.
|
|
24
|
+
scalequality logout [--api URL]
|
|
25
|
+
Disconnect this computer and delete its local credential.
|
|
16
26
|
scalequality connect <code> [--api URL] [--dir PATH]
|
|
17
|
-
Work on this repository folder from the
|
|
18
|
-
|
|
27
|
+
Work on this repository folder for one session, with a code from the AI
|
|
28
|
+
Workspace ("Use a folder on your computer"). No login needed.
|
|
19
29
|
scalequality --help
|
|
20
30
|
scalequality --version
|
|
21
31
|
|
|
22
|
-
Run "scalequality
|
|
32
|
+
Run "scalequality <command> --help" for the options of a command.`
|
|
23
33
|
|
|
34
|
+
const COMMANDS = new Set(['connect', 'login', 'up', 'add', 'logout'])
|
|
24
35
|
const [command] = process.argv.slice(2)
|
|
25
36
|
|
|
26
37
|
if (!command || command === '--help' || command === '-h' || command === 'help') {
|
|
@@ -31,7 +42,7 @@ if (command === '--version' || command === '-v' || command === 'version') {
|
|
|
31
42
|
process.stdout.write(`${pkg.version}\n`)
|
|
32
43
|
process.exit(0)
|
|
33
44
|
}
|
|
34
|
-
if (command
|
|
45
|
+
if (!COMMANDS.has(command)) {
|
|
35
46
|
process.stderr.write(`Unknown command: ${command}\n\n${HELP}\n`)
|
|
36
47
|
process.exit(2)
|
|
37
48
|
}
|
|
@@ -46,5 +57,5 @@ if (!existsSync(engine)) {
|
|
|
46
57
|
process.exit(1)
|
|
47
58
|
}
|
|
48
59
|
process.env.SCALEQUALITY_CLI_VERSION = pkg.version
|
|
49
|
-
// The engine reads process.argv itself: [node, this file,
|
|
60
|
+
// The engine reads process.argv itself: [node, this file, <command>, ...arguments].
|
|
50
61
|
require(engine)
|
package/dist/connect.build.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sdkVersion": "0.3.281",
|
|
3
|
-
"sha256": "
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"sha256": "94cfee975f0d72f2ca33b6a7418f0de48cb67c9603ed4408c4ca926dffb9e4cb",
|
|
4
|
+
"sourceCommit": "c5d6984abde6859165720afe67885521eb08787b"
|
|
5
5
|
}
|