refactor(cli): build CLI on citty - #62
Merged
Merged
Conversation
Replace the hand-rolled arg parser with citty's defineCommand/runMain. Both `generate` and `schema` (with its 8 nested subcommands) now get auto-generated --help/usage and consistent flag parsing. A small action() wrapper preserves the previous clean one-line error output instead of citty's stack dump. generate behavior is unchanged. The splitArgs unit tests are dropped (parsing is now citty's responsibility); command merge and auth-resolution tests remain. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Follow-up to #60 — migrates the CLI from the hand-rolled arg parser to citty.
What
cli/index.ts+cli/schema.tsrewritten asdefineCommand/runMainwithgenerate+schema(8 nested subcommands).--help/usage for every command and consistent flag parsing (short flags like-cnow work everywhere, not just ongenerate).cli/action.ts: small wrapper preserving the previous clean one-line error output (citty's default dumps a full stack, and itsCLIErrorisn't exported).splitArgsunit tests (parsing is citty's job now); command-merge and auth-resolution tests remain.cittyas pbkit's first runtime dependency.pbkit generatebehavior is unchanged.Verification
tsc --noEmitcleanbun test— 139 pass / 0 failpbkit/pbkit schema/ each subcommand; clean one-line errors for no-creds / partial-creds / no-config; unknown-command shows usage;generatepaths unchanged.🤖 Generated with Claude Code