@use-aistack/cli 0.20.4 → 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,8 +38,8 @@ 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.
@@ -56,70 +56,64 @@ Usage reads at most 4 MiB or 2,000 base rows for its requested dates. If the com
56
56
 
57
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
58
 
59
- ### `npx @use-aistack/cli sync --auto on` / `off`
59
+ ### `npx @use-aistack/cli@latest sync --auto on` / `off`
60
60
 
61
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.
62
62
 
63
63
  ```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
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
67
67
  ```
68
68
 
69
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.
70
70
 
71
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.
72
72
 
73
- ### `npx @use-aistack/cli login`
73
+ ### `npx @use-aistack/cli@latest login`
74
74
 
75
75
  Link this machine to your AI Stack account via browser. Optional - `sync` runs this inline when the machine is not linked yet.
76
76
 
77
77
  ```sh
78
- npx @use-aistack/cli login
79
- 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
80
80
  ```
81
81
 
82
- ### `npx @use-aistack/cli connect claude`
82
+ ### `npx @use-aistack/cli@latest connect claude`
83
83
 
84
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.
85
85
 
86
86
  ```sh
87
- npx @use-aistack/cli connect claude
87
+ npx @use-aistack/cli@latest connect claude
88
88
  ```
89
89
 
90
- ### `npx @use-aistack/cli collect`
90
+ ### `npx @use-aistack/cli@latest collect`
91
91
 
92
92
  Scan your project for AI config files (prompts, rules, skills, MCP setups) and upload them to your stack.
93
93
 
94
94
  ```sh
95
95
  cd your-project
96
- npx @use-aistack/cli collect
96
+ npx @use-aistack/cli@latest collect
97
97
  ```
98
98
 
99
99
  Detects: `.cursorrules`, `CLAUDE.md`, `AGENTS.md`, `.cursor/rules/`, `mcp.json`, skill directories, prompts, and global configs (`~/.claude/`, `~/.cursor/`, etc).
100
100
 
101
- ### `npx @use-aistack/cli create`
101
+ ### `npx @use-aistack/cli@latest create`
102
102
 
103
103
  Write your stack's AI config files into the current directory.
104
104
 
105
105
  ```sh
106
- npx @use-aistack/cli create
106
+ npx @use-aistack/cli@latest create
107
107
  ```
108
108
 
109
- ## Install globally (optional)
109
+ ## Always run the latest release
110
110
 
111
- If you'd rather type `aistack` instead of `npx @use-aistack/cli` every time, install it globally:
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.
112
112
 
113
- ```sh
114
- npm i -g @use-aistack/cli
115
- ```
116
-
117
- 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:
118
114
 
119
115
  ```sh
120
- aistack login
121
- aistack sync
122
- aistack collect
116
+ npm rm -g @use-aistack/cli
123
117
  ```
124
118
 
125
119
  ## Development
package/dist/index.js CHANGED
@@ -20341,7 +20341,7 @@ var KNOWN_ROW_IDS = /* @__PURE__ */ new Set([
20341
20341
  ]);
20342
20342
 
20343
20343
  // src/version.ts
20344
- var CLI_VERSION = true ? "0.20.4" : "0.0.0-dev";
20344
+ var CLI_VERSION = true ? "0.20.5" : "0.0.0-dev";
20345
20345
 
20346
20346
  // src/api.ts
20347
20347
  var BASE_URL = process.env.AISTACK_URL || "https://aistack.to";
@@ -20367,7 +20367,7 @@ function failure(what, res) {
20367
20367
  }
20368
20368
  if (res.status === 403) {
20369
20369
  return new Error(
20370
- `${what}: this machine is not allowed to do that. Run \`aistack login\` again to re-link it.`
20370
+ `${what}: this machine is not allowed to do that. Run \`npx @use-aistack/cli@latest login\` again to re-link it.`
20371
20371
  );
20372
20372
  }
20373
20373
  return new Error(`${what}: ${res.status}`);
@@ -20404,7 +20404,7 @@ async function stackCollect(token, data) {
20404
20404
  });
20405
20405
  if (res.status === 401)
20406
20406
  throw new Error(
20407
- "Authentication expired. Run `npx @use-aistack/cli login` again."
20407
+ "Authentication expired. Run `npx @use-aistack/cli@latest login` again."
20408
20408
  );
20409
20409
  if (!res.ok) {
20410
20410
  throw Object.assign(
@@ -20530,7 +20530,7 @@ async function postSync(token, bodyJson, retryTransport = false) {
20530
20530
  }
20531
20531
  } else if (res?.status === 401) {
20532
20532
  throw new Error(
20533
- "Authentication expired. Run `npx @use-aistack/cli login` again."
20533
+ "Authentication expired. Run `npx @use-aistack/cli@latest login` again."
20534
20534
  );
20535
20535
  } else if (res?.status === 403 || res?.status === 429) {
20536
20536
  throw failure("Sync failed", res);
@@ -20565,7 +20565,7 @@ async function fetchDayManifest(baseUrl, token) {
20565
20565
  if (res.status === 404) return null;
20566
20566
  if (res.status === 401)
20567
20567
  throw new Error(
20568
- "Authentication expired. Run `npx @use-aistack/cli login` again."
20568
+ "Authentication expired. Run `npx @use-aistack/cli@latest login` again."
20569
20569
  );
20570
20570
  if (res.status === 403 || res.status === 429)
20571
20571
  throw failure("Manifest fetch failed", res);
@@ -20609,7 +20609,7 @@ async function setAutoSync(token, flag) {
20609
20609
  });
20610
20610
  if (res.status === 401)
20611
20611
  throw new Error(
20612
- "Authentication expired. Run `npx @use-aistack/cli login` again."
20612
+ "Authentication expired. Run `npx @use-aistack/cli@latest login` again."
20613
20613
  );
20614
20614
  if (res.status === 403 || res.status === 429)
20615
20615
  throw failure("Auto-sync update failed", res);
@@ -20627,7 +20627,7 @@ async function stackGet(token) {
20627
20627
  });
20628
20628
  if (res.status === 401)
20629
20629
  throw new Error(
20630
- "Authentication expired. Run `npx @use-aistack/cli login` again."
20630
+ "Authentication expired. Run `npx @use-aistack/cli@latest login` again."
20631
20631
  );
20632
20632
  if (res.status === 404) return null;
20633
20633
  if (!res.ok) throw failure("Stack fetch failed", res);
@@ -21634,7 +21634,7 @@ async function collectCommand(options) {
21634
21634
  const token = getToken();
21635
21635
  if (!token) {
21636
21636
  p2.log.error(
21637
- `Not authenticated. Run ${limeBold("npx @use-aistack/cli login")} first.`
21637
+ `Not authenticated. Run ${limeBold("npx @use-aistack/cli@latest login")} first.`
21638
21638
  );
21639
21639
  outroError("not authenticated");
21640
21640
  process.exit(1);
@@ -28456,7 +28456,7 @@ async function detectedAdapters(sinceMs = detectionSinceMs()) {
28456
28456
  }
28457
28457
 
28458
28458
  // src/commands/connect.ts
28459
- var MANUAL_MCP_ADD = "claude mcp add --scope user aistack -- npx -y @use-aistack/cli mcp";
28459
+ var MANUAL_MCP_ADD = "claude mcp add --scope user aistack -- npx -y @use-aistack/cli@latest mcp";
28460
28460
  var MCP_ADD_ARGS = [
28461
28461
  "mcp",
28462
28462
  "add",
@@ -28466,7 +28466,7 @@ var MCP_ADD_ARGS = [
28466
28466
  "--",
28467
28467
  "npx",
28468
28468
  "-y",
28469
- "@use-aistack/cli",
28469
+ "@use-aistack/cli@latest",
28470
28470
  "mcp"
28471
28471
  ];
28472
28472
  var MCP_REMOVE_ARGS = ["mcp", "remove", "--scope", "user", "aistack"];
@@ -28593,7 +28593,7 @@ async function offerConnectUpsell(deps = {}) {
28593
28593
  return;
28594
28594
  }
28595
28595
  p3.log.message(
28596
- `If you change your mind: ${limeBold("npx @use-aistack/cli connect claude")}`
28596
+ `If you change your mind: ${limeBold("npx @use-aistack/cli@latest connect claude")}`
28597
28597
  );
28598
28598
  }
28599
28599
 
@@ -28606,7 +28606,7 @@ async function createCommand() {
28606
28606
  const token = getToken();
28607
28607
  if (!token) {
28608
28608
  p4.log.error(
28609
- `Not authenticated. Run ${limeBold("npx @use-aistack/cli login")} first.`
28609
+ `Not authenticated. Run ${limeBold("npx @use-aistack/cli@latest login")} first.`
28610
28610
  );
28611
28611
  outroError("not authenticated");
28612
28612
  process.exit(1);
@@ -28783,7 +28783,7 @@ async function loginCommand(options = {}) {
28783
28783
  process.exit(1);
28784
28784
  }
28785
28785
  p5.log.success(
28786
- `Token saved. Run ${limeBold("npx @use-aistack/cli sync")} to publish your usage.`
28786
+ `Token saved. Run ${limeBold("npx @use-aistack/cli@latest sync")} to publish your usage.`
28787
28787
  );
28788
28788
  outro2(lime("done"));
28789
28789
  }
@@ -29204,7 +29204,7 @@ function grokAutoSyncHookInstalled(file = GROK_HOOK_FILE) {
29204
29204
  }
29205
29205
 
29206
29206
  // src/autosync/optin.ts
29207
- var NOT_LINKED = "This machine is not linked to an aistack account, and the auto-sync permission lives on your stack. Run `npx @use-aistack/cli sync` first.";
29207
+ var NOT_LINKED = "This machine is not linked to an aistack account, and the auto-sync permission lives on your stack. Run `npx @use-aistack/cli@latest sync` first.";
29208
29208
  var NOTHING_TO_TRIGGER = `No supported session on this machine in the last ${DEFAULT_WINDOW_DAYS} days, so nothing would trigger an auto-sync. Nothing was changed.`;
29209
29209
  async function enableAutoSync(frequencyHours = DEFAULT_FREQUENCY_HOURS, deps = {}) {
29210
29210
  frequencyHours = normalizeFrequencyHours(frequencyHours);
@@ -29256,7 +29256,7 @@ async function enableAutoSync(frequencyHours = DEFAULT_FREQUENCY_HOURS, deps = {
29256
29256
  return {
29257
29257
  ok: true,
29258
29258
  message: [
29259
- `Auto-sync is on. It runs about every ${frequencyHours}h when a ${harnessListLabel(detected)} ${names.has(CURSOR_HARNESS_NAME) ? "session is active" : "session starts"}. Turn it off any time: npx @use-aistack/cli sync --auto off`,
29259
+ `Auto-sync is on. It runs about every ${frequencyHours}h when a ${harnessListLabel(detected)} ${names.has(CURSOR_HARNESS_NAME) ? "session is active" : "session starts"}. Turn it off any time: npx @use-aistack/cli@latest sync --auto off`,
29260
29260
  ...trustLine ? [trustLine] : []
29261
29261
  ].join("\n")
29262
29262
  };
@@ -29443,7 +29443,7 @@ async function offerAutoSyncOptIn(deps = {}) {
29443
29443
  saveSettings({ autoSyncNeverAskAgain: true }, deps.settingsFile);
29444
29444
  }
29445
29445
  p6.log.message(
29446
- `If you change your mind: ${limeBold("npx @use-aistack/cli sync --auto on")} ${dim(
29446
+ `If you change your mind: ${limeBold("npx @use-aistack/cli@latest sync --auto on")} ${dim(
29447
29447
  "(and --auto off to revoke)"
29448
29448
  )}`
29449
29449
  );
@@ -31046,9 +31046,9 @@ async function stageSync(deps) {
31046
31046
  if (historical.length === 0) {
31047
31047
  blockedReason = `No supported harness transcript from the last ${retentionDays} days to read.`;
31048
31048
  } else if (token === null) {
31049
- blockedReason = "This machine is not linked. Run `npx @use-aistack/cli login` first.";
31049
+ blockedReason = "This machine is not linked. Run `npx @use-aistack/cli@latest login` first.";
31050
31050
  } else if (config.stack === null) {
31051
- blockedReason = source === "bundled" ? "Could not fetch your settings from aistack, so the destination stack is unknown. Publish needs it. Check the network and preview again." : "This machine has no destination stack. Run `npx @use-aistack/cli sync` in an interactive terminal to choose one.";
31051
+ blockedReason = source === "bundled" ? "Could not fetch your settings from aistack, so the destination stack is unknown. Publish needs it. Check the network and preview again." : "This machine has no destination stack. Run `npx @use-aistack/cli@latest sync` in an interactive terminal to choose one.";
31052
31052
  }
31053
31053
  return {
31054
31054
  id: stageId(bodyJson),
@@ -31074,7 +31074,7 @@ function describeScan(stats) {
31074
31074
  // src/autosync/run.ts
31075
31075
  var SYNC_LOG_FILE = join19(homedir23(), ".config", "aistack", "sync.log");
31076
31076
  var SYNC_LOG_MAX_LINES = 200;
31077
- var FIX_COMMAND = "npx @use-aistack/cli sync";
31077
+ var FIX_COMMAND = "npx @use-aistack/cli@latest sync";
31078
31078
  var REVOKED_RESULT = "off - auto-sync is switched off for this stack";
31079
31079
  function appendLogLine(file, line) {
31080
31080
  mkdirSync9(dirname11(file), { recursive: true });