version command retrieves and displays the version of the project being run from installed package metadata. This is a shared command available across all pyrig-based projects.
Usage
Description
Theversion command automatically determines the project name from the command invocation and displays its version. This means the same command works in pyrig itself and in any project that depends on pyrig.
The package must be installed (even in editable mode with
uv pip install -e .) for version retrieval to work.Examples
Display pyrig’s Version
Display Your Project’s Version
If you have a project calledmyproject that uses pyrig:
How It Works
Theversion command:
- Extracts the project name from
sys.argv[0] - Uses
importlib.metadata.version()to retrieve the version - Displays the formatted output:
{project_name} version {version}
Implementation Reference
Theversion command is defined in pyrig/rig/cli/shared_subcommands.py:15.
Shared Commands
Theversion command is a shared command, meaning:
- It’s defined in
shared_subcommands.pyrather thansubcommands.py - It’s automatically available in all dependent projects
- It adapts to each project’s context (shows the correct project name and version)
Related Commands
CLI Overview
Complete CLI reference and command categories
CLI System
Learn about command discovery and shared commands