Skip to content

Add lightweight CLI --version support#357

Open
Leon-Algo wants to merge 2 commits intovolcengine:mainfrom
Leon-Algo:codex/cli-version-output-pr
Open

Add lightweight CLI --version support#357
Leon-Algo wants to merge 2 commits intovolcengine:mainfrom
Leon-Algo:codex/cli-version-output-pr

Conversation

@Leon-Algo
Copy link
Copy Markdown

Summary

  • add a top-level opencontext --version flag that prints the package version and exits successfully
  • refactor the CLI so the version path stays lightweight and does not eagerly import FastAPI/Uvicorn or initialize app startup side effects
  • preserve compatibility for the legacy opencontext.cli:app entrypoint with a lazy shim and add regression tests for the new CLI behavior

Test Plan

  • python3 -m unittest tests.test_cli_version -v
  • python3 -m opencontext.cli --version
  • python3 -m opencontext.cli --help
  • python3 -c "import opencontext.cli as c; print(type(c.app).__name__)"

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