@bli-cockpit/cli 0.1.11 → 0.1.12

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
@@ -15,8 +15,8 @@ Run this from the repo where work will happen:
15
15
 
16
16
  ```bash
17
17
  COCKPIT_DEVICE_NAME="$(scutil --get ComputerName 2>/dev/null || hostname -s)"
18
- npm exec --yes --package=@bli-cockpit/cli@latest -- cockpit onboard \
19
- --dashboard-url <DASHBOARD_URL> \
18
+ npm install -g @bli-cockpit/cli@latest
19
+ cockpit onboard \
20
20
  --email <APPROVED_EMAIL> \
21
21
  --device-name "$COCKPIT_DEVICE_NAME" \
22
22
  --repo "$PWD"
@@ -27,13 +27,20 @@ If a work folder contains multiple repos, run the same command from the parent:
27
27
  ```bash
28
28
  cd ~/Downloads/bluepearl-workspace
29
29
  COCKPIT_DEVICE_NAME="$(scutil --get ComputerName 2>/dev/null || hostname -s)"
30
- npm exec --yes --package=@bli-cockpit/cli@latest -- cockpit onboard \
31
- --dashboard-url <DASHBOARD_URL> \
30
+ npm install -g @bli-cockpit/cli@latest
31
+ cockpit onboard \
32
32
  --email <APPROVED_EMAIL> \
33
33
  --device-name "$COCKPIT_DEVICE_NAME" \
34
34
  --repo "$PWD"
35
35
  ```
36
36
 
37
+ The CLI defaults to the production dashboard. Normal intern/operator setup,
38
+ updates, and syncs omit `--dashboard-url`. Pass `--dashboard-url` only for
39
+ staging, a custom dashboard, or deliberately forcing a different dashboard
40
+ pairing. Already-onboarded users update with
41
+ `npm install -g @bli-cockpit/cli@latest`, then run
42
+ `cockpit sync --repo "$PWD" --json`.
43
+
37
44
  Parent mode scans child git repos/worktrees (3 folder levels deep, up to 50
38
45
  repos by default — tune with `--max-depth` / `--max-repos`; a warning prints
39
46
  if the repo cap truncates discovery), creates one stable work context per
@@ -48,7 +55,7 @@ being duplicated across repos or dropped.
48
55
 
49
56
  What happens:
50
57
 
51
- 1. npm downloads the public `@bli-cockpit/cli` package.
58
+ 1. npm installs or updates the public `@bli-cockpit/cli` package.
52
59
  2. `cockpit onboard` writes local user config.
53
60
  3. Cockpit prints a dashboard pairing URL and code.
54
61
  4. Admin approves the pending request from Ambient -> Collector approvals, or
@@ -63,8 +70,8 @@ What happens:
63
70
  `"Savina MacBook"`, `"Box VM 42"`, or the auto-filled macOS computer name.
64
71
  On reused laptops or VMs, keep `--email <APPROVED_EMAIL>` in the command.
65
72
  `cockpit onboard` skips pairing only when the existing valid session belongs to
66
- that same email and dashboard URL; a different email or dashboard forces a new
67
- approval.
73
+ that same email and dashboard URL (the production default unless overridden); a
74
+ different email or dashboard forces a new approval.
68
75
 
69
76
  Before the command runs, an Admin must create or approve the email in the
70
77
  private dashboard. Default launch path is email + temporary password, handed
@@ -75,12 +82,11 @@ separate invite acceptance step.
75
82
  When ticket work starts later:
76
83
 
77
84
  ```bash
78
- npm exec --yes --package=@bli-cockpit/cli@latest -- cockpit start \
85
+ cockpit start \
79
86
  --ticket <ticket-id> \
80
87
  --repo "$PWD"
81
88
 
82
- npm exec --yes --package=@bli-cockpit/cli@latest -- cockpit sync \
83
- --dashboard-url <DASHBOARD_URL> \
89
+ cockpit sync \
84
90
  --repo "$PWD" \
85
91
  --json
86
92
  ```
@@ -92,7 +98,8 @@ Only pass `--ticket` when the work really belongs to a visible ticket.
92
98
 
93
99
  Local files:
94
100
 
95
- - `~/.config/bli-cockpit/config.json`: dashboard URL and local install config.
101
+ - `~/.config/bli-cockpit/config.json`: dashboard URL (production default unless
102
+ overridden) and local install config.
96
103
  - `~/.config/bli-cockpit/session.json`: normal paired device session.
97
104
  - `~/.local/state/bli-cockpit/spool/`: safe retry records when upload fails.
98
105
  - `~/.local/state/bli-cockpit/cursors/raw-evidence.json`: hashes and labels of
package/dist/autostart.js CHANGED
@@ -128,7 +128,10 @@ async function existingWatchPaths(homeDir) {
128
128
  function renderPlist(options) {
129
129
  // The repo path is shell-quoted because it lands inside a `/bin/zsh -lc "…"`
130
130
  // command string; the whole command is then XML-escaped for the <string>.
131
- const command = `npm exec --yes --package=@bli-cockpit/cli@latest -- cockpit sync --repo ${shellQuote(options.workDir)} --dashboard-url ${shellQuote(options.dashboardUrl)} --json`;
131
+ const dashboardArg = options.dashboardUrl === DEFAULT_DASHBOARD_URL
132
+ ? ""
133
+ : ` --dashboard-url ${shellQuote(options.dashboardUrl)}`;
134
+ const command = `cockpit sync --repo ${shellQuote(options.workDir)}${dashboardArg} --json`;
132
135
  return [
133
136
  '<?xml version="1.0" encoding="UTF-8"?>',
134
137
  '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">',
@@ -4,7 +4,7 @@ import path from "node:path";
4
4
  import { createCollectorServer } from "../server.js";
5
5
  import { parseLocalArgs, normalizeUrl } from "./local-args.js";
6
6
  import { autostartStatus, installAutostartAgent, uninstallAutostartAgent } from "../autostart.js";
7
- import { getCollectorRuntimePaths, inspectLocalCollectorStatus, installLocalCollector, logoutLocalCollector, pairLocalCollector, readLocalCollectorSessionFile, readLocalSessionReference, startLocalWorkContext } from "../local-state.js";
7
+ import { DEFAULT_DASHBOARD_URL, getCollectorRuntimePaths, inspectLocalCollectorStatus, installLocalCollector, logoutLocalCollector, pairLocalCollector, readLocalCollectorSessionFile, readLocalSessionReference, startLocalWorkContext } from "../local-state.js";
8
8
  import { scanAndAttributeCodexSessions } from "../adapters/codex-attribution.js";
9
9
  import { scanAndAttributeClaudeSessions } from "../adapters/claude-attribution.js";
10
10
  import { acquireSyncLock } from "../sync-lock.js";
@@ -82,6 +82,8 @@ export function localCommandHelp(command) {
82
82
  " cockpit sessions [--source codex|claude] [--repo <path>] [--max-depth <n>] [--max-repos <n>] [--json]",
83
83
  " cockpit serve [--port <port>] [--repo <path>]",
84
84
  " cockpit autostart [install|uninstall|status] [--repo <path>] [--dashboard-url <url>] [--interval-seconds <n>] [--json]",
85
+ "",
86
+ `Default dashboard: ${DEFAULT_DASHBOARD_URL}. Omit --dashboard-url for normal production use; pass it only for staging/custom dashboards or to force a different pairing.`,
85
87
  ].join("\n");
86
88
  }
87
89
  function localSubcommandHelp(command) {
@@ -93,6 +95,8 @@ function localSubcommandHelp(command) {
93
95
  "",
94
96
  "Installs, pairs, starts work context(s), syncs once, and prints readiness proof.",
95
97
  "If --repo is a parent folder, scans child git repos/worktrees and rolls them up by repo.",
98
+ `Omit --dashboard-url for normal production setup (${DEFAULT_DASHBOARD_URL}).`,
99
+ "Pass --dashboard-url only for staging/custom dashboards or to force a different pairing.",
96
100
  "Run with no flags in a terminal and it prompts for the dashboard email; pass --email to skip the prompt (and on shared/reused machines, where mismatched sessions are re-paired).",
97
101
  ],
98
102
  ],
@@ -102,6 +106,7 @@ function localSubcommandHelp(command) {
102
106
  "Usage: cockpit install [--dashboard-url <url>] [--repo <path>] [--json]",
103
107
  "",
104
108
  "Writes local collector config. Pair with `cockpit login`, then run `cockpit start` when work begins.",
109
+ "Omit --dashboard-url for the production dashboard; pass it only for staging/custom dashboards.",
105
110
  ],
106
111
  ],
107
112
  [
@@ -110,6 +115,7 @@ function localSubcommandHelp(command) {
110
115
  "Usage: cockpit login [--email <owner@email>] [--device-name <name>] [--dashboard-url <url>] [--json]",
111
116
  "",
112
117
  "Starts dashboard device pairing and stores the approved local session.",
118
+ "Omit --dashboard-url for the production dashboard; pass it only for staging/custom dashboards.",
113
119
  ],
114
120
  ],
115
121
  [
@@ -136,6 +142,7 @@ function localSubcommandHelp(command) {
136
142
  "Usage: cockpit sync [--repo <path>] [--dashboard-url <url>] [--json]",
137
143
  "",
138
144
  "Uploads latest local ambient envelope(s), or spools safe retries if blocked.",
145
+ "Omit --dashboard-url for normal production sync; pass it only for staging/custom dashboards or forced re-pairing.",
139
146
  "Parent folders sync each child git worktree; Codex AND Claude Code JSONL",
140
147
  "transcripts (and Claude subagent sidecars) are attributed to repos",
141
148
  "deterministically and ambiguous transcripts are retained as unattributed",
@@ -181,6 +188,7 @@ function localSubcommandHelp(command) {
181
188
  "Installs a macOS launchd LaunchAgent that runs `cockpit sync` at login and",
182
189
  "every 30 min (default), surviving reboots — so machines never drift to Stale.",
183
190
  "Action defaults to `install`. `--repo` is the parent work folder to sync.",
191
+ "Omit --dashboard-url for production; pass it only for staging/custom dashboards.",
184
192
  "macOS-only for now; see docs/runbooks/cockpit-launchd-sync.md.",
185
193
  ],
186
194
  ],
@@ -22,7 +22,10 @@ function cockpitHelp() {
22
22
  "Usage:",
23
23
  localCommandHelp(),
24
24
  "",
25
+ "Install/update: `npm install -g @bli-cockpit/cli@latest`.",
25
26
  "Intern path: run `cockpit onboard` from the repo root; add `--ticket <id>` only when work already has a ticket.",
27
+ "Already onboarded: run `cockpit sync --repo \"$PWD\" --json`.",
28
+ "Dashboard URL is optional for normal production use; pass `--dashboard-url` only for staging/custom dashboards or forced re-pairing.",
26
29
  "Manual collector path: `install`, `login`, `start [--ticket <id>]`, `sync`, `status`.",
27
30
  ].join("\n");
28
31
  }
package/dist/upload.js CHANGED
@@ -19,7 +19,7 @@ export async function buildLocalAmbientEnvelope(options = {}) {
19
19
  const now = options.now ?? new Date();
20
20
  const paths = getCollectorRuntimePaths(options.homeDir);
21
21
  const config = await readLocalCollectorConfig(paths).catch(() => {
22
- throw new LocalUploadBlockedError("not_installed", "Local collector config missing. Run `cockpit install` before `cockpit sync`.", "cockpit install --dashboard-url <dashboard-url>");
22
+ throw new LocalUploadBlockedError("not_installed", "Local collector config missing. Install/update the CLI, then run `cockpit onboard` before `cockpit sync`.", "npm install -g @bli-cockpit/cli@latest && cockpit onboard --email <email> --repo \"$PWD\"");
23
23
  });
24
24
  const sessionFile = await readLocalCollectorSessionFile(paths).catch(() => {
25
25
  throw new LocalUploadBlockedError("unpaired", "No paired collector session found. Run `cockpit login` or `cockpit pair` before `cockpit sync`.", "cockpit login");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {