repoprompt

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

RepoPrompt 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:
  • structure
    → signatures only (not full content)
  • read --start-line --limit
    → slices instead of full files
  • search --context-lines
    → relevant matches with context
RepoPrompt 比直接读取文件更节省Token
  • structure
    → 仅返回签名(而非完整内容)
  • read --start-line --limit
    → 读取片段而非完整文件
  • search --context-lines
    → 返回带上下文的相关匹配结果

CLI Usage

CLI使用方法

bash
undefined
bash
undefined

If 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'
undefined
repoprompt_cli -e 'command'
undefined

Commands Reference

命令参考

File Tree

文件树

bash
undefined
bash
undefined

Full 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'
undefined
rp-cli -e 'tree --mode selected'
undefined

Code Structure (Codemaps) - TOKEN EFFICIENT

代码结构(代码映射)- 节省Token

bash
undefined
bash
undefined

Structure 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'
undefined
rp-cli -e 'structure src/ --max-results 10'
undefined

Search

搜索

bash
undefined
bash
undefined

Basic 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'
undefined
rp-cli -e 'search "function" --max-results 20'
undefined

Read Files - TOKEN EFFICIENT

读取文件 - 节省Token

bash
undefined
bash
undefined

Full 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'
undefined
rp-cli -e 'read path/to/file.ts --start-line -20'
undefined

Selection Management

选中项管理

bash
undefined
bash
undefined

Add 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'
undefined
rp-cli -e 'select get'
undefined

Workspace Context

工作区上下文

bash
undefined
bash
undefined

Get full context

获取完整上下文

rp-cli -e 'context'
rp-cli -e 'context'

Specific includes

指定包含内容

rp-cli -e 'context --include prompt,selection,tree'
undefined
rp-cli -e 'context --include prompt,selection,tree'
undefined

Chain Commands

链式命令

bash
undefined
bash
undefined

Multiple operations

多步操作

rp-cli -e 'select set src/auth/ && structure --scope selected && context'
undefined
rp-cli -e 'select set src/auth/ && structure --scope selected && context'
undefined

Workspaces

工作区

bash
undefined
bash
undefined

List 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"'
undefined
rp-cli -e 'workspace switch "ProjectName"'
undefined

AI Chat (uses RepoPrompt's models)

AI聊天(使用RepoPrompt的模型)

bash
undefined
bash
undefined

Send 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'
undefined
rp-cli -e 'chat "设计一个新功能" --mode plan'
undefined

Context Builder (AI-powered file selection)

上下文构建器(AI驱动的文件选中)

bash
undefined
bash
undefined

Auto-select relevant files for a task

为任务自动选择相关文件

rp-cli -e 'builder "implement user authentication"'
undefined
rp-cli -e 'builder "实现用户认证"'
undefined

Workflow Shorthand Flags

工作流简写标记

bash
undefined
bash
undefined

Quick 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"
undefined
rp-cli --workspace MyProject --select-set src/ --export-context ~/out.md rp-cli --chat "认证系统如何工作?" rp-cli --builder "实现用户认证"
undefined

Script Files (.rp)

脚本文件(.rp)

For repeatable workflows, save commands to a script:
bash
undefined
对于可重复执行的工作流,可将命令保存至脚本:
bash
undefined

daily-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.rp
workspace switch Frontend select set src/components/ context --all > ~/exports/frontend.md

运行方式:
```bash
rp-cli --exec-file ~/scripts/daily-export.rp

CLI Flags

CLI标记

FlagPurpose
-e 'cmd'
Execute command(s)
-w <id>
Target window ID
-q
Quiet mode
-d <cmd>
Detailed help for command
--wait-for-server 5
Wait for connection (scripts)
标记用途
-e 'cmd'
执行命令(多个)
-w <id>
目标窗口ID
-q
静默模式
-d <cmd>
获取命令的详细帮助
--wait-for-server 5
等待连接(脚本场景)

Async Operations (tmux)

异步操作(tmux)

For long-running operations like
builder
, use the async script:
bash
undefined
对于
builder
这类耗时操作,可使用异步脚本:
bash
undefined

Start context builder async

启动上下文构建器异步任务

uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --task "understand the auth system"
uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --task "理解认证系统的工作原理"

With workspace switch

切换工作区后执行

uv run python -m runtime.harness scripts/repoprompt_async.py
--action start --workspace "MyProject" --task "explore API patterns"
uv run python -m runtime.harness scripts/repoprompt_async.py
--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
undefined
uv run python -m runtime.harness scripts/repoprompt_async.py --action kill
undefined

Note

注意事项

Requires RepoPrompt app running with MCP Server enabled.
需要在运行RepoPrompt应用并启用MCP服务器的前提下使用。