feat: CLI v0.2.0 — memweave index/add/files/search/stats#5
Merged
sachinsharma9780 merged 3 commits intomainfrom Apr 25, 2026
Merged
feat: CLI v0.2.0 — memweave index/add/files/search/stats#5sachinsharma9780 merged 3 commits intomainfrom
sachinsharma9780 merged 3 commits intomainfrom
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5 +/- ##
==========================================
+ Coverage 88.27% 89.74% +1.47%
==========================================
Files 25 26 +1
Lines 1672 1863 +191
==========================================
+ Hits 1476 1672 +196
+ Misses 196 191 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Full details on command design, flag mapping, and acceptance criteria are in the issue. This PR is the implementation.
What's in this PR
New:
memweave/cli.py— five Click commands, each a thin wrapper over an existingMemWeavepublic method. No new core logic.memweave indexmem.index()memweave add <file>mem.add()memweave filesmem.files()memweave search <query>mem.search()memweave statsmem.status()All commands support
--workspace / -w,--embedding-model, and--json. Search exposes the full API surface:--strategy,--min-score,--max-results,--source-filter,--mmr-lambda,--decay-half-life-days,--snippet-chars.Bug fixes in
store.py(discovered during development):_startup_dirty_check()—statswas always reportingdirty=Truebecause_dirtyis in-memory and never persisted. Added a startup scan that compares thefilestable against disk and sets_dirty=Falsewhen the index is current.MMRRerankerwas always constructed withcfg.mmr.lambda_parameven whenmmr_lambdawas passed per-call. The computed value was silently dropped.TemporalDecayProcessorignoreddecay_half_life_daysand always used the config default.Tests
tests/unit/cli/— 6 files, all commands covered with Click's test runner andAsyncMock. No API key needed.tests/integration/test_cli_*.py— 5 files, end-to-end against a real index.tests/unit/test_store.py—TestStartupDirtyCheck(5 tests) andTestApplyPostprocessors(8 tests) added to prevent the above bugs from regressing undetected in CI.