open-ralph-wiggum
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpen Ralph Wiggum
Open Ralph Wiggum
Open Ralph Wiggum () wraps any supported AI coding agent in an autonomous loop: it sends the same prompt on every iteration, and the agent self-corrects by observing the state of the repo. The loop ends when the agent outputs a configurable completion promise (e.g. ).
ralph<promise>COMPLETE</promise>Supported agents: Claude Code, OpenAI Codex, GitHub Copilot CLI, OpenCode (default).
Open Ralph Wiggum(简称)可将任何受支持的AI编码Agent封装在自主循环中:它会在每次迭代时发送相同的提示,Agent会通过观察代码仓库的状态进行自我修正。当Agent输出可配置的完成承诺(例如)时,循环终止。
ralph<promise>COMPLETE</promise>支持的Agent:Claude Code、OpenAI Codex、GitHub Copilot CLI、OpenCode(默认)。
Installation
安装
Prerequisites
前置条件
- Bun runtime
- At least one of these AI coding agent CLIs installed and authenticated:
- — Claude Code
claude - — OpenAI Codex CLI
codex - — GitHub Copilot CLI
copilot - — OpenCode
opencode
- Bun 运行时环境
- 已安装并认证至少一款以下AI编码Agent CLI:
- — Claude Code
claude - — OpenAI Codex CLI
codex - — GitHub Copilot CLI
copilot - — OpenCode
opencode
npm (recommended)
npm(推荐)
bash
npm install -g @th0rgal/ralph-wiggumbash
npm install -g @th0rgal/ralph-wiggumBun
Bun
bash
bun add -g @th0rgal/ralph-wiggumbash
bun add -g @th0rgal/ralph-wiggumFrom source (Linux/macOS)
从源码安装(Linux/macOS)
bash
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
./install.shbash
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
./install.shFrom source (Windows)
从源码安装(Windows)
powershell
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
.\install.ps1After installation, the command is available globally.
ralphpowershell
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
.\install.ps1安装完成后,命令将全局可用。
ralphQuick Start
快速开始
Always include a completion promise in your prompt — this is how ralph knows the task is done.
请始终在提示中包含完成承诺——这是ralph判断任务是否完成的依据。
OpenCode (default)
OpenCode(默认)
bash
ralph "Create a hello.txt file with 'Hello World'. Output <promise>DONE</promise> when complete." \
--max-iterations 5bash
ralph "Create a hello.txt file with 'Hello World'. Output <promise>DONE</promise> when complete." \
--max-iterations 5Claude Code
Claude Code
bash
ralph "Build a REST API with tests. Output <promise>COMPLETE</promise> when all tests pass." \
--agent claude-code --model claude-sonnet-4 --max-iterations 20bash
ralph "Build a REST API with tests. Output <promise>COMPLETE</promise> when all tests pass." \
--agent claude-code --model claude-sonnet-4 --max-iterations 20Codex
Codex
bash
ralph "Refactor auth module, ensure all tests pass. Output <promise>COMPLETE</promise> when done." \
--agent codex --model gpt-5-codex --max-iterations 20bash
ralph "Refactor auth module, ensure all tests pass. Output <promise>COMPLETE</promise> when done." \
--agent codex --model gpt-5-codex --max-iterations 20Copilot CLI
Copilot CLI
bash
ralph "Implement login feature. Output <promise>COMPLETE</promise> when done." \
--agent copilot --max-iterations 15Requires GitHub Copilot subscription and prior authentication ( or env var).
copilot /loginGH_TOKENbash
ralph "Implement login feature. Output <promise>COMPLETE</promise> when done." \
--agent copilot --max-iterations 15需要GitHub Copilot订阅及预先认证(或设置环境变量)。
copilot /loginGH_TOKENChecking Available Agents and Models
查看可用Agent与模型
Before running ralph, verify which agents are installed and what models they support.
运行ralph前,请验证已安装哪些Agent以及它们支持的模型。
Check available models per agent
查看各Agent的可用模型
OpenCode — lists all configured providers and models:
bash
opencode modelsConfigure a default in :
~/.config/opencode/opencode.jsonjson
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-5"
}Claude Code — check version and available models:
bash
claude --versionCommon models: , ,
claude-opus-4claude-sonnet-4claude-haiku-4Codex — check version and available models:
bash
codex --versionCommon models: ,
gpt-5-codexo4-miniCopilot CLI — uses GitHub Copilot subscription; verify auth:
bash
copilot /status # shows login state and available modelsOpenCode — 列出所有已配置的提供商和模型:
bash
opencode models可在中配置默认模型:
~/.config/opencode/opencode.jsonjson
{
"$schema": "https://opencode.ai/config.json",
"model": "anthropic/claude-sonnet-4-5"
}Claude Code — 查看版本及可用模型:
bash
claude --version常见模型:、、
claude-opus-4claude-sonnet-4claude-haiku-4Codex — 查看版本及可用模型:
bash
codex --version常见模型:、
gpt-5-codexo4-miniCopilot CLI — 使用GitHub Copilot订阅;验证认证状态:
bash
copilot /status # 显示登录状态及可用模型If not logged in:
若未登录:
copilot /login
copilot /login
Or set env var:
或设置环境变量:
export GH_TOKEN=your_token
undefinedexport GH_TOKEN=your_token
undefinedQuick environment check (Linux/macOS)
快速环境检查(Linux/macOS)
bash
for bin in opencode claude codex copilot; do
if command -v "$bin" &>/dev/null; then echo "✅ $bin: $(which $bin)"; else echo "❌ $bin: not found"; fi
done && \
[[ -n "$GH_TOKEN" ]] && echo "✅ GH_TOKEN set (Copilot CLI)" || echo "ℹ️ GH_TOKEN not set (needed only for Copilot CLI)"bash
for bin in opencode claude codex copilot; do
if command -v "$bin" &>/dev/null; then echo "✅ $bin: $(which $bin)"; else echo "❌ $bin: not found"; fi
done && \
[[ -n "$GH_TOKEN" ]] && echo "✅ GH_TOKEN set (Copilot CLI)" || echo "ℹ️ GH_TOKEN not set (needed only for Copilot CLI)"Agent Selection
Agent选择
| Agent | | Binary | Env override |
|---|---|---|---|
| OpenCode (default) | | | |
| Claude Code | | | |
| OpenAI Codex | | | |
| Copilot CLI | | | |
Use environment variables to point to a custom binary path if the CLI is not on .
$PATH| Agent | | 二进制文件 | 环境变量覆盖 |
|---|---|---|---|
| OpenCode(默认) | | | |
| Claude Code | | | |
| OpenAI Codex | | | |
| Copilot CLI | | | |
若CLI不在中,可使用环境变量指定自定义二进制文件路径。
$PATHKey Options
核心参数
--agent AGENT Agent to use (opencode|claude-code|codex|copilot)
--model MODEL Model name (agent-specific, e.g. claude-sonnet-4, gpt-5-codex)
--max-iterations N Stop after N iterations (always set this as a safety net)
--min-iterations N Require at least N iterations before allowing completion (default: 1)
--completion-promise T Text that signals task completion (default: COMPLETE)
--abort-promise TEXT Text that signals early abort/precondition failure
--tasks / -t Enable Tasks Mode (structured multi-task tracking)
--prompt-file / -f PATH Read prompt from a file instead of CLI argument
--prompt-template PATH Use a custom Mustache-style prompt template
--no-commit Skip git auto-commit after each iteration
--no-plugins Disable OpenCode plugins (useful to avoid plugin conflicts)
--allow-all Auto-approve all tool permission prompts (default: on)
--status Show live loop status from another terminal
--add-context TEXT Inject a hint for the next iteration without stopping the loop
--clear-context Remove pending context
--list-tasks List current tasks (Tasks Mode)
--add-task TEXT Add a task (Tasks Mode)
--remove-task N Remove task by index (Tasks Mode)
--rotation LIST Cycle through agent/model pairs each iteration (comma-separated agent:model)
--verbose-tools Print every tool line (disable compact tool summary)
--last-activity-timeout DURATION Kill and restart iteration after inactivity (e.g., 30m, 1h)
--no-questions Disable interactive question handling (agent will loop on questions)
--task-promise T Text that signals task completion (default: READY_FOR_NEXT_TASK)
--no-stream Buffer agent output and print at the end
--no-allow-all Require interactive permission prompts
--config PATH Use custom agent config file
--init-config [PATH] Write default agent config to PATH and exit
--questions Enable interactive question handling (default: enabled)--agent AGENT 使用的Agent(opencode|claude-code|codex|copilot)
--model MODEL 模型名称(Agent专属,例如claude-sonnet-4、gpt-5-codex)
--max-iterations N 迭代N次后停止(请始终设置此参数作为安全保障)
--min-iterations N 要求至少完成N次迭代后才可结束(默认值:1)
--completion-promise T 标记任务完成的文本(默认值:COMPLETE)
--abort-promise TEXT 标记提前终止/前置条件失败的文本
--tasks / -t 启用任务模式(结构化多任务跟踪)
--prompt-file / -f PATH 从文件读取提示,而非CLI参数
--prompt-template PATH 使用自定义Mustache风格的提示模板
--no-commit 跳过每次迭代后的git自动提交
--no-plugins 禁用OpenCode插件(有助于避免插件冲突)
--allow-all 自动批准所有工具权限提示(默认开启)
--status 在另一个终端中显示实时循环状态
--add-context TEXT 在不停止循环的情况下,为下一次迭代注入提示信息
--clear-context 清除待处理的上下文信息
--list-tasks 列出当前任务(任务模式)
--add-task TEXT 添加任务(任务模式)
--remove-task N 根据索引删除任务(任务模式)
--rotation LIST 每次迭代循环切换Agent/模型组合(以逗号分隔的agent:model条目)
--verbose-tools 打印所有工具输出行(禁用紧凑的工具摘要)
--last-activity-timeout DURATION 长时间无活动后终止并重启迭代(例如30m、1h)
--no-questions 禁用交互式问题处理(Agent会在问题处循环)
--task-promise T 标记任务完成的文本(默认值:READY_FOR_NEXT_TASK)
--no-stream 缓存Agent输出并在结束时打印
--no-allow-all 需要交互式权限提示
--config PATH 使用自定义Agent配置文件
--init-config [PATH] 将默认Agent配置写入指定路径后退出
--questions 启用交互式问题处理(默认开启)IDE Integration
IDE集成
Ralph is a terminal CLI tool that runs inside any IDE's integrated terminal.
Ralph是一款终端CLI工具,可在任何IDE的集成终端中运行。
VS Code / Cursor
VS Code / Cursor
-
Open the integrated terminal (or
Ctrl+``).View → Terminal -
Run ralph from your project root using the agent of your choice:OpenCode:bash
ralph "Your task. Output <promise>COMPLETE</promise> when done." --max-iterations 20Claude Code:bashralph "Your task. Output <promise>COMPLETE</promise> when done." \ --agent claude-code --model claude-sonnet-4 --max-iterations 20Codex:bashralph "Your task. Output <promise>COMPLETE</promise> when done." \ --agent codex --model gpt-5-codex --max-iterations 20Copilot CLI:bashralph "Your task. Output <promise>COMPLETE</promise> when done." \ --agent copilot --max-iterations 20Note:uses the standalone Copilot CLI, not the VS Code extension. Both can be active at the same time.--agent copilot -
Open a second terminal tab to monitor while the loop runs:bash
ralph --status -
Inject hints mid-loop from the second terminal:bash
ralph --add-context "Focus on fixing the auth module first"
-
打开集成终端(或
Ctrl+``)。View → Terminal -
在项目根目录运行ralph,选择你需要的Agent:OpenCode:bash
ralph "Your task. Output <promise>COMPLETE</promise> when done." --max-iterations 20Claude Code:bashralph "Your task. Output <promise>COMPLETE</promise> when done." \ --agent claude-code --model claude-sonnet-4 --max-iterations 20Codex:bashralph "Your task. Output <promise>COMPLETE</promise> when done." \ --agent codex --model gpt-5-codex --max-iterations 20Copilot CLI:bashralph "Your task. Output <promise>COMPLETE</promise> when done." \ --agent copilot --max-iterations 20注意:使用独立的Copilot CLI,而非VS Code扩展。两者可同时激活。--agent copilot -
打开第二个终端标签页以监控循环运行状态:bash
ralph --status -
在第二个终端中为循环注入提示信息:bash
ralph --add-context "Focus on fixing the auth module first"
JetBrains IDEs (IntelliJ, WebStorm, PyCharm, etc.)
JetBrains IDE(IntelliJ、WebStorm、PyCharm等)
- Open the integrated terminal ().
Alt+F12 - Run the same agent-specific commands as above.
- Use Run Configurations → Shell Script to save common ralph invocations per agent as reusable run configurations.
- 打开集成终端()。
Alt+F12 - 运行上述对应Agent的命令。
- 使用运行配置 → Shell脚本,将常用的ralph调用保存为可复用的运行配置。
Neovim / Vim
Neovim / Vim
Run ralph in a split terminal. Examples per agent:
OpenCode:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --max-iterations 20Claude Code:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent claude-code --model claude-sonnet-4 --max-iterations 20Codex:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent codex --model gpt-5-codex --max-iterations 20Copilot CLI:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent copilot --max-iterations 20Or use a plugin like for a persistent terminal.
toggleterm.nvim在分屏终端中运行ralph。各Agent示例:
OpenCode:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --max-iterations 20Claude Code:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent claude-code --model claude-sonnet-4 --max-iterations 20Codex:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent codex --model gpt-5-codex --max-iterations 20Copilot CLI:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent copilot --max-iterations 20或使用等插件实现持久化终端。
toggleterm.nvimAny IDE — Prompt File Workflow
任意IDE — 提示文件工作流
For complex prompts, save them as a file to avoid shell escaping issues and make prompts versionable.
OpenCode:
bash
ralph --prompt-file ./task.md --max-iterations 30Claude Code:
bash
ralph --prompt-file ./task.md --agent claude-code --model claude-sonnet-4 --max-iterations 30Codex:
bash
ralph --prompt-file ./task.md --agent codex --model gpt-5-codex --max-iterations 30Copilot CLI:
bash
ralph --prompt-file ./task.md --agent copilot --max-iterations 30对于复杂提示,可将其保存为文件,避免Shell转义问题,并让提示可版本控制。
OpenCode:
bash
ralph --prompt-file ./task.md --max-iterations 30Claude Code:
bash
ralph --prompt-file ./task.md --agent claude-code --model claude-sonnet-4 --max-iterations 30Codex:
bash
ralph --prompt-file ./task.md --agent codex --model gpt-5-codex --max-iterations 30Copilot CLI:
bash
ralph --prompt-file ./task.md --agent copilot --max-iterations 30Tasks Mode
任务模式
Break large projects into a tracked task list:
bash
undefined将大型项目拆分为可跟踪的任务列表:
bash
undefinedStart a loop in Tasks Mode
在任务模式下启动循环
ralph "Build a full-stack app" --tasks --max-iterations 50
ralph "Build a full-stack app" --tasks --max-iterations 50
Manage tasks while the loop is idle (or before starting)
在循环空闲时(或启动前)管理任务
ralph --add-task "Set up database schema"
ralph --add-task "Implement REST API"
ralph --list-tasks
ralph --remove-task 2
Tasks are stored in `.ralph/ralph-tasks.md`. Each task uses one loop iteration, signaled by `<promise>READY_FOR_NEXT_TASK</promise>`.
---ralph --add-task "Set up database schema"
ralph --add-task "Implement REST API"
ralph --list-tasks
ralph --remove-task 2
任务存储在`.ralph/ralph-tasks.md`中。每个任务使用一次循环迭代,通过`<promise>READY_FOR_NEXT_TASK</promise>`标记完成。
---Monitoring a Running Loop
监控运行中的循环
From a second terminal in the same project directory:
bash
ralph --status # Shows iteration progress, history, struggle indicators
ralph --add-context "The bug is in utils/parser.ts line 42" # Guide the agent
ralph --clear-context # Remove queued hintThe status dashboard shows iteration count, time elapsed, tool usage per iteration, and struggle warnings (e.g., no file changes in N iterations).
The output includes:
--status- Active loop info: iteration, elapsed time, prompt, rotation position (if using )
--rotation - Pending context: hints queued for next iteration
- Iteration history: last 5 iterations with agent/model, tool usage, duration
- Struggle indicators: warnings if no file changes in N iterations
在同一项目目录的第二个终端中:
bash
ralph --status # 显示迭代进度、历史记录、卡顿提示
ralph --add-context "The bug is in utils/parser.ts line 42" # 引导Agent
ralph --clear-context # 清除待处理的提示信息状态仪表盘显示迭代次数、耗时、每次迭代的工具使用情况,以及卡顿警告(例如连续N次迭代无文件变更)。
--status- 活跃循环信息:迭代次数、耗时、提示内容、轮换位置(若使用)
--rotation - 待处理上下文:为下一次迭代排队的提示信息
- 迭代历史:最近5次迭代的Agent/模型、工具使用情况、耗时
- 卡顿提示:连续N次迭代无文件变更时发出警告
Writing Effective Prompts
编写有效的提示
Bad prompt (no verifiable criteria):
Build a todo APIGood prompt (verifiable, with completion promise):
Build a REST API for todos with:
- CRUD endpoints (GET, POST, PUT, DELETE)
- Input validation
- Tests for each endpoint
Run tests after each change.
Output <promise>COMPLETE</promise> when all tests pass.Rules of thumb:
- Include explicit success criteria (tests passing, linter clean, files present)
- Always include a completion promise tag that the agent must output
- Set as a safety net (20–50 is a common range)
--max-iterations - For complex projects, use or a
--tasks--prompt-file
糟糕的提示(无可验证标准):
Build a todo API优秀的提示(可验证,包含完成承诺):
Build a REST API for todos with:
- CRUD endpoints (GET, POST, PUT, DELETE)
- Input validation
- Tests for each endpoint
Run tests after each change.
Output <promise>COMPLETE</promise> when all tests pass.经验法则:
- 包含明确的成功标准(测试通过、代码检查干净、文件存在)
- 始终包含完成承诺标签,要求Agent必须输出
- 设置作为安全保障(20–50是常见范围)
--max-iterations - 对于复杂项目,使用或
--tasks--prompt-file
Custom Prompt Templates
自定义提示模板
Create a Markdown template with Mustache-style variables:
markdown
undefined创建带有Mustache风格变量的Markdown模板:
markdown
undefinedIteration {{iteration}} / {{max_iterations}}
Iteration {{iteration}} / {{max_iterations}}
Task
Task
{{prompt}}
{{prompt}}
Instructions
Instructions
Check git history to see what was tried. Fix what failed.
Output <promise>{{completion_promise}}</promise> when done.
{{context}}
Available variables: `{{iteration}}`, `{{max_iterations}}`, `{{min_iterations}}`, `{{prompt}}`, `{{completion_promise}}`, `{{abort_promise}}`, `{{task_promise}}`, `{{context}}`, `{{tasks}}`.
Use with:
```bash
ralph "Your task" --prompt-template ./my-template.mdCheck git history to see what was tried. Fix what failed.
Output <promise>{{completion_promise}}</promise> when done.
{{context}}
可用变量:`{{iteration}}`、`{{max_iterations}}`、`{{min_iterations}}`、`{{prompt}}`、`{{completion_promise}}`、`{{abort_promise}}`、`{{task_promise}}`、`{{context}}`、`{{tasks}}`。
使用方式:
```bash
ralph "Your task" --prompt-template ./my-template.mdAgent Rotation
Agent轮换
Cycle through different agent/model combinations across iterations:
bash
undefined在迭代中循环切换不同的Agent/模型组合:
bash
undefinedAlternate between OpenCode and Claude Code
在OpenCode和Claude Code之间交替
ralph "Build a REST API"
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4"
--max-iterations 10
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4"
--max-iterations 10
ralph "Build a REST API"
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4"
--max-iterations 10
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4"
--max-iterations 10
Three-way rotation
三方轮换
ralph "Refactor the auth module"
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4,codex:gpt-5-codex"
--max-iterations 15
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4,codex:gpt-5-codex"
--max-iterations 15
Format: `agent:model` entries separated by commas. When `--rotation` is set, `--agent` and `--model` are ignored. The list cycles (iteration 3 of a 2-entry rotation goes back to entry 1).
---ralph "Refactor the auth module"
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4,codex:gpt-5-codex"
--max-iterations 15
--rotation "opencode:claude-sonnet-4,claude-code:claude-sonnet-4,codex:gpt-5-codex"
--max-iterations 15
格式:以逗号分隔的`agent:model`条目。设置`--rotation`后,`--agent`和`--model`参数将被忽略。列表会循环(2条目的轮换中,第3次迭代会回到第1条)。
---Agent-Specific Notes
Agent专属说明
OpenCode (default)
OpenCode(默认)
- Default model can be set in :
~/.config/opencode/opencode.jsonjson{ "$schema": "https://opencode.ai/config.json", "model": "your-provider/model-name" } - Use if OpenCode tries to load a
--no-pluginsplugin.ralph-wiggum
- 可在中设置默认模型:
~/.config/opencode/opencode.jsonjson{ "$schema": "https://opencode.ai/config.json", "model": "your-provider/model-name" } - 若OpenCode尝试加载插件,可使用
ralph-wiggum参数。--no-plugins
Claude Code
Claude Code
bash
ralph "Refactor the auth module and ensure tests pass" \
--agent claude-code --model claude-sonnet-4 --max-iterations 15bash
ralph "Refactor the auth module and ensure tests pass" \
--agent claude-code --model claude-sonnet-4 --max-iterations 15OpenAI Codex
OpenAI Codex
bash
ralph "Generate unit tests for all utility functions" \
--agent codex --model gpt-5-codex --max-iterations 10bash
ralph "Generate unit tests for all utility functions" \
--agent codex --model gpt-5-codex --max-iterations 10Copilot CLI
Copilot CLI
Requires a GitHub Copilot subscription. Authenticate before running:
bash
copilot /login # or set GH_TOKEN / GITHUB_TOKEN env varInstall:
bash
npm install -g @github/copilot需要GitHub Copilot订阅。运行前请先认证:
bash
copilot /login # 或设置GH_TOKEN / GITHUB_TOKEN环境变量安装方式:
bash
npm install -g @github/copilotor
或
brew install copilot-cli
Usage:
```bash
ralph "Refactor the auth module and add tests" \
--agent copilot --max-iterations 15brew install copilot-cli
使用方式:
```bash
ralph "Refactor the auth module and add tests" \
--agent copilot --max-iterations 15With a specific model
使用指定模型
ralph "Build a REST API"
--agent copilot --model claude-opus-4.6 --max-iterations 10
--agent copilot --model claude-opus-4.6 --max-iterations 10
Notes:
- Default model is Claude Sonnet 4.5; override with `--model`
- `--no-plugins` has no effect with Copilot CLI
- `--allow-all` (default) maps to `--allow-all` + `--no-ask-user` in Copilot CLI
---
---ralph "Build a REST API"
--agent copilot --model claude-opus-4.6 --max-iterations 10
--agent copilot --model claude-opus-4.6 --max-iterations 10
注意事项:
- 默认模型为Claude Sonnet 4.5;可通过`--model`参数覆盖
- `--no-plugins`参数对Copilot CLI无效
- `--allow-all`(默认开启)对应Copilot CLI中的`--allow-all` + `--no-ask-user`参数
---
---When to Use Ralph
何时使用Ralph
Good for:
- Tasks with automatic verification (tests, linters, type checking)
- Well-defined tasks with clear completion criteria
- Greenfield projects where you can walk away
- Iterative refinement (getting tests to pass)
Not good for:
- Tasks requiring human judgment
- One-shot operations
- Unclear success criteria
- Production debugging
适用场景:
- 带有自动验证的任务(测试、代码检查、类型检查)
- 定义明确、完成标准清晰的任务
- 可放手处理的全新项目
- 迭代优化(确保测试通过)
不适用场景:
- 需要人工判断的任务
- 一次性操作
- 成功标准不明确的任务
- 生产环境调试
Recommended PRD Format
推荐PRD格式
For complex tasks, pass a prompt file with . Use this structure:
--prompt-file- Goal: one sentence summary of the desired outcome
- Scope: what is in/out
- Requirements: numbered, testable items
- Constraints: tech stack, performance, security, compatibility
- Acceptance criteria: explicit success checks
- Completion promise:
<promise>COMPLETE</promise>
For larger projects, a JSON feature list reduces the chance of agents modifying test definitions:
json
{
"features": [
{
"category": "functional",
"description": "Feature description",
"steps": ["Step 1", "Step 2"],
"passes": false
}
]
}Reference it in your prompt:
Read features.json. Work through each feature. Update "passes" to true when verified. Output <promise>COMPLETE</promise> when all pass.对于复杂任务,使用传递提示文件。建议使用以下结构:
--prompt-file- 目标:一句话总结期望结果
- 范围:包含/排除的内容
- 需求:可测试的编号条目
- 约束:技术栈、性能、安全、兼容性要求
- 验收标准:明确的成功检查项
- 完成承诺:
<promise>COMPLETE</promise>
对于大型项目,使用JSON功能列表可降低Agent修改测试定义的概率:
json
{
"features": [
{
"category": "functional",
"description": "Feature description",
"steps": ["Step 1", "Step 2"],
"passes": false
}
]
}在提示中引用:
Read features.json. Work through each feature. Update "passes" to true when verified. Output <promise>COMPLETE</promise> when all pass.Troubleshooting
故障排除
| Symptom | Fix |
|---|---|
| Install Bun: |
| Re-run install, or check |
| Set a default model in |
| Plugin conflicts (OpenCode) | Run with |
| Windows "command not found" | Set |
| Agent loops on a question | Either answer interactively or use |
| Loop never terminates | Check your prompt includes the completion promise tag; reduce |
| 症状 | 解决方案 |
|---|---|
| 安装Bun: |
| 重新运行安装命令,或检查 |
| 在 |
| 插件冲突(OpenCode) | 使用 |
| Windows下“命令未找到” | 设置 |
| Agent在问题处循环 | 要么交互式回答问题,要么使用 |
| 循环永不终止 | 检查提示是否包含完成承诺标签;降低 |
Uninstall
卸载
bash
npm uninstall -g @th0rgal/ralph-wiggumbash
npm uninstall -g @th0rgal/ralph-wiggum