Skip to content

feat(cli): add -v short flag for version command#2314

Open
vincent067 wants to merge 2 commits intoupstash:masterfrom
vincent067:feat/add-version-short-flag
Open

feat(cli): add -v short flag for version command#2314
vincent067 wants to merge 2 commits intoupstash:masterfrom
vincent067:feat/add-version-short-flag

Conversation

@vincent067
Copy link
Copy Markdown
Contributor

Hi Context7 team! 👋

This is a small UX improvement that adds -v as a short alias for the --version flag.

What's Changed

  • Added "-v, --version" option to the CLI using Commander.js
  • Follows common CLI conventions (npm, node, yarn, etc. all support -v)

Before

$ ctx7 --version  # ✓ works
$ ctx7 -v         # ✗ error: unknown option '-v'

After

$ ctx7 --version  # ✓ works
$ ctx7 -v         # ✓ works - outputs: 0.3.7

Why

Most CLI tools support both forms:

  • "node -v" / "node --version"
  • "npm -v" / "npm --version"
  • "yarn -v" / "yarn --version"

It's a small quality-of-life improvement for developers who are used to typing -v quickly. 😊

The change is minimal and only affects the help text display and option parsing - no breaking changes.

Let me know if you'd like any adjustments! Thanks for building Context7 - it's an awesome tool for AI coding workflows. 🙏

vincent067 and others added 2 commits March 22, 2026 19:00
Add documentation for Claude Code integration including:
- Quick setup instructions
- Usage examples with popular libraries
- Auto-trigger rules for NestJS, Prisma, SvelteKit, etc.
- Best practices for library documentation queries

Closes upstash#2272
Add '-v' as a short alias for '--version' flag in the CLI.
This follows common CLI conventions and improves user experience
for quickly checking the installed version.

Before:
  $ ctx7 --version  ✓ (worked)
  $ ctx7 -v         ✗ (unknown option)

After:
  $ ctx7 --version  ✓ (works)
  $ ctx7 -v         ✓ (works)

The help text now shows '-v, --version' option.
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.

1 participant