@use-aistack/cli 0.20.4 → 0.20.6

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 CHANGED
@@ -5,12 +5,12 @@ Measure and share your AI stack. The CLI scans local history from Claude Code, C
5
5
  Run on-demand with `npx` - no install required:
6
6
 
7
7
  ```sh
8
- npx @use-aistack/cli sync
8
+ npx @use-aistack/cli@latest sync
9
9
  ```
10
10
 
11
11
  ## Commands
12
12
 
13
- ### `npx @use-aistack/cli sync`
13
+ ### `npx @use-aistack/cli@latest sync`
14
14
 
15
15
  The default command. Scan your local transcripts (rolling 30 days), review a short summary, and publish the measured layer to your stack. To read every name that would publish, choose **Show details** at the prompt. Nothing is sent until you choose **Publish**.
16
16
 
@@ -20,7 +20,7 @@ Your prompts, responses, code, and file paths never leave your machine. aistack
20
20
  - **Never sent:** your prompts, responses, code, file paths, and repo names.
21
21
 
22
22
  ```sh
23
- npx @use-aistack/cli sync
23
+ npx @use-aistack/cli@latest sync
24
24
  ```
25
25
 
26
26
  On an unlinked machine, `sync` starts the login flow inline - your browser opens to approve the machine, then the sync continues. One command is the whole onboarding.
@@ -33,13 +33,26 @@ Sync combines the local histories of your Claude Code profiles into one Claude C
33
33
 
34
34
  `CLAUDE_CONFIG_DIR` can add custom locations as a comma-separated list. The default and discovered profiles still count when this variable is set, so running sync from an account-specific shell keeps the other accounts included. Linked transcript roots and copied records with the same Claude record UUID are counted once. A profile discovery error marks the reading as partial so previously published evidence is retained.
35
35
 
36
+ #### Multiple accounts in other harnesses
37
+
38
+ The other harnesses keep one account per data folder, and sync reads every folder it can find:
39
+
40
+ * **Codex**: `~/.codex`, `$CODEX_HOME`, and every `~/.codex*` sibling, such as `~/.codex-work`. A rollout copied into a second home counts once, from its longest copy. Configured MCP servers come from each home's `config.toml`.
41
+ * **Grok Build**: `~/.grok`, `$GROK_HOME`, and every `~/.grok*` sibling. A session copied into a second home is read once, from the copy with the most evidence.
42
+ * **pi**: `~/.pi/agent/sessions`, `$PI_CODING_AGENT_DIR/sessions`, and `$PI_CODING_AGENT_SESSION_DIR`. Entries copied between folders count once.
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
+
45
+ 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
+
47
+ Cursor reads its default user data folder, or `CURSOR_DATA_PATH` when it is set. A second Cursor instance started with `--user-data-dir` is not read.
48
+
36
49
  #### A sync that looks stuck
37
50
 
38
51
  The scan runs on this machine and can take a few minutes when a harness keeps a large history. Cursor is the usual case: its global `state.vscdb` grows past a gigabyte, and the session listing walks all of it before the first result. Every harness is checked at the same time and gets its own row with a progress bar, so one slow harness shows as one slow row while the others finish. To see each step as it starts, with its duration, run with `--verbose`:
39
52
 
40
53
  ```sh
41
- npx @use-aistack/cli sync --verbose
42
- AISTACK_DEBUG=1 npx @use-aistack/cli sync # the same, for a hook or a script
54
+ npx @use-aistack/cli@latest sync --verbose
55
+ AISTACK_DEBUG=1 npx @use-aistack/cli@latest sync # the same, for a hook or a script
43
56
  ```
44
57
 
45
58
  The lines go to stderr and hold counts, durations, and safe error codes: no paths, prompts, or database values. Paste them into a bug report. Expected Git discovery misses are summarized as informational messages; incomplete Cursor sessions are grouped into one warning.
@@ -56,70 +69,64 @@ Usage reads at most 4 MiB or 2,000 base rows for its requested dates. If the com
56
69
 
57
70
  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.
58
71
 
59
- ### `npx @use-aistack/cli sync --auto on` / `off`
72
+ ### `npx @use-aistack/cli@latest sync --auto on` / `off`
60
73
 
61
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, and `$GROK_HOME/hooks/aistack.json` (default `~/.grok/hooks/aistack.json`) for Grok Build. 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.
62
75
 
63
76
  ```sh
64
- npx @use-aistack/cli sync --auto on # enable, default every 6h
65
- npx @use-aistack/cli sync --auto on --every 12 # custom frequency in hours
66
- npx @use-aistack/cli sync --auto off # revoke
77
+ npx @use-aistack/cli@latest sync --auto on # enable, default every 6h
78
+ npx @use-aistack/cli@latest sync --auto on --every 12 # custom frequency in hours
79
+ npx @use-aistack/cli@latest sync --auto off # revoke
67
80
  ```
68
81
 
69
82
  **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.
70
83
 
71
84
  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.
72
85
 
73
- ### `npx @use-aistack/cli login`
86
+ ### `npx @use-aistack/cli@latest login`
74
87
 
75
88
  Link this machine to your AI Stack account via browser. Optional - `sync` runs this inline when the machine is not linked yet.
76
89
 
77
90
  ```sh
78
- npx @use-aistack/cli login
79
- npx @use-aistack/cli login --label "build server" # preset and lock the label
91
+ npx @use-aistack/cli@latest login
92
+ npx @use-aistack/cli@latest login --label "build server" # preset and lock the label
80
93
  ```
81
94
 
82
- ### `npx @use-aistack/cli connect claude`
95
+ ### `npx @use-aistack/cli@latest connect claude`
83
96
 
84
97
  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.
85
98
 
86
99
  ```sh
87
- npx @use-aistack/cli connect claude
100
+ npx @use-aistack/cli@latest connect claude
88
101
  ```
89
102
 
90
- ### `npx @use-aistack/cli collect`
103
+ ### `npx @use-aistack/cli@latest collect`
91
104
 
92
105
  Scan your project for AI config files (prompts, rules, skills, MCP setups) and upload them to your stack.
93
106
 
94
107
  ```sh
95
108
  cd your-project
96
- npx @use-aistack/cli collect
109
+ npx @use-aistack/cli@latest collect
97
110
  ```
98
111
 
99
112
  Detects: `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/`, `mcp.json`, skill directories, prompts, and global configs (`~/.claude/`, `~/.cursor/`, etc).
100
113
 
101
- ### `npx @use-aistack/cli create`
114
+ ### `npx @use-aistack/cli@latest create`
102
115
 
103
116
  Write your stack's AI config files into the current directory.
104
117
 
105
118
  ```sh
106
- npx @use-aistack/cli create
119
+ npx @use-aistack/cli@latest create
107
120
  ```
108
121
 
109
- ## Install globally (optional)
110
-
111
- If you'd rather type `aistack` instead of `npx @use-aistack/cli` every time, install it globally:
122
+ ## Always run the latest release
112
123
 
113
- ```sh
114
- npm i -g @use-aistack/cli
115
- ```
124
+ Run every command as `npx @use-aistack/cli@latest <command>`. The `@latest` tag makes npx look up the newest release each time, so you never run an outdated copy and never need to update anything.
116
125
 
117
- Then the same commands become:
126
+ A global install (`npm i -g @use-aistack/cli`) pins the version you installed. While it is present, `aistack` and `npx @use-aistack/cli` without `@latest` keep running that old copy. If you have one, remove it:
118
127
 
119
128
  ```sh
120
- aistack login
121
- aistack sync
122
- aistack collect
129
+ npm rm -g @use-aistack/cli
123
130
  ```
124
131
 
125
132
  ## Development