Skip to content

feat: localctx CLI and v0.1.0 packaging#8

Merged
sid732 merged 6 commits into
mainfrom
feat/cli-and-release
Jun 21, 2026
Merged

feat: localctx CLI and v0.1.0 packaging#8
sid732 merged 6 commits into
mainfrom
feat/cli-and-release

Conversation

@sid732

@sid732 sid732 commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Makes the project shippable: a command-line interface, packaging metadata for a 0.1.0 release, and a release workflow.

What

  • localctx CLI: localctx <path> [--json] [--vision-dir DIR] [--version]. Routes a PDF (or OCRs a bare image) and prints a human summary or JSON, including the tokens saved. The reusable build_report/render_report helpers live in cli.py.
  • Packaging: registers the localctx console script, sets the version to 0.1.0, and marks the project Beta.
  • Skill dedupe: scripts/preflight.py now delegates to localcontextrouter.cli, so the skill and CLI never drift.
  • Docs: README gains install, CLI, library, and skill usage; adds a CHANGELOG.md 0.1.0 entry.
  • Release workflow: on a v* tag, builds the sdist and wheel, runs twine check, and publishes to PyPI via trusted publishing (no token stored in the repo).

Tests

Seven CLI tests: report construction, unsupported-type rejection, JSON round-trip, the human summary, the main entry point, missing-file errors, and --version.

Notes

  • The wheel is pure Python (py3-none-any); the lcr-ocr binary is not bundled and is located via LCR_OCR_BIN/PATH/the in-repo build. Text extraction, classification, and token estimation work without it; only OCR needs it.
  • Publishing requires a PyPI trusted publisher configured for the repo and is triggered by tagging v0.1.0 after merge.

Verified locally: ruff, ruff format, mypy (strict), pytest (49); python -m build produces an sdist and wheel that pass twine check, and localctx --version reports 0.1.0.

sid732 added 6 commits June 20, 2026 22:23
Add the localctx CLI and the build_report/render_report helpers it shares:
route a PDF (or OCR an image), render visual pages to a directory, and emit
JSON or a human summary with the tokens saved.
Expose the localctx console script, set the version to 0.1.0, and move the
status classifier to Beta.
The preflight script now delegates to localcontextrouter.cli, so the skill and
the CLI stay in lockstep instead of duplicating the routing and formatting.
Expand the README with install, CLI, library, and skill usage, and add a
0.1.0 changelog entry.
On a v* tag, build the sdist and wheel, run twine check, and publish to PyPI
via trusted publishing.
Test report construction, unsupported-type rejection, JSON round-tripping,
the human summary, the main entry point, missing-file errors, and --version.
@sid732 sid732 merged commit 6ab31b8 into main Jun 21, 2026
6 checks passed
@sid732 sid732 deleted the feat/cli-and-release branch June 23, 2026 03:12
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