From ac3866b8e00938729c0d2b62b6ae5ee6ca89b5e2 Mon Sep 17 00:00:00 2001 From: Garv Date: Tue, 8 Sep 2026 01:35:46 +0530 Subject: [PATCH] fix: add version flag to CLI --- agentrace/cli.py | 1 + tests/test_cli.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/agentrace/cli.py b/agentrace/cli.py index fec377b..5f9458b 100644 --- a/agentrace/cli.py +++ b/agentrace/cli.py @@ -171,6 +171,7 @@ def _existing_file(value: str) -> str: def main(argv: list[str] | None = None) -> int: p = argparse.ArgumentParser(prog="agentrace", description=__doc__.split("\n")[0]) + p.add_argument("--version", action="version", version="%(prog)s 0.1.0") source = p.add_mutually_exclusive_group() source.add_argument("--dir", help="transcript root (default ~/.claude/projects)") source.add_argument("--file", type=_existing_file, help="a single .jsonl transcript") diff --git a/tests/test_cli.py b/tests/test_cli.py index ba17ee4..ab5e86a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -116,3 +116,8 @@ def test_empty_result_names_selected_directory(tmp_path): assert result.returncode == 0 assert "No subagent runs found." in result.stdout assert f"Looked in {tmp_path}." in result.stdout + +def test_version(): + result = run_cli("--version") + assert result.returncode == 0 + assert "0.1.0" in result.stdout \ No newline at end of file