Skip to content

Replace commander with yargs and restructure CLI#1120

Merged
threeal merged 1 commit into
mainfrom
replace-commander-with-yargs
Jun 3, 2026
Merged

Replace commander with yargs and restructure CLI#1120
threeal merged 1 commit into
mainfrom
replace-commander-with-yargs

Conversation

@threeal
Copy link
Copy Markdown
Owner

@threeal threeal commented Jun 2, 2026

This pull request resolves #1119 by:

  • Replaces commander with yargs for argument parsing, adding @types/yargs as a dev dependency
  • Restructures the CLI from a single src/cli.ts into src/cli/index.ts (entry point) and src/cli/commands/generate.ts (the generate command module)
  • Each command is exported as a createXxxCommand({ stdout }) factory, abstracting I/O for testability
  • Replaces the process-level cli.test.ts integration test with a unit test that wires up a real yargs instance with .exitProcess(false) and a Writable stream
  • Updates package.json bin path to dist/cli/index.js and refreshes CLAUDE.md / README.md to reflect the new structure

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
@threeal threeal force-pushed the replace-commander-with-yargs branch from 1d2b712 to 12e450a Compare June 3, 2026 04:09
@threeal threeal self-assigned this Jun 3, 2026
@threeal threeal added the enhancement New feature or request label Jun 3, 2026
@threeal threeal added this to the Version 4.1.0 milestone Jun 3, 2026
@threeal threeal merged commit 32e3112 into main Jun 3, 2026
1 check passed
@threeal threeal deleted the replace-commander-with-yargs branch June 3, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Yargs for CLI implementation

1 participant