Skip to content

feat(cli): add ledger --version - #117

Merged
ChelseaKR merged 1 commit into
mainfrom
agent/cli-version-flag
Aug 5, 2026
Merged

feat(cli): add ledger --version#117
ChelseaKR merged 1 commit into
mainfrom
agent/cli-version-flag

Conversation

@ChelseaKR

Copy link
Copy Markdown
Owner

Summary

  • ledger had no top-level version flag. COMMAND is a required positional, so ledger --version (or bare ledger) just failed with "the following arguments are required: COMMAND" — no way to ask an installed ledger what version it was without opening pyproject.toml or pip show ledger-archive.
  • Adds a standard argparse --version action: prints ledger <version> and exits 0.
  • Sourced from ledger.__version__, the same installed-package-metadata value every other version-truth path already uses (RELEASE-AND-VERSIONING-STANDARD REL-02) — so this can't drift from pyproject.toml.

Test plan

  • uv run ledger --version prints ledger 0.1.0.dev0 and exits 0
  • New test test_version_flag_prints_version_and_exits_zero in tests/test_cli.py
  • make lint type test i18n claims hygiene workflow-lint — all green, 1021 passed (was 1020)
  • ruff format --check clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01RwvFhZbxJZZn4bpejFu3Vj

The CLI had no top-level version flag: `COMMAND` is a required positional
argument, so `ledger --version` (or running with no subcommand) just failed
with "the following arguments are required: COMMAND". There was no way to
ask an installed `ledger` what version it was short of opening
pyproject.toml or `pip show`.

Add a standard argparse `--version` action that prints `ledger <version>`
and exits 0, sourced from `ledger.__version__` — the same installed-package-
metadata value every other version-truth path already uses (REL-02), so it
cannot drift from pyproject.toml.

Verification (offline gates, all green): make lint type test i18n claims
hygiene workflow-lint (1021 passed, including the new test).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RwvFhZbxJZZn4bpejFu3Vj
@ChelseaKR
ChelseaKR merged commit b4e30e2 into main Aug 5, 2026
17 checks passed
@ChelseaKR
ChelseaKR deleted the agent/cli-version-flag branch August 5, 2026 15:50
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