docs(m74-002): zombiectl login verification code + --token-name#67
Merged
Conversation
Reflects the M74_002 device-flow hardening landing on api.usezombie.com: - `zombiectl login` now requires a terminal-side verification code (6-digit, displayed on the browser approval page) in addition to the browser approval click. The code binds the approver to the typist — URL phishing alone no longer mints a credential. - `--token-name <label>` flag persists a human-readable device label alongside the token; shows up on the approval page and in `auth status`. Defaults to platform family (`macos-cli` / `linux-cli` / `windows-cli`). - `zombiectl logout` description clarified: removes local credentials and aborts in-flight login sessions, does NOT revoke the active JWT (Clerk-revocation is not a client-side operation), does NOT touch `ZMB_TOKEN` / `ZOMBIE_TOKEN` env vars. - `auth status` mentions `token_name` field in the decoded credential. Quickstart Step "Sign in" mirrors the new flow with a one-line tip about `--token-name` for device labeling. Holds for PR #331 (M74_002) landing — this branch should NOT be merged to docs main until #331 merges to usezombie main, otherwise the docs describe a CLI flow users can't yet use. Stage 1 / Stage 2 of the dashboard token-model cleanup (post-M74_002, internal architecture only) are not documented here — they're user- invisible. AUTH.md in the usezombie repo carries the full roadmap. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…-token The CLI reads a single auth-token env var, ZOMBIE_TOKEN (ZMB_TOKEN removed in M74_003; ZOMBIE_API_TOKEN never existed). Reconcile the three names the page used — `--no-input` guidance, the logout note, and `auth status` — to the one canonical ZOMBIE_TOKEN, fixing the greptile P1 ambiguity. Also brings the login docs up to the shipped flow: - Document `--token <token>` + the non-interactive resolve order (--token > ZOMBIE_TOKEN > piped stdin > browser device flow), with a CI/scripts example. - Note client-side 6-digit validation (a typo re-prompts, no round-trip). - Drop `--timeout-sec` / `--poll-ms` (poll-era flags removed in M74_003). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ive exit - `--token-name` is ignored for any non-browser token source (--token, ZOMBIE_TOKEN env, or piped stdin), not just --token — none carry a browser session to label. - A non-interactive shell with no token exits immediately with an error (it can't prompt) rather than "fails fast asking for one". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Addressed the two latest review findings on `cli/zombiectl.mdx` in 688aff7:
|
Docs-site changelog <Update> for the login work — verification-code device flow, non-interactive token auth (--token / ZOMBIE_TOKEN / piped stdin), device labels, and the single ZOMBIE_TOKEN env var. Addresses the greptile P2 (docs-site changelog is a separate surface from the lead-repo notes). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolve changelog.mdx top-of-file conflict: order the new May 22 zombiectl login entry above main's May 21/20 entries (API keys, steer REPL, dashboard token, inline workspace). Both kept; newest-first.
- api-reference/introduction.mdx: the "POST /sessions -> OAuth -> poll GET /sessions until status:complete, extract token" steps were wrong. There is no status:complete, and the device flow needs the dashboard's browser + ECDH leg, so a bare API client cannot drive it. Replace with the two real bearer tokens: a tenant API key (zmb_t_..., dashboard-minted under Settings -> API keys) for programmatic/service callers, and the short-lived user JWT from `zombiectl login` for interactive humans. - changelog.mdx: fix a stale `ZOMBIE_API_TOKEN` env-var name in the historical `auth status` entry — the variable the CLI actually reads is `ZOMBIE_TOKEN`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reflects M74_002 (device-flow hardening) landing in usezombie/usezombie#331 — merged 2026-05-20.
What changed
zombiectl loginnow requires a 6-digit terminal-side verification code in addition to the browser approval click. The code binds the approver to the typist; URL phishing alone no longer mints a credential.--token-name <label>flag persists a human-readable device label alongside the token. Shows up on the approval page and inauth status. Defaults to platform family (macos-cli/linux-cli/windows-cli).zombiectl logoutdescription clarified: removes local credentials and aborts in-flight login sessions, does NOT revoke the active JWT (Clerk-revocation is not a client-side operation), does NOT touchZMB_TOKEN/ZOMBIE_TOKENenv vars.auth statusmentionstoken_namefield in the decoded credential.--token-namefor device labeling.Files
cli/zombiectl.mdx— login flow + flag table + logout/auth status copycli/install.mdx,zombies/install.mdx— install snippet bumpsquickstart.mdx— Sign in stepindex.mdx,docs.json— minor syncchangelog.mdx— entry removed (lead-PR #331 carries the canonical changelog entry)Holdback cleared
Held until usezombie/usezombie#331 merged. That landed 2026-05-20 — docs can ship.
Out of scope
Stage 1 / Stage 2 of the dashboard token-model cleanup (post-M74_002, internal architecture only) — user-invisible, no doc surface.
Greptile Summary
Documents the M74_002 device-flow hardening shipped in usezombie/usezombie#331:
zombiectl loginnow requires a terminal-side 6-digit verification code to bind the browser approver to the typist, and gains--token-name,--token,--force, and--no-inputflags for device labeling and non-interactive use.cli/zombiectl.mdxrewrites the entire authentication section with the new device flow, flag table, token-resolution priority order, and clarified logout/auth-status semantics; env var naming is reconciled to the single canonicalZOMBIE_TOKEN.api-reference/introduction.mdxreplaces the now-invalid programmatic auth-session API steps with a two-token-type description (long-lived tenant API key vs short-lived user JWT) that matches the new security model.changelog.mdxadds the required docs-site<Update>entry (May 22, 2026) at the top per AGENTS.md, and fixes a staleZOMBIE_API_TOKENreference in an older entry.Confidence Score: 5/5
Documentation-only PR; no runnable code changes. All four changed files accurately reflect the shipped M74_002 behaviour and are internally consistent.
The env-var naming has been fully reconciled to ZOMBIE_TOKEN across all changed pages, the required changelog entry is present in the correct position, and the logout/auth-status semantics are clearly delineated. The one open question — whether --token accepts tenant API keys in addition to user JWTs — is a clarification gap rather than a mis-statement, and does not affect the correctness of any other documented behaviour.
cli/zombiectl.mdx — the --token flag description would benefit from explicitly stating which token types are accepted, given the two-token-type model introduced in api-reference/introduction.mdx.
Important Files Changed
Sequence Diagram
sequenceDiagram participant U as User (terminal) participant CLI as zombiectl participant B as Browser participant S as usezombie server U->>CLI: zombiectl login [--token-name label] CLI->>S: Initiate device flow session S-->>CLI: login_url + session_id CLI->>B: Open login_url in browser CLI->>U: Waiting for browser approval... B->>S: User clicks Approve S-->>B: Display 6-digit verification code B->>U: User reads code from browser U->>CLI: Type 6-digit code into terminal CLI->>S: Submit code bound to session_id S-->>CLI: JWT token CLI->>CLI: Persist token + token_name label CLI->>S: GET /v1/tenants/me/workspaces S-->>CLI: workspace list CLI->>CLI: Write current_workspace_id to local state CLI->>U: Login complete note over U,S: Non-interactive path (CI / scripted) U->>CLI: Supply token via flag, env var, or piped stdin CLI->>S: Validate supplied token S-->>CLI: OK CLI->>CLI: Persist token (token_name flag ignored) CLI->>U: Login completePrompt To Fix All With AI
Reviews (5): Last reviewed commit: "docs: correct programmatic-auth guidance..." | Re-trigger Greptile
Context used: