repoprompt
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRepoPrompt Skill
RepoPrompt 技能
When to Use
适用场景
- Explore codebase structure (tree, codemaps)
- Search code with context lines
- Get code signatures without full file content (token-efficient)
- Read file slices (specific line ranges)
- Build context for tasks
- 探索代码库结构(树状图、代码映射)
- 带上下文行搜索代码
- 获取代码签名而无需完整文件内容(节省Token)
- 读取文件片段(指定行范围)
- 为任务构建上下文
Token Optimization
Token优化
RepoPrompt is more token-efficient than raw file reads:
- → signatures only (not full content)
structure - → slices instead of full files
read --start-line --limit - → relevant matches with context
search --context-lines
RepoPrompt 比直接读取文件更节省Token:
- → 仅返回签名(而非完整内容)
structure - → 读取片段而非完整文件
read --start-line --limit - → 返回带上下文的相关匹配结果
search --context-lines
CLI Usage
CLI使用方法
bash
undefinedbash
undefinedIf installed to PATH (Settings → MCP Server → Install CLI to PATH)
若已安装至PATH(设置 → MCP服务器 → 安装CLI至PATH)
rp-cli -e 'command'
rp-cli -e 'command'
Or use the alias (configure in your shell)
或使用别名(在shell中配置)
repoprompt_cli -e 'command'
undefinedrepoprompt_cli -e 'command'
undefinedCommands Reference
命令参考
File Tree
文件树
bash
undefinedbash
undefinedFull tree
完整树状图
rp-cli -e 'tree'
rp-cli -e 'tree'
Folders only
仅显示文件夹
rp-cli -e 'tree --mode folders'
rp-cli -e 'tree --mode folders'
Selected files only
仅显示选中文件
rp-cli -e 'tree --mode selected'
undefinedrp-cli -e 'tree --mode selected'
undefinedCode Structure (Codemaps) - TOKEN EFFICIENT
代码结构(代码映射)- 节省Token
bash
undefinedbash
undefinedStructure of specific paths
指定路径的结构
rp-cli -e 'structure src/auth/'
rp-cli -e 'structure src/auth/'
Structure of selected files
选中文件的结构
rp-cli -e 'structure --scope selected'
rp-cli -e 'structure --scope selected'
Limit results
限制结果数量
rp-cli -e 'structure src/ --max-results 10'
undefinedrp-cli -e 'structure src/ --max-results 10'
undefinedSearch
搜索
bash
undefinedbash
undefinedBasic search
基础搜索
rp-cli -e 'search "pattern"'
rp-cli -e 'search "pattern"'
With context lines
带上下文行
rp-cli -e 'search "error" --context-lines 3'
rp-cli -e 'search "error" --context-lines 3'
Filter by extension
按扩展名过滤
rp-cli -e 'search "TODO" --extensions .ts,.tsx'
rp-cli -e 'search "TODO" --extensions .ts,.tsx'
Limit results
限制结果数量
rp-cli -e 'search "function" --max-results 20'
undefinedrp-cli -e 'search "function" --max-results 20'
undefinedRead Files - TOKEN EFFICIENT
读取文件 - 节省Token
bash
undefinedbash
undefinedFull file
完整文件
rp-cli -e 'read path/to/file.ts'
rp-cli -e 'read path/to/file.ts'
Line range (slice)
行范围(片段)
rp-cli -e 'read path/to/file.ts --start-line 50 --limit 30'
rp-cli -e 'read path/to/file.ts --start-line 50 --limit 30'
Last N lines (tail)
最后N行(尾部)
rp-cli -e 'read path/to/file.ts --start-line -20'
undefinedrp-cli -e 'read path/to/file.ts --start-line -20'
undefinedSelection Management
选中项管理
bash
undefinedbash
undefinedAdd files to selection
添加文件至选中项
rp-cli -e 'select add src/auth/'
rp-cli -e 'select add src/auth/'
Set selection (replace)
设置选中项(替换原有)
rp-cli -e 'select set src/api/ src/types/'
rp-cli -e 'select set src/api/ src/types/'
Clear selection
清空选中项
rp-cli -e 'select clear'
rp-cli -e 'select clear'
View current selection
查看当前选中项
rp-cli -e 'select get'
undefinedrp-cli -e 'select get'
undefinedWorkspace Context
工作区上下文
bash
undefinedbash
undefinedGet full context
获取完整上下文
rp-cli -e 'context'
rp-cli -e 'context'
Specific includes
指定包含内容
rp-cli -e 'context --include prompt,selection,tree'
undefinedrp-cli -e 'context --include prompt,selection,tree'
undefinedChain Commands
链式命令
bash
undefinedbash
undefinedMultiple operations
多步操作
rp-cli -e 'select set src/auth/ && structure --scope selected && context'
undefinedrp-cli -e 'select set src/auth/ && structure --scope selected && context'
undefinedWorkspaces
工作区
bash
undefinedbash
undefinedList workspaces
列出工作区
rp-cli -e 'workspace list'
rp-cli -e 'workspace list'
List tabs
列出标签页
rp-cli -e 'workspace tabs'
rp-cli -e 'workspace tabs'
Switch workspace
切换工作区
rp-cli -e 'workspace switch "ProjectName"'
undefinedrp-cli -e 'workspace switch "ProjectName"'
undefinedAI Chat (uses RepoPrompt's models)
AI聊天(使用RepoPrompt的模型)
bash
undefinedbash
undefinedSend to chat
发送聊天请求
rp-cli -e 'chat "How does the auth system work?"'
rp-cli -e 'chat "认证系统的工作原理是什么?"'
Plan mode
规划模式
rp-cli -e 'chat "Design a new feature" --mode plan'
undefinedrp-cli -e 'chat "设计一个新功能" --mode plan'
undefinedContext Builder (AI-powered file selection)
上下文构建器(AI驱动的文件选中)
bash
undefinedbash
undefinedAuto-select relevant files for a task
为任务自动选择相关文件
rp-cli -e 'builder "implement user authentication"'
undefinedrp-cli -e 'builder "实现用户认证"'
undefinedWorkflow Shorthand Flags
工作流简写标记
bash
undefinedbash
undefinedQuick operations without -e syntax
无需-e语法的快速操作
rp-cli --workspace MyProject --select-set src/ --export-context ~/out.md
rp-cli --chat "How does auth work?"
rp-cli --builder "implement user authentication"
undefinedrp-cli --workspace MyProject --select-set src/ --export-context ~/out.md
rp-cli --chat "认证系统如何工作?"
rp-cli --builder "实现用户认证"
undefinedScript Files (.rp)
脚本文件(.rp)
For repeatable workflows, save commands to a script:
bash
undefined对于可重复执行的工作流,可将命令保存至脚本:
bash
undefineddaily-export.rp
daily-export.rp
workspace switch Frontend
select set src/components/
context --all > ~/exports/frontend.md
Run with:
```bash
rp-cli --exec-file ~/scripts/daily-export.rpworkspace switch Frontend
select set src/components/
context --all > ~/exports/frontend.md
运行方式:
```bash
rp-cli --exec-file ~/scripts/daily-export.rpCLI Flags
CLI标记
| Flag | Purpose |
|---|---|
| Execute command(s) |
| Target window ID |
| Quiet mode |
| Detailed help for command |
| Wait for connection (scripts) |
| 标记 | 用途 |
|---|---|
| 执行命令(多个) |
| 目标窗口ID |
| 静默模式 |
| 获取命令的详细帮助 |
| 等待连接(脚本场景) |
Async Operations (tmux)
异步操作(tmux)
For long-running operations like , use the async script:
builderbash
undefined对于这类耗时操作,可使用异步脚本:
builderbash
undefinedStart context builder async
启动上下文构建器异步任务
uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --task "understand the auth system"
--action start --task "understand the auth system"
uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --task "理解认证系统的工作原理"
--action start --task "理解认证系统的工作原理"
With workspace switch
切换工作区后执行
uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --workspace "MyProject" --task "explore API patterns"
--action start --workspace "MyProject" --task "explore API patterns"
uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --workspace "MyProject" --task "探索API模式"
--action start --workspace "MyProject" --task "探索API模式"
Check status
检查状态
uv run python -m runtime.harness scripts/repoprompt_async.py --action status
uv run python -m runtime.harness scripts/repoprompt_async.py --action status
Get result when done
任务完成后获取结果
uv run python -m runtime.harness scripts/repoprompt_async.py --action result
uv run python -m runtime.harness scripts/repoprompt_async.py --action result
Kill if needed
终止任务
uv run python -m runtime.harness scripts/repoprompt_async.py --action kill
undefineduv run python -m runtime.harness scripts/repoprompt_async.py --action kill
undefinedNote
注意事项
Requires RepoPrompt app running with MCP Server enabled.
需要在运行RepoPrompt应用并启用MCP服务器的前提下使用。