@crvouga/personal 0.0.0-stage → 0.1.1

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
@@ -1,3 +1,238 @@
1
- # Temporary Holding Version
1
+ # Personal CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Use the installed `personal` executable for routine work. `npx @crvouga/personal`
4
+ is the same CLI when it is not installed.
5
+
6
+ ```sh
7
+ personal fleet-node-sync
8
+ personal fleet-status
9
+ personal fleet-discover
10
+ ```
11
+
12
+ `fleet-node-sync` reconciles locked tools, installs the public launcher, removes
13
+ owned legacy `ws` launchers, upserts the Codex proxy profile, and reconciles declared
14
+ T3 provider instances. It applies by invocation; `--dry-run` previews. Run in the
15
+ personal checkout or use `--workspace PATH`. Node ID defaults to hostname; `--id`
16
+ overrides it. Revision defaults to checkout HEAD; `--revision FULL_SHA` pins it.
17
+
18
+ ```sh
19
+ personal t3-plan --json
20
+ personal t3-apply
21
+ personal t3-status
22
+ personal t3-cleanup --dry-run
23
+ personal t3-import --instance EXISTING_ID
24
+ ```
25
+
26
+ Tracked `packages/workstation/agents/t3.json` is desired state. Apply creates and
27
+ updates declared instances and removes previously owned instances absent from the
28
+ definition. Cleanup removes only owned instances. Import is explicit ownership of
29
+ an existing instance. `--plan-hash HASH` rejects stale plans. Secrets and unrelated
30
+ settings are omitted from reports and preserved in the configuration.
31
+
32
+ All former workstation commands now use `personal workstation …`; there is no `ws`
33
+ package executable. The source installer migrates recognized legacy launchers.
34
+ Native Windows should use the npm executable; proxy adapter execution requires
35
+ macOS/Linux/WSL. Pairing and provider authentication remain per-machine prerequisites.
36
+
37
+ Read the [node/T3 reconciliation runbook](../workstation/agents/setup.md) for state,
38
+ concurrency, recovery, rollout and precise ownership boundaries. The public package
39
+ needs a local checkout and its shared toolchain for workstation operations; the T3
40
+ reconciler itself runs on Node without Bun or access to live credentials.
41
+
42
+ ## Detailed command reference
43
+
44
+ Public npm distribution: **`@crvouga/personal`**, executable **`personal`**.
45
+ The source workspace `@pkgs/personal-cli` stays private; its build bundles the
46
+ private fleet library into a standalone Node application. No Bun, repository
47
+ checkout, npm login or global installation is needed just to open the application.
48
+ Requires Node **22.13+ on the 22.x line, or 23.5+** with npm.
49
+
50
+ ```sh
51
+ npx --yes @crvouga/personal
52
+ ```
53
+
54
+ The terminal application has a flat searchable command palette sorted A–Z with group prefixes,
55
+ descriptions, target selection, progress indicators, result summaries, searchable
56
+ node/status/check drill-downs, remedies, retry/back navigation, and an add-node
57
+ wizard. It shows the equivalent noninteractive command before running anything.
58
+ Ctrl+C exits; `NO_COLOR` and narrow terminals are supported. It never clears the
59
+ terminal or automatically repairs machines. This is a command console, not an AI
60
+ chat service; no model key or chat subscription is required.
61
+
62
+ ## For people and agents
63
+
64
+ ```sh
65
+ npx --yes @crvouga/personal@latest commands --json --search ssh
66
+ npx --yes @crvouga/personal@latest agent --json
67
+ npx --yes @crvouga/personal@latest fleet doctor --local --json
68
+ npx --yes @crvouga/personal@latest fleet doctor --all --json
69
+ npx --yes @crvouga/personal@latest fleet doctor --node dev-linux --json
70
+ ```
71
+
72
+ Pin an **exact released version** instead of `latest` for automation. Direct
73
+ commands, `--json`, `--non-interactive` and redirected input never open prompts.
74
+ No arguments without a terminal prints the command catalog. JSON is one versioned
75
+ document on stdout; interactive chrome and progress use stderr. Exit codes:
76
+ **0** success/preview, **1** failed operation/check, **2** invalid usage/config,
77
+ **130** cancellation. `--strict` makes warnings and skips fail too.
78
+
79
+ `commands --json` exposes names, descriptions, categories, keywords, examples and
80
+ global flags; `agent --json` documents the output/safety contract; `fleet schema`
81
+ exposes the roster schema. JSON error messages never contain raw subprocess
82
+ output, environment variables, authentication responses or exception messages.
83
+
84
+ ## Check every Tailscale computer
85
+
86
+ ```sh
87
+ npx --yes @crvouga/personal@latest fleet discover --json
88
+ npx --yes @crvouga/personal@latest fleet health --json
89
+ ```
90
+
91
+ `discover` reads the signed-in local Tailscale daemon, includes offline computers
92
+ and excludes iOS, Android and tvOS devices. `health` checks every visible computer,
93
+ including this controller. It pings online peers, checks registered computers over
94
+ fresh verified SSH sessions, compares checkout/toolchain input hashes, checks each
95
+ pinned tool version and Docker runtime, and runs the existing read-only `personal workstation doctor`
96
+ for managed links, PATH and workstation configuration.
97
+
98
+ Register remote computers with their existing SSH aliases and actual checkout paths.
99
+ DNS names, Tailscale addresses and resolved SSH aliases are matched exactly. Missing,
100
+ ambiguous, offline or no-longer-visible registrations produce explicit failures;
101
+ the command never guesses a username/path or silently reduces the checked fleet.
102
+ `fleet nodes` before registration shows an empty list and setup guidance.
103
+
104
+ Authentication checks cover Codex, Claude Code, GitHub, Vault, T3, Railway, Vercel,
105
+ Cloudflare, AWS's active profile and npm. Their status/identity commands run on each
106
+ computer as its SSH user; browser login on another computer does not authenticate
107
+ that session. Credential values and account responses are withheld. Codex/Claude
108
+ status reports do not prove quotas, model access or a live billable request.
109
+ Gemini, Copilot and OpenCode provider access are explicitly **unverified** until a
110
+ supported noninteractive adapter can verify them; saved keys alone never count.
111
+
112
+ Health uses strict coverage: warnings and skipped checks return exit **1**, as do
113
+ failures. It cannot certify devices hidden by Tailscale ACLs, other accounts/tailnets,
114
+ all-pairs connectivity, every application, or operator-only T3/VS Code connection
115
+ flows. Those limits remain visible in the report. Per-node health probes default
116
+ to five minutes, overridable with `--timeout`; concurrency is bounded to four.
117
+ Commands only diagnose; they never log in, install tools, rewrite configuration,
118
+ or repair machines automatically. Use `--workspace` to select the reference checkout.
119
+
120
+ The palette lists all commands directly, for example **Fleet: Check all Tailscale
121
+ computers**, **Fleet: Discover Tailscale computers** and **Session: Workspace / config**.
122
+ Node lists and the first checks needing attention display immediately; detailed
123
+ reports remain available without navigating category submenus.
124
+
125
+ ## Register actual computers
126
+
127
+ Use the interactive **Fleet: Register a developer computer** action, or preview first:
128
+
129
+ ```sh
130
+ personal fleet add --id dev-linux --ssh dev-linux --path /home/dev/workspace --json
131
+ personal fleet add --id dev-linux --ssh dev-linux --path /home/dev/workspace --apply --yes --json
132
+ personal fleet validate --json
133
+ personal fleet onboard --node dev-linux --json
134
+ personal fleet doctor --all --json
135
+ ```
136
+
137
+ This registers an **existing** computer; it does not provision a host, enable SSH,
138
+ accept a host key, log in, copy credentials, or edit SSH configuration. `--runtime`
139
+ may specify an absolute Node/Bun executable on the remote machine. The default is
140
+ `node` on the non-login SSH PATH. The bundled probe is streamed over SSH; the npm
141
+ package need not be installed on remote nodes. Remote targets require POSIX
142
+ shells; use WSL for Windows SSH nodes. Native Windows supports local commands.
143
+
144
+ Roster resolution: `--config`, `PERSONAL_FLEET_CONFIG`, closest ancestor
145
+ `.fleet.local.json`, then `~/.config/personal/fleet.json`. New rosters are saved
146
+ with mode 0600 using a lock and atomic replacement; existing entries are preserved,
147
+ duplicates fail, and symlink rosters are refused. Keep custom roster paths out of
148
+ Git. `fleet init` previews **example data**, not discovered machines; creating the
149
+ example also requires `--apply --yes`.
150
+
151
+ Controller checkout: `--workspace`, `PERSONAL_WORKSPACE`, closest ancestor
152
+ `mise.toml`, then the current directory. Opening the application requires no
153
+ checkout, but repository/dependency/toolchain checks need your actual personal
154
+ checkout. A missing checkout or roster is reported, never treated as healthy.
155
+
156
+ Doctor checks the controller and all configured nodes by default. `--node` limits
157
+ remote targets; `--local` skips remote connections and requires no roster. Its
158
+ `coverage` explicitly distinguishes all-configured, selected and local checks.
159
+ A roster is not discovery of every computer. Run from each intended controller:
160
+ directed SSH success is not all-pairs connectivity. T3 peer/relay traversal and
161
+ VS Code forwarding still need the operator tests in `fleet onboard`.
162
+
163
+ ## Sync is explicit
164
+
165
+ ```sh
166
+ personal fleet sync --node dev-linux --json
167
+ personal fleet sync --node dev-linux --apply --yes --json
168
+ ```
169
+
170
+ Sync delegates to the existing mise/setup owner, with frozen dependencies. It
171
+ does not replace workstation management or OpenTofu. `--pull` requests a
172
+ fast-forward-only pull and refuses dirty/detached checkouts. Never run sync on an
173
+ untrusted checkout: setup/dependency lifecycle scripts are executable code.
174
+ `npx --yes` approves the npm download only, **not** application mutations.
175
+
176
+ ## Development and release
177
+
178
+ ```sh
179
+ bun run personal # interactive development entry
180
+ bun run --cwd packages/personal-cli tc
181
+ bun run --cwd packages/personal-cli lint
182
+ bun run --cwd packages/personal-cli test
183
+ bun run personal:build
184
+ ```
185
+
186
+ See [releasing.md](releasing.md) for automatic CI releases, credential sources,
187
+ first-publish bootstrap, packed-consumer verification and recovery.
188
+
189
+ ## Preview and apply repairs
190
+
191
+ ```sh
192
+ personal fleet repairs --json
193
+ personal fleet repair --json # all visible Tailscale computers
194
+ personal fleet repair --local --json # this computer only
195
+ personal fleet repair --node dev-linux --json # selected registered computer
196
+ personal fleet repair --local --repair workspace --json
197
+ # Copy planHash from the reviewed preview; it rejects changed plans:
198
+ personal fleet repair --local --repair workspace --plan-hash REVIEWED_SHA256 --apply --yes --json
199
+ personal fleet repair --local --repair providers --apply --yes --json
200
+ personal fleet repair --local --script # emit a POSIX script; never execute it here
201
+ ```
202
+
203
+ The flat palette includes **Fleet: Explore repairs and login commands** and
204
+ **Fleet: Repair tools and configuration**. Applying from the palette carries the
205
+ reviewed plan hash. Plan previews exit 0 even when `healthOk` is false: a valid
206
+ plan is not a healthy computer. `--repair` selects from `workspace`, `workstation`
207
+ and `providers`; omitted selection includes the eligible owner actions identified
208
+ by the failed checks. Explicit selection also supports rerunning an owner action.
209
+
210
+ `workspace` uses existing mise/shared setup and frozen dependencies. `workstation`
211
+ uses `personal:install --yes` and can update launcher/PATH, managed links, notifications
212
+ and provider configuration. `providers` uses the existing strict Vault-backed
213
+ workstation provider sync. Each computer uses its own Vault authorization; the
214
+ controller never transfers credential files, tokens, SSH agents or keychains.
215
+ Native login recipes are operator steps and are commented in generated scripts.
216
+ Use an intended Vault project/config for runtime access, for example
217
+ `vault run --config dev -- personal fleet health --json`, only when those secrets
218
+ are needed by that process.
219
+
220
+ Only registered, successfully probed remote machines are eligible for automatic
221
+ repairs. SSH host trust, unavailable computers, conflicting Git changes, native
222
+ account approvals, service permissions and manual end-to-end tests stay explicit
223
+ operator work. Unknown future checks also receive an operator step rather than
224
+ being omitted. A successful repair command is followed by fresh checks; remaining
225
+ failures, warnings or skips return exit 1. Reports separate `executionOk`,
226
+ `healthOk`, completed owner commands, and remaining steps. Actions run serially;
227
+ a failure stops later actions on that computer. Partial changes are possible.
228
+
229
+ Generated scripts require a POSIX shell and are for review in the operator's own
230
+ terminal. They use existing checkout tooling; they do not require a globally
231
+ installed `personal` on remote machines. They are point-in-time scripts without
232
+ CLI plan-hash enforcement. Prefer the guarded CLI apply path and obtain a fresh
233
+ whole-tailnet health report afterward.
234
+
235
+ See [fleet access and repair research](../fleet/docs/access-and-repair-research.md)
236
+ for the comparison of mise, OpenBao, Bitwarden, 1Password, Tailscale SSH, chezmoi,
237
+ Teleport, Ansible and Syncthing, plus existing password-manager onboarding and
238
+ the distinction between shared service secrets and per-machine logins.