Skip to content

Use Clipanion for CLI implementation#1118

Closed
threeal wants to merge 1 commit into
mainfrom
use-clipanion-for-cli
Closed

Use Clipanion for CLI implementation#1118
threeal wants to merge 1 commit into
mainfrom
use-clipanion-for-cli

Conversation

@threeal
Copy link
Copy Markdown
Owner

@threeal threeal commented Jun 2, 2026

Replaces Commander with Clipanion for the CLI implementation, and restructures the CLI source files to follow the barrel export convention established in #1114.

Changes

  • Replaces commander dependency with clipanion
  • Restructures CLI from a flat src/cli.ts into a module:
    • src/cli/index.ts — bin entrypoint; registers commands and calls cli.runExit()
    • src/cli/commands/fibonacci.tsFibonacciCommand class using this.context.stdout instead of process.stdout, with full static usage (description, details, examples)
  • Tests are scoped to the command level only (src/cli/commands/fibonacci.test.ts), using a PassThrough stream as the context stdout for clean isolation
  • Updates package.json bin field from dist/cli.js to dist/cli/index.js

Closes #1117

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
@threeal threeal self-assigned this Jun 2, 2026
@threeal threeal added this to the Version 4.1.0 milestone Jun 2, 2026
@threeal threeal marked this pull request as draft June 2, 2026 04:59
@threeal threeal added this to Granary Jun 2, 2026
@threeal threeal moved this to Not Harvestable in Granary Jun 2, 2026
@threeal
Copy link
Copy Markdown
Owner Author

threeal commented Jun 2, 2026

Apparently, Clipanion has a somewhat unusual help output. It looks different from the help output generated by Commander.

@threeal threeal added the enhancement New feature or request label Jun 2, 2026
@threeal
Copy link
Copy Markdown
Owner Author

threeal commented Jun 3, 2026

Surpassed by #1120.

@threeal threeal closed this Jun 3, 2026
@github-project-automation github-project-automation Bot moved this from Not Harvestable to Harvested in Granary Jun 3, 2026
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

Status: Harvested

Development

Successfully merging this pull request may close these issues.

Use Clipanion for CLI implementation

1 participant