Skip to content

feat: add index-* CLI commands for data source indexing (#269)#285

Merged
ASuresh0524 merged 1 commit into
mainfrom
fix/index-cli-commands-269
Mar 30, 2026
Merged

feat: add index-* CLI commands for data source indexing (#269)#285
ASuresh0524 merged 1 commit into
mainfrom
fix/index-cli-commands-269

Conversation

@ASuresh0524
Copy link
Copy Markdown
Collaborator

@ASuresh0524 ASuresh0524 commented Mar 13, 2026

Summary

Clean re-implementation of PR #269's index-* CLI commands, addressing all 6 review comments:

Review Comment Fix
1. Duplicate readers Imports directly from existing apps/ readers — zero duplication
2. Stub readers returning [] Dropped index-slack and index-twitter (async MCP readers need separate work)
3. CLI handler duplication Single _build_index_from_documents() shared helper instead of 8x copy-paste
4. Hardcoded is_recompute=False Default is is_recompute=True (97% storage savings); opt-out via --no-recompute
5. Docs reference missing scripts Clean docs/user-scripts.md with no broken refs; no Turkish translation
6. CI link check failing No broken links in docs

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>

Files changed (2 files, +369 lines):

  • packages/leann-core/src/leann/cli.py — parsers, shared handler, per-source handlers, dispatch
  • docs/user-scripts.md — clean documentation

Test plan

  • leann index-browser --help shows correct args
  • leann index-chatgpt --help shows correct args
  • CLI initializes without errors
  • ruff check passes
  • ruff format passes
  • CI lint and format check
  • CI build on all platforms

Supersedes #269

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
@ASuresh0524
Copy link
Copy Markdown
Collaborator Author

this is good

@ASuresh0524
Copy link
Copy Markdown
Collaborator Author

@tolgakaratas Updated #269 here, lmk how it looks and if you think it follows same thought process!

@ASuresh0524 ASuresh0524 merged commit 82960a8 into main Mar 30, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant