ReviewOS

also looking at this

stacks/buddy

feat(cli): restore the affordances the docs promised

#1402
Merged glennmichael123 wants to merge feat/restore-documented-affordances into main
6 files +150 -8
9 days ago

The docs audit removed ~15 commands and flags that were documented but never registered. Removal was right for the ones describing a product that was never built — but three were documented because they are obviously wanted, and the backing already existed. This adds them.

[!NOTE] Stacked on #1401. Review order: #1399 → #1400 → #1401 → this.

What this adds

Why it was worth implementing rather than deleting
buddy initAlias for setup. Setup is the command that writes the config, so the alias is honest — and init is what people type first, from npm, git and cargo.
buddy helpPrinted Command "help" not found — a poor greeting for the one word a newcomer is most likely to try. Now a real subcommand.
buddy open-settings --type <repo|org|both>Both URLs were already computed and both were always opened, staggered by a setTimeout. Org settings 404 on a personal account, so opening them unconditionally is noise.

buddy help calls unsetMatchedCommand() first, otherwise outputHelp() renders its own usage instead of the command list. --type is validated before the repository lookup, so a typo fails immediately rather than after two lines of output.

The checker had a gap, and this is how we found it

check:docs passed while all three were undocumented. Its extractor read only the chained .command() spelling, so the single-line cli.command('version', …) form was invisible, and it never read .alias() at all.

Both fixed — the reported command count rises from 30 to 33, which also means buddy version had been missing from the set the whole time.

Starting on the zero-CLI-test problem

bin/cli.ts is 3,401 lines and imported by zero tests. That is the root reason flag drift survived. Importing it calls cli.parse(), so it cannot be inspected directly — test/cli-surface.test.ts runs the binary as a subprocess instead, which is the only way to assert on the surface a user actually meets.

Five tests: the three additions, plus the two failure modes that matter — an unknown command, and an unknown flag being rejected rather than ignored.

Deliberately not implemented

Each is a product decision rather than a restoration, and belongs to whoever owns the roadmap:

  • buddy update --reviewers/--labels/--assignees/--auto-merge — these mirror real config keys, so a CLI override is reasonable, but it needs a precedence decision against buddy.config.ts.
  • buddy schedule --cron/--timezone — same shape.
  • buddy workflow <name> — would need the workflow presets to work first. generateCoreWorkflows(_preset, …) currently discards the preset it is given.

Correctly deleted and not revisited: buddy scan --dry-run (scan never writes, so the flag is meaningless rather than missing), and buddy labels / buddy assign (whole command surfaces with no backing).

Verification

  • 1890 pass / 0 fail (+5), lint clean, typecheck clean
  • check:docs green: 75 pages, 33 commands, 221 config keys
  • Docs site builds: 73 pages

Part 4 of 4.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UWouahBJT3msK7V2VDYY6T

6 changed files on the files tab, with 0 review threads.

Sign in to comment on this pull request.