@scalequality/cli 0.3.3 → 0.4.1
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 +119 -68
- package/bin/scalequality.mjs +14 -12
- package/dist/connect.build.json +2 -2
- package/dist/connect.cjs +3443 -728
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,36 +1,80 @@
|
|
|
1
1
|
# @scalequality/cli
|
|
2
2
|
|
|
3
|
-
Run the ScaleQuality AI Workspace coding engine on your own machine, in
|
|
4
|
-
repository
|
|
5
|
-
|
|
3
|
+
Run the ScaleQuality AI Workspace coding engine on your own machine, in any
|
|
4
|
+
folder: a git repository, a folder inside one, or a folder with several
|
|
5
|
+
repositories and other files. The conversation stays in the browser; the files,
|
|
6
|
+
the commands and the git working trees stay on your computer.
|
|
6
7
|
|
|
7
|
-
## Connect this computer
|
|
8
|
+
## Connect this computer
|
|
8
9
|
|
|
9
10
|
```bash
|
|
10
11
|
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
|
|
12
|
+
npx @scalequality/cli add ~/code/app # a folder the AI Workspace may use (or pick it in the browser)
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
`login` prints a code and an address (`<ScaleQuality>/devices?code=XXXX-XXXX`).
|
|
16
16
|
Open it while signed in to ScaleQuality and confirm the code; the computer is
|
|
17
|
-
then yours, in that organization
|
|
18
|
-
|
|
17
|
+
then yours, in that organization. Only confirm a code you started yourself.
|
|
18
|
+
|
|
19
|
+
Right after that, `login` installs a **background service** that keeps the
|
|
20
|
+
computer connected, also after a restart. There is nothing to keep open.
|
|
19
21
|
|
|
20
22
|
| Command | What it does |
|
|
21
23
|
|---------|--------------|
|
|
22
|
-
| `scalequality login [--api URL] [--name NAME]
|
|
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 login [--api URL] [--name NAME]` | Connects this computer (device code, like signing in to a TV app) and installs the background service. |
|
|
24
25
|
| `scalequality add [PATH]` | Adds a folder (default: the current one). Only folders inside your home folder, never the home folder itself. |
|
|
25
|
-
| `scalequality
|
|
26
|
+
| `scalequality service status` | Whether the service is installed and running, what it runs and where it logs. |
|
|
27
|
+
| `scalequality service logs [--lines N]` | The last lines of its log (default 100). |
|
|
28
|
+
| `scalequality service install` | Installs it again, or updates it to the version you run. |
|
|
29
|
+
| `scalequality service start` | Starts it again (the same as `install`), for example after it stopped. |
|
|
30
|
+
| `scalequality service uninstall` | Stops and removes it. The computer stays paired but is not connected until you install it again. |
|
|
31
|
+
| `scalequality logout [--api URL]` | Stops and removes the service, disconnects this computer in ScaleQuality and deletes the local credential. |
|
|
32
|
+
|
|
33
|
+
Every command takes `--api URL` for another ScaleQuality address (for example
|
|
34
|
+
`https://staging.scalequality.io`); each address has its own credential and its
|
|
35
|
+
own service.
|
|
36
|
+
|
|
37
|
+
### What runs in the background
|
|
38
|
+
|
|
39
|
+
`login` copies this package and its dependencies to
|
|
40
|
+
`~/.scalequality/cli/<version>/` (hard links when the disk allows, so it takes
|
|
41
|
+
no extra space) and registers a per-user service that runs
|
|
42
|
+
`node ~/.scalequality/cli/<version>/node_modules/@scalequality/cli/bin/scalequality.mjs up --service`
|
|
43
|
+
at logon. It never runs from the npx cache, and nothing needs administrator
|
|
44
|
+
rights:
|
|
45
|
+
|
|
46
|
+
| System | Service | Log |
|
|
47
|
+
|--------|---------|-----|
|
|
48
|
+
| macOS | LaunchAgent `~/Library/LaunchAgents/io.scalequality.cli.plist` (RunAtLoad, restarted if it stops unexpectedly), loaded with `launchctl bootstrap gui/<uid>` | `~/Library/Logs/ScaleQuality/scalequality.log` |
|
|
49
|
+
| Linux | systemd user unit `~/.config/systemd/user/scalequality.service` (`Restart=on-failure`) | `~/.local/state/scalequality/logs/scalequality.log` |
|
|
50
|
+
| Windows | Task at logon `ScaleQuality\CLI` (or, where a task cannot be created, a launcher in your Startup folder), started hidden | `%LOCALAPPDATA%\ScaleQuality\Logs\scalequality.log` |
|
|
51
|
+
|
|
52
|
+
On Linux the user service runs while you are logged in; `login` tells you when
|
|
53
|
+
`loginctl enable-linger $USER` is needed to keep it connected after you log out.
|
|
54
|
+
For another address, the names carry its host (for example
|
|
55
|
+
`io.scalequality.cli.staging-scalequality-io-1a2b3c`). The service gets the
|
|
56
|
+
`PATH` you had when you ran `login`, so sessions find git, npm and your
|
|
57
|
+
toolchains; run `scalequality service install` again after changing them.
|
|
58
|
+
|
|
59
|
+
Where a service cannot be installed (a device management profile blocks login
|
|
60
|
+
items, a Linux machine without a systemd user session), `login` says why and
|
|
61
|
+
keeps the computer connected in that terminal instead; keep it open.
|
|
62
|
+
|
|
63
|
+
### How to disconnect
|
|
64
|
+
|
|
65
|
+
- `scalequality logout`: removes the service and the CLI copy, disconnects the
|
|
66
|
+
computer and deletes the credential.
|
|
67
|
+
- **Disconnect** in the AI Workspace: the service notices at its next poll,
|
|
68
|
+
deletes the credential, removes its own definition and stops.
|
|
69
|
+
- `scalequality service uninstall`: only stops and removes the service (the
|
|
70
|
+
computer stays paired).
|
|
26
71
|
|
|
27
72
|
The credential is stored in `~/.scalequality/credentials.json`, readable only
|
|
28
73
|
by you (mode 0600), one entry per ScaleQuality address; ScaleQuality keeps only
|
|
29
74
|
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.
|
|
31
|
-
also disconnect the computer from the AI Workspace.
|
|
75
|
+
one-time secret, and no repository token is ever sent to your computer.
|
|
32
76
|
|
|
33
|
-
|
|
77
|
+
### What the AI Workspace can do while the computer is connected
|
|
34
78
|
|
|
35
79
|
- start a session in one of your folders (at most 3 at once);
|
|
36
80
|
- add a folder you pick there (it is checked here: it must exist, be inside
|
|
@@ -49,14 +93,14 @@ While `up` runs, the AI Workspace can:
|
|
|
49
93
|
without them. Only text is imported; tool results are left out and each tool
|
|
50
94
|
call becomes a one-line summary.
|
|
51
95
|
|
|
52
|
-
### What
|
|
96
|
+
### What the service counts to suggest an import
|
|
53
97
|
|
|
54
|
-
When
|
|
98
|
+
When the service starts, and then at most once every 6 hours while it runs, it counts
|
|
55
99
|
the Claude Code and Codex conversations on this computer, so the AI Workspace
|
|
56
100
|
can offer to import them. It reads the same files the import list reads
|
|
57
101
|
(`~/.claude/projects/*/*.jsonl`, or `CLAUDE_CONFIG_DIR`; `~/.codex/sessions/**/rollout-*.jsonl`,
|
|
58
102
|
or `CODEX_HOME`), at most the 500 most recent, each only up to its first
|
|
59
|
-
message, and
|
|
103
|
+
message, and writes one line to its log, such as:
|
|
60
104
|
|
|
61
105
|
```
|
|
62
106
|
Found 28 Claude Code and 11 Codex conversations on this computer. You can import them from the browser.
|
|
@@ -71,31 +115,30 @@ A Claude Code conversation continued on the same computer and folder resumes
|
|
|
71
115
|
from its own transcript: a copy without secrets is written into the engine's
|
|
72
116
|
folder (`~/.scalequality/workspace`); the original file is never changed.
|
|
73
117
|
|
|
74
|
-
|
|
75
|
-
runs, one question at a time. Without a terminal (for example, `up` started in
|
|
76
|
-
the background) those commands are denied.
|
|
77
|
-
|
|
78
|
-
## One session with a code
|
|
118
|
+
## One session with a code (older screens)
|
|
79
119
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
120
|
+
`scalequality connect <code>` still works for a one-time code from an older AI
|
|
121
|
+
Workspace screen: it runs one session in the current folder (`--dir PATH`,
|
|
122
|
+
`--api URL`, `--verbose`) and ends when you press Ctrl+C twice. It is not listed
|
|
123
|
+
in the help: `login` replaces it.
|
|
84
124
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
login is needed.
|
|
125
|
+
Requires Node.js 18 or newer and git. Any folder works; the CLI never runs
|
|
126
|
+
`git init`, clones or fetches for you.
|
|
88
127
|
|
|
89
|
-
|
|
128
|
+
## Any folder
|
|
90
129
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
130
|
+
- **A git repository**: its change is compared with `HEAD`.
|
|
131
|
+
- **A folder inside a repository**: the engine works in that folder; the
|
|
132
|
+
repository tracks its change (only that folder's files).
|
|
133
|
+
- **A folder that is not a repository** (for example `~/GIT` with many
|
|
134
|
+
repositories inside): the repositories in it are found (up to 4 levels down,
|
|
135
|
+
skipping `node_modules`, build output and hidden folders) and each one keeps
|
|
136
|
+
its own change against its own `HEAD`. Files outside every repository are
|
|
137
|
+
copied before the engine first changes them, into
|
|
138
|
+
`~/.scalequality/workspace/sessions/` (never into your folder), so you can
|
|
139
|
+
review, discard or rewind those changes too. Copies of sessions unused for 30
|
|
140
|
+
days are removed. Changes made by shell commands to files outside a
|
|
141
|
+
repository are not tracked.
|
|
99
142
|
|
|
100
143
|
## What runs where
|
|
101
144
|
|
|
@@ -103,10 +146,11 @@ On your machine:
|
|
|
103
146
|
|
|
104
147
|
- the coding engine (Claude Agent SDK), reading and editing files **only inside
|
|
105
148
|
the folder**;
|
|
106
|
-
- the commands it wants to run, **each one after you
|
|
107
|
-
|
|
108
|
-
- the diff of
|
|
109
|
-
|
|
149
|
+
- the commands it wants to run, **each one after you approve it in the
|
|
150
|
+
browser** (or after an "always allow" rule you created covers it);
|
|
151
|
+
- the diff of each repository against its `HEAD` at connect time (and of the
|
|
152
|
+
other files against their copies), which is what the browser shows and what
|
|
153
|
+
a pull request carries.
|
|
110
154
|
|
|
111
155
|
In ScaleQuality:
|
|
112
156
|
|
|
@@ -127,32 +171,39 @@ read credential stores such as `~/.ssh`, `~/.aws`, `~/.netrc`, your home
|
|
|
127
171
|
only a fixed list of variables (PATH, HOME, locale, toolchain locations, proxies
|
|
128
172
|
and CA settings) reaches the engine and its commands.
|
|
129
173
|
|
|
130
|
-
##
|
|
131
|
-
|
|
132
|
-
Before any command runs
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
174
|
+
## Approving commands
|
|
175
|
+
|
|
176
|
+
Before any command runs on your computer, the AI Workspace shows an approval
|
|
177
|
+
card in the browser with the command, the folder, why it asks and a suggested
|
|
178
|
+
rule:
|
|
179
|
+
|
|
180
|
+
- **Run once** runs it this time.
|
|
181
|
+
- **Always allow** stores a rule for this computer and folder, either the exact
|
|
182
|
+
command or a prefix such as `npm test*`, and runs it. A prefix never covers
|
|
183
|
+
anything chained, piped, substituted or redirected after it (`npm test && …`
|
|
184
|
+
is asked again), and never a shell, `sudo`, `npx` or inline code.
|
|
185
|
+
- **Deny** tells the model it did not run.
|
|
186
|
+
|
|
187
|
+
Publishing (`git push`, remotes, `gh`, `npm publish`, image pushes), remote
|
|
188
|
+
shells and copies, cloud and infrastructure CLIs and credential reads are never
|
|
189
|
+
remembered: each run is asked again, and what the workspace policy denies is
|
|
190
|
+
never offered at all. Rules are listed and deleted in the AI Workspace; a
|
|
191
|
+
deleted rule stops applying in running sessions right away.
|
|
192
|
+
|
|
193
|
+
A card nobody answers in 10 minutes is withdrawn and the command does not run;
|
|
194
|
+
stopping the request in the browser withdraws it too. File edits are not asked:
|
|
195
|
+
they show in the browser as they happen, and each file can be discarded there.
|
|
196
|
+
|
|
197
|
+
## Troubleshooting
|
|
198
|
+
|
|
199
|
+
- `scalequality service status` and `scalequality service logs`.
|
|
200
|
+
- `scalequality up --verbose` runs the same loop in the terminal, with
|
|
201
|
+
diagnostic lines. It does not start while the service runs; stop the service
|
|
202
|
+
first (`scalequality service uninstall`, then `scalequality service install`
|
|
203
|
+
afterwards).
|
|
204
|
+
- Ctrl+C in `up`, or stopping the service, saves every running session first.
|
|
205
|
+
Your folder keeps every change; closing the session in the browser also ends
|
|
206
|
+
it on the computer.
|
|
156
207
|
|
|
157
208
|
## For maintainers
|
|
158
209
|
|
package/bin/scalequality.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// ScaleQuality CLI. The engine of every command (
|
|
3
|
-
//
|
|
2
|
+
// ScaleQuality CLI. The engine of every command (login, add, service, logout,
|
|
3
|
+
// and the unlisted up and connect) is built in the ScaleQuality ai-governance service
|
|
4
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'
|
|
@@ -15,23 +15,25 @@ const HELP = `ScaleQuality CLI ${pkg.version}
|
|
|
15
15
|
Usage:
|
|
16
16
|
scalequality login [--api URL] [--name NAME]
|
|
17
17
|
Connect this computer to your ScaleQuality account (you confirm a code in
|
|
18
|
-
ScaleQuality)
|
|
19
|
-
|
|
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.
|
|
18
|
+
ScaleQuality). It then installs a background service that keeps this
|
|
19
|
+
computer connected, also after a restart.
|
|
22
20
|
scalequality add [PATH]
|
|
23
21
|
Add a folder (default: the current one) for the AI Workspace to use.
|
|
22
|
+
scalequality service <install|uninstall|status|logs>
|
|
23
|
+
The background service: reinstall it, remove it, see whether it runs,
|
|
24
|
+
read its log.
|
|
24
25
|
scalequality logout [--api URL]
|
|
25
|
-
|
|
26
|
-
|
|
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.
|
|
26
|
+
Stop and remove the background service, disconnect this computer and
|
|
27
|
+
delete its local credential.
|
|
29
28
|
scalequality --help
|
|
30
29
|
scalequality --version
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
Commands the AI Workspace wants to run on this computer are approved in the
|
|
32
|
+
browser. Run "scalequality <command> --help" for the options of a command.`
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// `up` (the loop the service runs, for troubleshooting) and `connect <code>`
|
|
35
|
+
// (one session by one-time code, kept for older screens) work but are not listed.
|
|
36
|
+
const COMMANDS = new Set(['connect', 'login', 'up', 'add', 'logout', 'service'])
|
|
35
37
|
const [command] = process.argv.slice(2)
|
|
36
38
|
|
|
37
39
|
if (!command || command === '--help' || command === '-h' || command === 'help') {
|
package/dist/connect.build.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"sdkVersion": "0.3.281",
|
|
3
|
-
"sha256": "
|
|
4
|
-
"sourceCommit": "
|
|
3
|
+
"sha256": "0ff62b12b532e9895f9d7a755279f885c6523b4ecfcae73d5013f5fc3a94d2a1",
|
|
4
|
+
"sourceCommit": "50f66eee84e1a3b82aeb80716af93bf1b3102b38"
|
|
5
5
|
}
|