@use-aistack/cli 0.20.6 → 0.22.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 +48 -4
- package/dist/index.js +2213 -972
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @use-aistack/cli
|
|
2
2
|
|
|
3
|
-
Measure and share your AI stack. The CLI scans local history from Claude Code, Codex, Cursor, Grok Build, opencode and
|
|
3
|
+
Measure and share your AI stack. The CLI scans local history from Claude Code, Codex, Cursor, Grok Build, opencode, Pi and Antigravity, shows you exactly what would go up, and publishes only after you approve in your terminal.
|
|
4
4
|
|
|
5
5
|
Run on-demand with `npx` - no install required:
|
|
6
6
|
|
|
@@ -42,9 +42,36 @@ The other harnesses keep one account per data folder, and sync reads every folde
|
|
|
42
42
|
* **pi**: `~/.pi/agent/sessions`, `$PI_CODING_AGENT_DIR/sessions`, and `$PI_CODING_AGENT_SESSION_DIR`. Entries copied between folders count once.
|
|
43
43
|
* **opencode**: `~/.local/share/opencode`, `$XDG_DATA_HOME/opencode`, and `$OPENCODE_DB`. A relative `OPENCODE_DB` resolves under the data folder, as opencode does. A message stored in two databases counts once.
|
|
44
44
|
|
|
45
|
+
* **Antigravity**: every `antigravity*` folder under `~/.gemini`, such as `antigravity-cli` for the `agy` CLI and `antigravity` for the editor. `$ANTIGRAVITY_GEMINI_DIR` adds another Gemini folder and `$ANTIGRAVITY_APP_DATA_DIR` another folder name. Antigravity keeps every signed-in account in the same folder. A conversation copied into a second folder counts once.
|
|
46
|
+
|
|
45
47
|
The environment variables add a folder and never hide the default one. Auto-sync runs inside one harness session, where the variable may point at a single account, and it still reads the other accounts. A folder outside these names, such as `CODEX_HOME=~/work/codex`, is remembered in `~/.config/aistack/harness-homes.json` the first time a sync runs with the variable set. Later syncs from any shell read it too. The file stays on this machine.
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
#### Multiple Cursor accounts
|
|
50
|
+
|
|
51
|
+
Cursor has no account switcher. A second account runs as a second instance started with `cursor --user-data-dir <folder>`, and that folder can be anywhere. Sync reads every Cursor data folder it knows about:
|
|
52
|
+
|
|
53
|
+
* The default folder: `~/.config/Cursor` on Linux, `~/Library/Application Support/Cursor` on macOS, and `%APPDATA%\Cursor` on Windows.
|
|
54
|
+
* `CURSOR_DATA_PATH`, set to a `--user-data-dir` folder or to its `User/workspaceStorage` folder.
|
|
55
|
+
* Every folder you add with `aistack cursor-folders add`.
|
|
56
|
+
* On Linux, the folder of every Cursor instance that is running while sync runs. Sync reads it from the process list and only accepts a folder whose database holds Cursor chat data.
|
|
57
|
+
|
|
58
|
+
To add, list, or remove a folder, pass the same folder you start Cursor with:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
npx @use-aistack/cli@latest cursor-folders add ~/cursor-work
|
|
62
|
+
npx @use-aistack/cli@latest cursor-folders list
|
|
63
|
+
npx @use-aistack/cli@latest cursor-folders remove ~/cursor-work
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
#### What Antigravity sync reads
|
|
67
|
+
|
|
68
|
+
Antigravity stores each conversation as its own SQLite file, `conversations/<id>.db`, with protobuf records inside. Sync reads the metadata of each step: when it was created, the model, the token counts (input, output, cache read, cache write and thinking), the tool name, the workspace folder, and the parent conversation of a subagent. It never reads step contents, which hold your prompts, tool output and file contents. A `run_command` call's command line is read on this machine to classify the phase and is never sent. Checkpoint steps count as compactions.
|
|
69
|
+
|
|
70
|
+
Models that Antigravity calls through Google's endpoints are priced under the `google:` provider. A Gemini model gets Google's rate. A Claude or OpenAI model that Google Vertex AI serves stays unpriced until the price table holds a `google` rate for it, as with any gateway. Older Antigravity editor builds wrote encrypted `<id>.pb` files instead. Sync cannot read those, so a reading that contains one written inside the window is marked partial.
|
|
71
|
+
|
|
72
|
+
The list is stored in `~/.config/aistack/harness-homes.json`. A folder found through `CURSOR_DATA_PATH` or a running instance is saved there too, so auto-sync keeps reading it after that shell or instance closes. A folder that keeps coming back after you remove it is still set in `CURSOR_DATA_PATH` or still running. To turn off process detection, set `AISTACK_CURSOR_PROC_DIR` to an empty value.
|
|
73
|
+
|
|
74
|
+
Each folder keeps its own account lookup and cache. A chat that appears in two folders, for example after you copied a folder, counts once, from the copy with the most messages. A folder that can't be read marks the Cursor reading as partial, so previously published evidence is retained. Folder paths stay on this machine.
|
|
48
75
|
|
|
49
76
|
#### A sync that looks stuck
|
|
50
77
|
|
|
@@ -69,16 +96,25 @@ Usage reads at most 4 MiB or 2,000 base rows for its requested dates. If the com
|
|
|
69
96
|
|
|
70
97
|
A partial Claude Code scan defers workspace aliases for legacy folders that lack a working directory. Their existing IDs stay stored, and the project count carries a lower-bound marker until a complete scan can replace the aliases.
|
|
71
98
|
|
|
72
|
-
### `npx @use-aistack/cli@latest sync --auto on` / `off`
|
|
99
|
+
### `npx @use-aistack/cli@latest sync --auto on` / `off` / `status`
|
|
73
100
|
|
|
74
|
-
Optional: keep your stack fresh without manual syncs. `on` asks your stack for permission, then writes hooks for the harnesses you actually use. The `SessionStart` paths are: `~/.claude/settings.json` for Claude Code, `~/.codex/hooks.json` for Codex,
|
|
101
|
+
Optional: keep your stack fresh without manual syncs. `on` asks your stack for permission, then writes hooks for the harnesses you actually use. The `SessionStart` paths, shown for the default folders, are: `~/.claude/settings.json` for Claude Code, `~/.codex/hooks.json` for Codex, `$GROK_HOME/hooks/aistack.json` (default `~/.grok/hooks/aistack.json`) for Grok Build, and the `aistack` entry in `~/.gemini/config/hooks.json` for Antigravity. Antigravity keeps one hooks file for every account, and other tools' entries in it stay as they are. Cursor uses a user-level `stop` hook in `~/.cursor/hooks.json` and reloads that configuration automatically. Its trigger runs when the agent finishes a turn. The other hooks run when a session starts. All triggers share one silent sync throttle, at most once every 6 hours. Existing user hooks are preserved. Grok Build needs a new session or hook reload after installation. `off` disables local publication first, removes the owned hooks, then takes the remote permission back. If removal fails, the disabled local gate still prevents publication and the next interactive sync can retry reconciliation.
|
|
75
102
|
|
|
76
103
|
```sh
|
|
77
104
|
npx @use-aistack/cli@latest sync --auto on # enable, default every 6h
|
|
78
105
|
npx @use-aistack/cli@latest sync --auto on --every 12 # custom frequency in hours
|
|
79
106
|
npx @use-aistack/cli@latest sync --auto off # revoke
|
|
107
|
+
npx @use-aistack/cli@latest sync --auto status # each folder's hook
|
|
80
108
|
```
|
|
81
109
|
|
|
110
|
+
**Every account gets its own hook.** If you run several accounts of one harness, each account keeps its own folder, and `on` writes the hook into every one of them. A session in any account then triggers the sync. The folders are the same ones a sync reads: every Claude Code profile (`~/.claude*`, `CLAUDE_CONFIG_DIR`, and profiles folders), every Codex home (`~/.codex*` and `CODEX_HOME`), and every Grok Build home (`~/.grok*` and `GROK_HOME`). The interactive sync adds the hook to an account folder that appears later. `off` removes the hook from every folder this machine wrote it into, including a folder that only an environment variable in another shell names. The CLI records those folders in `~/.config/aistack/settings.json`, which stays on this machine.
|
|
111
|
+
|
|
112
|
+
The hook text is identical in every folder and across CLI versions. Codex pins each hook by its file and its exact text, so **every newly hooked Codex home needs a one-time approval**: open Codex with that account and run `/hooks`. The CLI names each home that still needs it when it writes the hook, and the interactive sync repeats the reminder until Codex trusts it.
|
|
113
|
+
|
|
114
|
+
`status` prints the local switch and one line per folder: the harness, the folder relative to `~`, and the hook state (for Codex, whether the hook is trusted). It prints each folder relative to `~` and sends nothing anywhere.
|
|
115
|
+
|
|
116
|
+
Hooks from several accounts can fire at the same moment. The silent runs share one reservation per machine in `~/.config/aistack`, so exactly one of them syncs and the others exit.
|
|
117
|
+
|
|
82
118
|
**Your stack owns the permission, not this machine.** The silent run asks aistack.to before it publishes anything, so the switch above the first section on your stack page is a complete revoke: it stops every machine, even one whose hooks are still installed. The switch defaults to every 6 hours. Run the enable command shown beside it on each machine that should install triggers. A harness you adopt months later gets its trigger the same way.
|
|
83
119
|
|
|
84
120
|
The silent run (`sync --auto`) never prompts and never installs a hook. Each run appends one line to `~/.config/aistack/sync.log` (capped at 200 lines). The next interactive `sync` reports the last result. After 3 failures in a row, one visible message appears in Claude Code and names the fix. No email, no dialogs.
|
|
@@ -92,6 +128,14 @@ npx @use-aistack/cli@latest login
|
|
|
92
128
|
npx @use-aistack/cli@latest login --label "build server" # preset and lock the label
|
|
93
129
|
```
|
|
94
130
|
|
|
131
|
+
### `npx @use-aistack/cli@latest cursor-folders`
|
|
132
|
+
|
|
133
|
+
List, add, or remove the extra Cursor data folders that `sync` reads, one per `cursor --user-data-dir` instance. Without an action, it lists them. For details, see [Multiple Cursor accounts](#multiple-cursor-accounts).
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
npx @use-aistack/cli@latest cursor-folders add ~/cursor-work
|
|
137
|
+
```
|
|
138
|
+
|
|
95
139
|
### `npx @use-aistack/cli@latest connect claude`
|
|
96
140
|
|
|
97
141
|
Optional: install the in-session sync surface for Claude Code - the `aistack` MCP server (user scope) plus the `aistack-sync` Skill. After that, say "sync my stack" in any Claude Code session. Both halves install together or not at all.
|