fix(cli): simplify the install command to npx zerion-cli init (WLT-2083) - #113
fix(cli): simplify the install command to npx zerion-cli init (WLT-2083)#113zerts wants to merge 1 commit into
npx zerion-cli init (WLT-2083)#113Conversation
The advertised one-liner was `npx -y zerion-cli init -y --browser` — two different `-y`s, and the flags actively made onboarding worse: `init -y` skipped real auth in favour of "go copy a key from the dashboard", and `--browser` just opened that dashboard for the copy/paste. The interactive default already did proper browser OAuth with loopback capture. - document `npx zerion-cli init` as the install command (README, usage JSON, the two partner skills that carried the long form) - `init -y` now runs the real browser login (same path as `login --browser`) instead of degrading to print-and-paste - without a TTY (CI, piped, container) the auth step prints API-key instructions instead of blocking on a 5-minute loopback callback - a denied/timed-out login prints the manual fallback and still installs skills, exit 0 — an auth hiccup shouldn't undo a good install - add `--no-open` for remote/headless hosts, mirroring `zerion login` - `--browser` is accepted as a no-op, so the old one-liner still works Also fixes the `-y` shorthand, which `parseFlags` never saw (it only handles `--flags`), so it was silently dropped — the command documented as non-interactive still showed the auth picker. The router now lifts it like `-h`/`-v`, and `init` reports the resolved mode as `nonInteractive`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ Loop review — iteration 1/5Verdict:
SummaryReviewed Every PRD decision landed and I verified each one live under a real pty, driving the OAuth loopback callback myself to exercise the approve / deny / CSRF paths. Findings are all minor: one misleading log line (pre-existing, in a file the diff doesn't touch, but newly promoted by the README), one weak test assertion, one duplicated block, one flag-semantics divergence that the HELP text is honest about. Nothing warrants a fix iteration. Findings[minor/behavior]
|
Summary
The advertised onboarding one-liner was
npx -y zerion-cli init -y --browser— five tokens with two different-ys, which reads like a typo. Worse, the flags actively made onboarding worse:init -yskipped real authentication in favour of "go copy a key from dashboard.zerion.io and runzerion config set apiKey", and--browsermerely opened that dashboard for the copy/paste. The interactive default already did proper browser OAuth with loopback capture and auto-saved the key.The install command is now:
What changed
npx zerion-cli initis the documented install command — README install section + command table, the usage JSON (zerion --help),init's own HELP, and the two partner skills that carried the long form (uniswap-lp,uniswap-x402). The ~15 agent-facingnpm install -g zerion-cliprerequisite lines are deliberately untouched — a non-interactive global install is the right thing for an agent to run.init -ynow authenticates for real: runsauthenticateWithBrowser(the same path aszerion login --browser, which works without a TTY because approval happens out-of-band) instead of degrading to print-and-paste.-ymeans "don't ask me questions", not "don't authenticate".steps[].auth.ok = falsein the JSON. An auth hiccup shouldn't undo a good CLI + skills install.--no-openadded for remote/headless hosts (prints the authorize URL instead of opening a browser), mirroringzerion login --no-open.--browseris accepted as a no-op, sonpx -y zerion-cli init -y --browserkeeps working verbatim. No flag was removed.Drive-by bug fix
-ynever worked.parseFlagsonly understands--flags(cli/utils/common/flags.js:38), so a bare-ylanded in the positional args and was silently dropped — meaning the command we documented as non-interactive was already showing the interactive auth picker. Caught by drivinginit -yunder a pty while verifying this PR. The router now lifts-yintoflags.yesalongside the existing-h/-vshorthands and filters it out of positionals, andinitreports the resolved mode asnonInteractivein its JSON output.Known issues left alone (pre-existing, out of scope)
--helpis unreachable.cli/router.js:187handlesflags.helpbefore dispatch, sozerion init --helpprints the global usage JSON and every command's ownHELPobject is dead code. Updatedinit's HELP anyway so it's correct when this is fixed.--dry-run -yassigns"-y"as--dry-run's value, becauseparseFlagstreats any non---token as a candidate value. Affects-h/-vequally, and-g(documented inzerion setup --help) is dropped entirely for the same reason as-ywas. Fixing this means changing the shared parser for every command, so it wants its own ticket.Test plan
npm ci && npm test→ 395/395 pass (adds 4: the-yshorthand, the non-TTY-ybail-out, legacy--browseracceptance, and the usage JSON no longer advertising the long form)zerion init -y --no-openunder a real pty: goes straight to browser OAuth and prints the authorize URL, no pickerzerion init(no flags) under a pty: still shows the auth-method pickerzerion init -ywithout a TTY: prints API-key instructions, exits 0, spawns no browserCloses WLT-2083
🤖 Generated with Claude Code