feat: add mcp-recall import command#176
Merged
Merged
Conversation
Restores items from a recall__export JSON dump into the current project's SQLite database. Supports --overwrite to replace existing items, --keep-project-key to preserve original project association, and --dry-run for preview without writing. Closes #173
- Fix counter mutation inside transaction (counts now accumulate only after successful commit, not before) - Fix chunkStmt prepared once outside the per-item loop (was O(N) redundant prepares) - Fix dry-run to accurately count skips/overwrites by opening target DB read-only instead of blindly reporting all items as "imported" - Fix bare "." output when all items are skipped (now prints "Nothing imported.") - Remove redundant initSchema call (getDb already runs schema DDL) - Remove double-read of RECALL_DB_PATH (was dead code due to defaultDbPath reading the env var itself) - Detect recall__export empty sentinel before JSON.parse to give clear message - Add path.resolve on file argument to normalise path traversal - Add file size warning for imports over 50 MB - Fix hardcoded developer path in tests (use import.meta.dir) - Merge duplicate closeDb import in tests - Add test for chunk row cleanup on --overwrite - Add test verifying dry-run accurately counts skips
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
mcp-recall import <file>CLI command that restores items from arecall__exportJSON dump into the current project's SQLite database--overwrite(replace existing items),--keep-project-key(preserve original project association), and--dry-run(preview without writing)StoredOutputschema and re-indexescontent_chunksfor FTSTest plan
--overwritereplaces them--dry-runwrites nothing to DBrecall__exporttsc --noEmitclean