feat: localctx CLI and v0.1.0 packaging#8
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Makes the project shippable: a command-line interface, packaging metadata for a 0.1.0 release, and a release workflow.
What
localctxCLI: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 reusablebuild_report/render_reporthelpers live incli.py.localctxconsole script, sets the version to0.1.0, and marks the project Beta.scripts/preflight.pynow delegates tolocalcontextrouter.cli, so the skill and CLI never drift.CHANGELOG.md0.1.0 entry.v*tag, builds the sdist and wheel, runstwine 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
mainentry point, missing-file errors, and--version.Notes
py3-none-any); thelcr-ocrbinary is not bundled and is located viaLCR_OCR_BIN/PATH/the in-repo build. Text extraction, classification, and token estimation work without it; only OCR needs it.v0.1.0after merge.Verified locally: ruff, ruff format, mypy (strict), pytest (49);
python -m buildproduces an sdist and wheel that passtwine check, andlocalctx --versionreports 0.1.0.