feat(cli): add ingest progress hint and --quiet/-q flag (with test coverage) - #1
Open
als3453 wants to merge 2 commits into
Open
feat(cli): add ingest progress hint and --quiet/-q flag (with test coverage)#1als3453 wants to merge 2 commits into
als3453 wants to merge 2 commits into
Conversation
- Added --quiet/-q CLI flag to the ingest subcommand. When set, all stdout output (progress + final summary) is suppressed — useful for CI/scripting. - Default mode (non-quiet) now prints an ingest progress header line (e.g. "Ingesting 3 paths: docs/, README.md, ...") BEFORE the chunk/embed step, improving UX for large or slow ingest jobs. - Backwards compatible: all existing CLI args and behaviour are preserved. - Added test coverage for both --quiet mode (silent stdout) and default progress output.
This test suite verifies the behavior of the '--quiet' flag and progress output for the 'ingest' CLI command. It includes tests for output suppression, progress indication, singular/plural path handling, and flag registration.
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.
Summary
This PR improves the UX of the
rag-python ingestCLI command by adding two user-facing features that were previously missing:Ingesting N paths: <preview>line BEFORE calling the (potentially slow) chunk + ingest pipeline. Large docs or slow embedding models previously looked like the command had hung; users now get immediate visible feedback.--quiet/-q): suppresses ALL stdout from theingestsubcommand — useful for CI, shell scripts, cron jobs, and embedding pipelines where you only care about the exit code / vector-store side effects.UX polish
...when more than 3 paths are supplied — keeps the line short even for glob expansions.-qis registered as an alias for--quietfor faster interactive use.Backwards compatibility
✅ 100% backwards compatible.
ingest(e.g.--vector-dir,--config,--reindex, positionalPATHS...) are preserved.Testing
Developed with a RED → GREEN → REFACTOR TDD cycle. Added a new test module
tests/test_cli_ingest_progress.pycontaining 6 test cases:test_quiet_flag_is_registered— both--quietand-qare accepted by argparse, and default toFalse.test_quiet_mode_produces_no_stdout— stdout is completely empty (0 chars stripped) for a 2-path quiet ingest.test_default_mode_prints_progress_and_summary— both the "Ingesting N paths" header AND a summary count appear on stdout.test_single_path_says_path_not_paths— asserts the exact singular form ("1 path", not "1 paths").test_long_path_list_is_ellipsised— 6 inputs produce "6 paths" and a...ellipsis in the preview.test_short_flag_q_is_silent— the-qshort alias behaves identically to--quiet.The tests inject a stub RAG (monkey-patching
_build_rag) so no real embeddings, Chroma store, or network calls are made — the suite is hermetic, fast, and exercises only the CLI dispatch + print branches.Files changed
src/rag_python/cli.py— register the-q/--quietflag on theingestsubparser and add print/quiet logic inmain().tests/test_cli_ingest_progress.py— new file, 6 tests as above.