Skip to content

Add a top-level skill2 --version flag #1

Description

@MisterBrookT

Problem

Skill2 already exposes its package version through skill2.__version__, but the CLI has no direct way to print it. Users currently need to inspect Python metadata when checking an installation or reporting a bug.

Add a top-level --version flag so this works:

$ skill2 --version
skill2 0.1.1

The command should exit with status 0 and require no subcommand.

Suggested approach

  • Import __version__ from skill2 in src/skill2/cli.py.
  • Register a top-level argparse version action in build_parser().
  • Add a focused CLI test in tests/test_cli.py.
  • Sync generated Skill runtime bundles after changing the source CLI.

Relevant files

  • src/skill2/cli.py — CLI parser.
  • src/skill2/__init__.py — existing version source.
  • tests/test_cli.py — CLI test patterns.
  • tools/sync_skill_runtime.py — updates generated _runtime copies from src/.

Please edit files under src/ and tests/; do not hand-edit generated _runtime copies.

Acceptance criteria

  • skill2 --version prints exactly skill2 <current-version> followed by a newline.
  • It exits with status 0 without requiring a subcommand.
  • Version comes from skill2.__version__; no duplicate hard-coded version.
  • A regression test covers stdout and exit status.
  • Generated Skill runtimes are synchronized.
  • Existing tests and lint remain green.

Validation

PYTHONPATH=src uv run python -m skill2.cli --version
PYTHONPATH=src uv run python -m unittest tests.test_cli
uv run python tools/sync_skill_runtime.py --check
uv run ruff check .

Contributor note

Small, self-contained change. Comment below if you want to work on it or need help finding the parser/test location.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions