Skip to content

Fix version flag conflict in add command#10

Merged
moshest merged 1 commit intomainfrom
claude/fix-package-version-add-QjunI
Feb 4, 2026
Merged

Fix version flag conflict in add command#10
moshest merged 1 commit intomainfrom
claude/fix-package-version-add-QjunI

Conversation

@moshest
Copy link
Member

@moshest moshest commented Feb 4, 2026

Summary

Renamed the --version flag to --pkg-version in the add command to resolve a conflict with Commander.js's built-in --version flag, which displays the CLI tool's version.

Changes

  • Renamed --version option to --pkg-version in the CLI argument parser
  • Updated the options interface to use pkgVersion instead of version
  • Added internal mapping to convert pkgVersion to version before passing to handler functions, maintaining backward compatibility with existing internal APIs
  • Updated README documentation and examples to reflect the new flag name

Implementation Details

The fix uses an internal options mapping approach that:

  1. Accepts the new --pkg-version flag from users
  2. Maps it to the internal version property before calling handler functions
  3. Preserves the existing internal API without requiring changes to addFromFile, addFromUrl, addFromGitClone, and addFromLocalDir functions

This approach minimizes the scope of changes while cleanly separating the public CLI interface from internal implementation.

https://claude.ai/code/session_014uvpqdDUKxPX5ATpWDmLpP

…flict

The --version option on the add command was being intercepted by
Commander.js's built-in version flag, causing it to display the CLI
version instead of accepting a package version label.

https://claude.ai/code/session_014uvpqdDUKxPX5ATpWDmLpP
@moshest moshest merged commit 0845e7d into main Feb 4, 2026
3 checks passed
@moshest moshest deleted the claude/fix-package-version-add-QjunI branch February 4, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants