marp-lens

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

marp-lens

marp-lens

Vector-based semantic search CLI for Marp presentations.
基于向量的Marp演示文稿语义搜索CLI工具

Quick Reference

快速参考

bash
undefined
bash
undefined

Search slides by meaning

按语义搜索幻灯片

npx marp-lens search "機械学習の基礎" --limit 5
npx marp-lens search "機械学習の基礎" --limit 5

Get specific slide content

获取指定幻灯片内容

npx marp-lens get "presentation.md #3"
npx marp-lens get "presentation.md #3"

View database stats

查看数据库统计信息

npx marp-lens stats
npx marp-lens stats

Index new/changed files

索引新增/修改的文件

npx marp-lens index -d ./slides
npx marp-lens index -d ./slides

Index with image descriptions

索引时包含图片描述

npx marp-lens index -d ./slides --with-images
undefined
npx marp-lens index -d ./slides --with-images
undefined

Commands

命令

Search

搜索

bash
npx marp-lens search "<query>" [options]
OptionDescription
-l, --limit <n>
Max results (default: 10)
-t, --threshold <0-1>
Min similarity (default: 0)
-o, --format <type>
Output:
table
or
json
bash
npx marp-lens search "<query>" [options]
选项描述
-l, --limit <n>
最大结果数(默认值:10)
-t, --threshold <0-1>
最小相似度(默认值:0)
-o, --format <type>
输出格式:
table
json

Get Slide

获取幻灯片

bash
npx marp-lens get "<file> #<number>"
Retrieves full content of a specific slide. Supports partial path matching.
bash
npx marp-lens get "<file> #<number>"
检索指定幻灯片的完整内容。支持部分路径匹配。

Index

索引

bash
npx marp-lens index [options]
OptionDescription
-d, --dir <path>
Directory to index
-f, --file <path>
Single file to index
-r, --rebuild
Clear and rebuild index
-i, --with-images
Include image descriptions
bash
npx marp-lens index [options]
选项描述
-d, --dir <path>
要索引的目录
-f, --file <path>
要索引的单个文件
-r, --rebuild
清空并重建索引
-i, --with-images
包含图片描述

Stats

统计信息

bash
npx marp-lens stats
Shows file count, slide count, embedding count, and database size.
bash
npx marp-lens stats
显示文件数量、幻灯片数量、嵌入向量数量和数据库大小。

Workflow

工作流程

  1. Find relevant slides:
    npx marp-lens search "topic"
  2. Get full content:
    npx marp-lens get "file.md #N"
    for slides of interest
  3. Re-index if needed:
    npx marp-lens index -d ./slides
    after adding files
  1. 查找相关幻灯片
    npx marp-lens search "topic"
  2. 获取完整内容:对感兴趣的幻灯片使用
    npx marp-lens get "file.md #N"
  3. 必要时重新索引:添加文件后执行
    npx marp-lens index -d ./slides

Output Format

输出格式

Search results show similarity score, file path, slide number, heading, and content preview. Use
--format json
for structured output.
搜索结果会显示相似度得分、文件路径、幻灯片编号、标题和内容预览。使用
--format json
可获取结构化输出。