Fix: Remove short flags from non-boolean typer.Option definitions #49
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.
Fixes #48
Problem
CAM failed to initialize with
TypeError: Secondary flag is not valid for non-boolean flagwhen running any command. The error occurred during Typer/Click CLI initialization, making the tool completely unusable.Root Cause
Throughout the codebase, non-boolean
typer.Option()definitions incorrectly included short flags (e.g.,-c,-s,-n,-o,-b,-f,-d,-a,-l,-m).In Click/Typer, only boolean flags can have both a long form (
--flag) and short form (-f). Non-boolean options (strings, paths, integers, etc.) can only use long-form flags.Solution
1. Fixed Short Flag Definitions (Commit: af64dfe)
typer.Optiondefinitions across 12 filesprompts_commands.pywhere thedefaultparameter name conflicted with boolean flag syntaxTrue/Falseas first argument) retain their short flags as they are allowed2. Fixed Typer Version Incompatibility (Commit: 2545df3)
During testing, we discovered a second bug: The project required
typer>=0.13.0, but short flags for booleans were only added in Typer 0.16.0. This caused an error:Fix: Upgraded minimum Typer version from
>=0.13.0to>=0.16.0inpyproject.tomlto ensure short flag support works correctly.Changes
Files Modified (13 total)
cli/agents_commands.pycli/app.pycli/options.pycli/plugins/plugin_discovery_commands.pycli/plugins/plugin_install_commands.pycli/plugins/plugin_management_commands.pycli/plugins/plugin_marketplace_commands.pycli/prompts_commands.pycli/skills_commands.pymcp/cli.pymcp/install_commands.pymcp/server_commands.pypyproject.toml(Typer version update)Example Changes
Before:
After:
Boolean flags (unchanged):
Version update in pyproject.toml:
Testing
Verified that CLI initializes successfully without errors:
Impact
Breaking Changes
Users who were using short flags for non-boolean options will need to switch to long flags:
-c→--config-s→--scope-n→--name-o→--ownerHowever, since the tool was completely broken before this fix, there are likely no active users relying on these short flags.
Note: This PR was created with assistance from Claude Code after discovering and documenting the issue in #48. The Typer version incompatibility was discovered during testing and fixed in a follow-up commit.