feat: add index-* CLI commands for data source indexing (#269)#285
Merged
Conversation
Addresses all review comments on PR #269: 1. No duplicate readers — imports directly from existing apps/ readers (ChromeHistoryReader, IMessageReader, EmlxReader, WeChatHistoryReader, ChatGPTReader, ClaudeReader) instead of duplicating 687 lines 2. Removed stub commands — dropped index-slack and index-twitter since SlackMCPReader and TwitterMCPReader return [] (async MCP readers need separate implementation) 3. Single shared helper — _build_index_from_documents() replaces 8x copy-pasted ~30-line handlers 4. Default is_recompute=True — preserves LEANN's 97% storage savings; users can opt out with --no-recompute 5. Clean docs — user-scripts.md has no missing script references and no Turkish translation 6. No CI link check failures — removed all broken references Commands added: leann index-browser [chrome|brave] leann index-email leann index-calendar leann index-imessage leann index-wechat --export-dir <path> leann index-chatgpt --export-path <path> leann index-claude --export-path <path> Made-with: Cursor
Collaborator
Author
|
this is good |
Collaborator
Author
|
@tolgakaratas Updated #269 here, lmk how it looks and if you think it follows same thought process! |
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
Clean re-implementation of PR #269's
index-*CLI commands, addressing all 6 review comments:apps/readers — zero duplication[]index-slackandindex-twitter(async MCP readers need separate work)_build_index_from_documents()shared helper instead of 8x copy-pasteis_recompute=Falseis_recompute=True(97% storage savings); opt-out via--no-recomputedocs/user-scripts.mdwith no broken refs; no Turkish translationCommands added:
leann index-browser [chrome|brave]leann index-emailleann index-calendarleann index-imessageleann index-wechat --export-dir <path>leann index-chatgpt --export-path <path>leann index-claude --export-path <path>Files changed (2 files, +369 lines):
packages/leann-core/src/leann/cli.py— parsers, shared handler, per-source handlers, dispatchdocs/user-scripts.md— clean documentationTest plan
leann index-browser --helpshows correct argsleann index-chatgpt --helpshows correct argsruff checkpassesruff formatpassesSupersedes #269