Skip to content

feat: add --version / -V flag to CLI#1698

Open
fsilvaortiz wants to merge 1 commit intogithub:mainfrom
fsilvaortiz:fix/add-version-flag
Open

feat: add --version / -V flag to CLI#1698
fsilvaortiz wants to merge 1 commit intogithub:mainfrom
fsilvaortiz:fix/add-version-flag

Conversation

@fsilvaortiz
Copy link

Summary

Adds the standard --version / -V flag to the specify CLI. Previously, running specify --version returned an error:

No such option: --version

Users had to know about the specify version subcommand instead, which is not the standard CLI convention.

Now:

$ specify --version
specify 0.1.6

$ specify -V
specify 0.1.6

The existing specify version subcommand (which shows detailed system info including template version, platform, and architecture) remains unchanged.

Closes #486

Test plan

  • specify --version prints version and exits with code 0
  • specify -V behaves the same as --version
  • specify version subcommand still works (detailed output)
  • specify --help shows --version -V in options
  • All tests pass (99/99 — 95 existing + 4 new)
  • Added 4 tests in TestVersionFlag:
    • test_version_flag_exits_zero
    • test_version_flag_prints_version
    • test_short_version_flag
    • test_version_flag_appears_in_help

AI Assistance Disclosure

This PR was drafted with assistance from Claude Code (Anthropic). All changes were reviewed and validated manually by the author.

🤖 Generated with Claude Code

Add standard --version flag as a typer callback so users can run
`specify --version` or `specify -V` to get the CLI version. The
existing `specify version` subcommand (which shows detailed system
info) remains unchanged.

Closes github#486

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

specify --version flag not supported, returns error

1 participant