Skip to content

CLI should support a lightweight --version path #359

@Leon-Algo

Description

@Leon-Algo

Description

The CLI should expose a lightweight top-level opencontext --version path that prints the installed package version and exits successfully.

Today, the CLI module eagerly pulls in the FastAPI/Uvicorn startup path, and it does not offer a dedicated top-level --version flag. That makes simple version inspection heavier than necessary and more brittle in environments that only need package metadata.

Expected behavior

  • opencontext --version prints the package version and exits with status 0.
  • The version path does not require importing FastAPI/Uvicorn or triggering application startup side effects.
  • Existing integrations that reference opencontext.cli:app continue to work.

Why this matters

  • Users and packaging/debugging tools expect --version to be cheap and reliable.
  • Lightweight version inspection is useful even when web/runtime dependencies are unavailable.
  • Preserving the legacy app entrypoint avoids breaking existing deploy or embedding workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions