Skip to content

Add --version command to CLI #239

@vitali87

Description

@vitali87

📋 Task Description

Implement a cgr --version command that displays the current package version.

🎯 Acceptance Criteria

  • Running cgr --version or cgr -v shows the package version
  • Version is read from pyproject.toml or package metadata (not hardcoded)
  • Output format: code-graph-rag version X.Y.Z

🔗 Related Files/Components

  • File: codebase_rag/cli.py
  • File: pyproject.toml

📝 Additional Context

Typer supports version callbacks via typer.Option. Example:

from importlib.metadata import version

def version_callback(value: bool):
    if value:
        print(f"code-graph-rag version {version('code-graph-rag')}")
        raise typer.Exit()

🚦 Priority

  • High
  • Medium
  • Low

📊 Estimated Effort

  • Small (< 2 hours)
  • Medium (2-8 hours)
  • Large (> 8 hours)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions