@use-aistack/cli 0.20.3 → 0.20.5

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.
@@ -38,78 +38,82 @@ Sync combines the local histories of your Claude Code profiles into one Claude C
38
38
  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
39
 
40
40
  ```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
41
+ npx @use-aistack/cli@latest sync --verbose
42
+ AISTACK_DEBUG=1 npx @use-aistack/cli@latest sync # the same, for a hook or a script
43
43
  ```
44
44
 
45
45
  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.
46
46
 
47
47
  Partial history still contributes dated usage. The review marks it as partial, and the backend retains previously recorded evidence. Missing models, harnesses, dates, and workflow readings are not cleared by a partial sync. Repeated readings are not added together. An existing model is updated only when the incoming reading covers all its stored token buckets and recorded cost; otherwise the stored model reading stays. A complete scan can still apply corrections through the normal daily replacement path.
48
48
 
49
- ### `npx @use-aistack/cli sync --auto on` / `off`
49
+ #### Large measured histories
50
+
51
+ Sync can send up to 400 UTC days. The CLI splits uploads above 8 MiB into ordered requests of at most 8 MiB each. The server paces backfill writes at approximately 2 MiB per second and retries temporary write-rate failures. If a proxy or response body fails after a write may have committed, the CLI retries the same part up to three times. A retried part skips saved batches and cannot create a duplicate completion event. If retries are exhausted, a fresh sync uses the manifest to skip dates already stored.
52
+
53
+ A day using packed workspace identifiers may be up to 768 KiB as JSON. The server can retain up to 768 KiB of packed identifiers for one machine and day after a partial merge. The CLI reports the affected date if either bound is exceeded. A complete reading within the limit can replace an oversized partial union. The server preserves the previously stored day when the union cannot fit.
54
+
55
+ Usage reads at most 4 MiB or 2,000 base rows for its requested dates. If the comparison or the current range is incomplete, the response marks the read incomplete and withholds the affected totals. Exact project counts use a shared 12 MiB budget for base rows and packed workspace evidence. Above that budget, Usage and Activity report a marked project-count lower bound and keep every stored identifier. A shorter usage range or a single machine can restore an exact count. The manifest and Stats do not load packed workspace evidence.
56
+
57
+ 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
+
59
+ ### `npx @use-aistack/cli@latest sync --auto on` / `off`
50
60
 
51
61
  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.
52
62
 
53
63
  ```sh
54
- npx @use-aistack/cli sync --auto on # enable, default every 6h
55
- npx @use-aistack/cli sync --auto on --every 12 # custom frequency in hours
56
- npx @use-aistack/cli sync --auto off # revoke
64
+ npx @use-aistack/cli@latest sync --auto on # enable, default every 6h
65
+ npx @use-aistack/cli@latest sync --auto on --every 12 # custom frequency in hours
66
+ npx @use-aistack/cli@latest sync --auto off # revoke
57
67
  ```
58
68
 
59
69
  **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.
60
70
 
61
71
  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.
62
72
 
63
- ### `npx @use-aistack/cli login`
73
+ ### `npx @use-aistack/cli@latest login`
64
74
 
65
75
  Link this machine to your AI Stack account via browser. Optional - `sync` runs this inline when the machine is not linked yet.
66
76
 
67
77
  ```sh
68
- npx @use-aistack/cli login
69
- npx @use-aistack/cli login --label "build server" # preset and lock the label
78
+ npx @use-aistack/cli@latest login
79
+ npx @use-aistack/cli@latest login --label "build server" # preset and lock the label
70
80
  ```
71
81
 
72
- ### `npx @use-aistack/cli connect claude`
82
+ ### `npx @use-aistack/cli@latest connect claude`
73
83
 
74
84
  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.
75
85
 
76
86
  ```sh
77
- npx @use-aistack/cli connect claude
87
+ npx @use-aistack/cli@latest connect claude
78
88
  ```
79
89
 
80
- ### `npx @use-aistack/cli collect`
90
+ ### `npx @use-aistack/cli@latest collect`
81
91
 
82
92
  Scan your project for AI config files (prompts, rules, skills, MCP setups) and upload them to your stack.
83
93
 
84
94
  ```sh
85
95
  cd your-project
86
- npx @use-aistack/cli collect
96
+ npx @use-aistack/cli@latest collect
87
97
  ```
88
98
 
89
99
  Detects: `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/`, `mcp.json`, skill directories, prompts, and global configs (`~/.claude/`, `~/.cursor/`, etc).
90
100
 
91
- ### `npx @use-aistack/cli create`
101
+ ### `npx @use-aistack/cli@latest create`
92
102
 
93
103
  Write your stack's AI config files into the current directory.
94
104
 
95
105
  ```sh
96
- npx @use-aistack/cli create
106
+ npx @use-aistack/cli@latest create
97
107
  ```
98
108
 
99
- ## Install globally (optional)
100
-
101
- If you'd rather type `aistack` instead of `npx @use-aistack/cli` every time, install it globally:
109
+ ## Always run the latest release
102
110
 
103
- ```sh
104
- npm i -g @use-aistack/cli
105
- ```
111
+ 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.
106
112
 
107
- Then the same commands become:
113
+ 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:
108
114
 
109
115
  ```sh
110
- aistack login
111
- aistack sync
112
- aistack collect
116
+ npm rm -g @use-aistack/cli
113
117
  ```
114
118
 
115
119
  ## Development