@agenttrail/cli 0.2.9 → 0.2.24

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
@@ -49,9 +49,11 @@ npx -y @agenttrail/cli@latest setup --agent claude # Claude Code
49
49
  npx -y @agenttrail/cli@latest setup --agent cursor # Cursor
50
50
  ```
51
51
 
52
- `setup` prints a short code and opens `https://www.agenttrail.sh/device` in your browser.
53
- Approve the code there while signed in to AgentTrail, and setup finishes on its own. It then
54
- names the device, connects this project, and installs real-time enforcement.
52
+ `setup` opens a sign-in link (`https://www.agenttrail.sh/device?code=…`) in your browser and
53
+ prints the same link with a short code. If the browser doesn't open, paste the printed link into
54
+ one. Check that the page shows the same code, approve it while signed in to AgentTrail, and setup
55
+ finishes on its own. It then names the device, connects this project, and installs real-time
56
+ enforcement.
55
57
 
56
58
  Each project is connected separately. Run `setup` again in every repository you want recorded.
57
59
  A second project on the same machine reuses the sign-in, with no browser.
@@ -195,8 +197,10 @@ website describes [how data is handled](https://www.agenttrail.sh/security).
195
197
  turn runs, and `backfill` imports only the project you run it in.
196
198
  - **Hooks fetch the latest release.** The hooks run `npx -y @agenttrail/cli@latest`, so each
197
199
  session start and turn end contacts the npm registry and uses the newest published
198
- version. When the registry cannot be reached, that run is skipped, and a later run sends
199
- the turns it missed.
200
+ version. A `--global` install's `SessionStart` hook in your personal `~/.claude/settings.json`
201
+ is the exception: it runs the CLI version that wrote it, while hooks in a project's shared
202
+ `.claude/settings.json` keep `@latest`. When the registry cannot be reached, that run is
203
+ skipped, and a later run sends the turns it missed.
200
204
 
201
205
  ### Cursor's limits
202
206
 
@@ -350,7 +354,10 @@ API keys work with Claude Code only.
350
354
  pointing Claude Code's own OpenTelemetry exporter at AgentTrail from `~/.claude/settings.json`.
351
355
  It prints a warning first. Setup refuses if that file is inside a git or dotfiles repository,
352
356
  because it would hold your credential. In this mode Claude Code sends the content itself, so
353
- it is scrubbed at ingest only, not on your machine.
357
+ it is scrubbed at ingest only, not on your machine. Its `SessionStart` hook in
358
+ `~/.claude/settings.json` runs the CLI version that wrote it
359
+ (`npx -y @agenttrail/cli@<version>`); a project's shared `.claude/settings.json` keeps
360
+ `@latest`, so teammates on different versions don't keep rewriting it.
354
361
  - **`--team`** writes key-free settings to `.claude/settings.json` that are meant to be
355
362
  committed. Each developer supplies their own key through the environment. It never writes
356
363
  the enforcement switch or a token.
@@ -412,10 +419,18 @@ stand down in Cursor. Remove them with
412
419
 
413
420
  **Claude Code: `logout --agent claude`** revokes this device's sign-in, deletes
414
421
  `~/.agenttrail/credentials.json`, removes the enforcement plugin and its marketplace, and
415
- strips the enforcement settings from your settings files. It keeps the capture hooks in
416
- `.claude/settings.json`, `.agenttrail.json`, and the `.git/info/exclude` lines. With no
417
- credential the hooks upload nothing; delete them from `.claude/settings.json` to remove them
418
- completely.
422
+ strips the enforcement settings from `.claude/settings.local.json`. From
423
+ `~/.claude/settings.json` and `~/.claude/settings.local.json` it removes what sign-in added:
424
+ tokens, hooks, attributes and the exporter block. From a project's `.claude/settings.json`,
425
+ which your team may commit, it removes only an AgentTrail device token, if one is there (as an
426
+ older enforcement setup could leave it), and only when that file is a regular file you own, not
427
+ a link. It keeps every other setting in that file, and prints which file it changed: if the
428
+ token was ever committed or pushed, treat it as exposed and revoke that device in the AgentTrail
429
+ app, under Governance ▸ Devices. If it finds a device token there but can't remove it (the file
430
+ is a link, in a linked folder, someone else's, or not plain JSON), it says so and why: remove it
431
+ by hand and revoke the device. It then prints which other AgentTrail entries are left there,
432
+ so you can remove them and commit that. It also keeps `.agenttrail.json` and the
433
+ `.git/info/exclude` lines. With no credential the hooks upload nothing.
419
434
 
420
435
  **Cursor: `logout --agent cursor`** sends what is still queued, removes the CLI's entries from
421
436
  every connected folder and from `~/.cursor/hooks.json`, deletes this machine's Cursor state,
@@ -424,7 +439,10 @@ including the import checkpoint, and revokes the device.
424
439
  **Cursor: `setup --agent cursor --unregister`** disconnects just this project and keeps the
425
440
  device signed in.
426
441
 
427
- You can also revoke a device from the AgentTrail app, under Governance ▸ Devices.
442
+ You can also revoke a device from the AgentTrail app, under Governance ▸ Devices. If `logout`
443
+ cannot reach AgentTrail to revoke the sign-in (offline, or an error answer), it still removes the
444
+ credential from this machine and says so: the device's tokens may still work until you revoke it
445
+ there.
428
446
 
429
447
  </details>
430
448
 
@@ -511,7 +529,7 @@ A name can be up to 64 characters. One that starts with `-` goes after `--`.
511
529
  | `--stand-down-guard` | `setup --agent claude`: stand Guard down here now, after you have applied your import in the app. |
512
530
  | `--unregister` | `setup --agent cursor` only: disconnect this project. |
513
531
  | `--endpoint <url>` | Session upload address. Defaults to `$AGENTTRAIL_INGEST_ENDPOINT`, then `https://ingest.agenttrail.sh`. |
514
- | `--api-endpoint <url>` | Sign-in and policy address. Defaults to `$AGENTTRAIL_API_ENDPOINT`, then `https://api.agenttrail.sh`. |
532
+ | `--api-endpoint <url>` | Sign-in and policy address. Defaults to `$AGENTTRAIL_API_ENDPOINT`, then `https://api.agenttrail.sh`. A refresh (the `SessionStart` hook, `device rename`, the backfill pre-flight) and `logout`'s revoke go back to the address the credential signed in against, whatever this says; sign in again to move a device. |
515
533
  | `--refresh` | `login` only: refresh the credential if it expires within a day; otherwise do nothing. |
516
534
 
517
535
  Backfill options are in [Backfill](#backfill), and `--help` lists them all.
@@ -561,7 +579,7 @@ entries.
561
579
  | --- | --- |
562
580
  | `https://api.agenttrail.sh` | Sign-in and refresh; fetching the policy snapshot at setup and session start; each policy check when enforcement is on; reporting at session start whether enforcement is on for this device. |
563
581
  | `https://ingest.agenttrail.sh` | Uploading sessions after each turn, from the Cursor sender, and from `backfill`; checking which sessions AgentTrail already holds before an import. |
564
- | The npm registry | The hooks run `npx -y @agenttrail/cli@latest`. |
582
+ | The npm registry | The hooks run `npx -y @agenttrail/cli@latest`; a `--global` install's `SessionStart` hook names the installed version instead. |
565
583
  | `https://www.agenttrail.sh/device` | Opened in your browser during sign-in. |
566
584
 
567
585
  `status`, `backfill --scan` and `backfill --status` make no network calls, and nothing is sent