open-ralph-wiggum

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Open Ralph Wiggum

Open Ralph Wiggum

Open Ralph Wiggum (
ralph
) 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.
<promise>COMPLETE</promise>
).
Supported agents: Claude Code, OpenAI Codex, GitHub Copilot CLI, OpenCode (default).

Open Ralph Wiggum(简称
ralph
)可将任何受支持的AI编码Agent封装在自主循环中:它会在每次迭代时发送相同的提示,Agent会通过观察代码仓库的状态进行自我修正。当Agent输出可配置的完成承诺(例如
<promise>COMPLETE</promise>
)时,循环终止。
支持的Agent:Claude CodeOpenAI CodexGitHub Copilot CLIOpenCode(默认)。

Installation

安装

Prerequisites

前置条件

npm (recommended)

npm(推荐)

bash
npm install -g @th0rgal/ralph-wiggum
bash
npm install -g @th0rgal/ralph-wiggum

Bun

Bun

bash
bun add -g @th0rgal/ralph-wiggum
bash
bun add -g @th0rgal/ralph-wiggum

From source (Linux/macOS)

从源码安装(Linux/macOS)

bash
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
./install.sh
bash
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
./install.sh

From source (Windows)

从源码安装(Windows)

powershell
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
.\install.ps1
After installation, the
ralph
command is available globally.

powershell
git clone https://github.com/Th0rgal/open-ralph-wiggum
cd open-ralph-wiggum
.\install.ps1
安装完成后,
ralph
命令将全局可用。

Quick 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 5
bash
ralph "Create a hello.txt file with 'Hello World'. Output <promise>DONE</promise> when complete." \
  --max-iterations 5

Claude 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 20
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 20

Codex

Codex

bash
ralph "Refactor auth module, ensure all tests pass. Output <promise>COMPLETE</promise> when done." \
  --agent codex --model gpt-5-codex --max-iterations 20
bash
ralph "Refactor auth module, ensure all tests pass. Output <promise>COMPLETE</promise> when done." \
  --agent codex --model gpt-5-codex --max-iterations 20

Copilot CLI

Copilot CLI

bash
ralph "Implement login feature. Output <promise>COMPLETE</promise> when done." \
  --agent copilot --max-iterations 15
Requires GitHub Copilot subscription and prior authentication (
copilot /login
or
GH_TOKEN
env var).

bash
ralph "Implement login feature. Output <promise>COMPLETE</promise> when done." \
  --agent copilot --max-iterations 15
需要GitHub Copilot订阅及预先认证(
copilot /login
或设置
GH_TOKEN
环境变量)。

Checking 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 models
Configure a default in
~/.config/opencode/opencode.json
:
json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "anthropic/claude-sonnet-4-5"
}
Claude Code — check version and available models:
bash
claude --version
Common models:
claude-opus-4
,
claude-sonnet-4
,
claude-haiku-4
Codex — check version and available models:
bash
codex --version
Common models:
gpt-5-codex
,
o4-mini
Copilot CLI — uses GitHub Copilot subscription; verify auth:
bash
copilot /status   # shows login state and available models
OpenCode — 列出所有已配置的提供商和模型:
bash
opencode models
可在
~/.config/opencode/opencode.json
中配置默认模型:
json
{
  "$schema": "https://opencode.ai/config.json",
  "model": "anthropic/claude-sonnet-4-5"
}
Claude Code — 查看版本及可用模型:
bash
claude --version
常见模型:
claude-opus-4
claude-sonnet-4
claude-haiku-4
Codex — 查看版本及可用模型:
bash
codex --version
常见模型:
gpt-5-codex
o4-mini
Copilot CLI — 使用GitHub Copilot订阅;验证认证状态:
bash
copilot /status   # 显示登录状态及可用模型

If not logged in:

若未登录:

copilot /login
copilot /login

Or set env var:

或设置环境变量:

export GH_TOKEN=your_token
undefined
export GH_TOKEN=your_token
undefined

Quick 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
--agent
flag
BinaryEnv override
OpenCode (default)
--agent opencode
opencode
RALPH_OPENCODE_BINARY
Claude Code
--agent claude-code
claude
RALPH_CLAUDE_BINARY
OpenAI Codex
--agent codex
codex
RALPH_CODEX_BINARY
Copilot CLI
--agent copilot
copilot
RALPH_COPILOT_BINARY
Use environment variables to point to a custom binary path if the CLI is not on
$PATH
.

Agent
--agent
参数
二进制文件环境变量覆盖
OpenCode(默认)
--agent opencode
opencode
RALPH_OPENCODE_BINARY
Claude Code
--agent claude-code
claude
RALPH_CLAUDE_BINARY
OpenAI Codex
--agent codex
codex
RALPH_CODEX_BINARY
Copilot CLI
--agent copilot
copilot
RALPH_COPILOT_BINARY
若CLI不在
$PATH
中,可使用环境变量指定自定义二进制文件路径。

Key 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

  1. Open the integrated terminal (
    Ctrl+`` 
    or
    View → Terminal
    ).
  2. 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 20
    Claude Code:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." \
      --agent claude-code --model claude-sonnet-4 --max-iterations 20
    Codex:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." \
      --agent codex --model gpt-5-codex --max-iterations 20
    Copilot CLI:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." \
      --agent copilot --max-iterations 20
    Note:
    --agent copilot
    uses the standalone Copilot CLI, not the VS Code extension. Both can be active at the same time.
  3. Open a second terminal tab to monitor while the loop runs:
    bash
    ralph --status
  4. Inject hints mid-loop from the second terminal:
    bash
    ralph --add-context "Focus on fixing the auth module first"
  1. 打开集成终端(
    Ctrl+`` 
    View → Terminal
    )。
  2. 在项目根目录运行ralph,选择你需要的Agent:
    OpenCode:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." --max-iterations 20
    Claude Code:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." \
      --agent claude-code --model claude-sonnet-4 --max-iterations 20
    Codex:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." \
      --agent codex --model gpt-5-codex --max-iterations 20
    Copilot CLI:
    bash
    ralph "Your task. Output <promise>COMPLETE</promise> when done." \
      --agent copilot --max-iterations 20
    注意:
    --agent copilot
    使用独立的Copilot CLI,而非VS Code扩展。两者可同时激活。
  3. 打开第二个终端标签页以监控循环运行状态:
    bash
    ralph --status
  4. 在第二个终端中为循环注入提示信息:
    bash
    ralph --add-context "Focus on fixing the auth module first"

JetBrains IDEs (IntelliJ, WebStorm, PyCharm, etc.)

JetBrains IDE(IntelliJ、WebStorm、PyCharm等)

  1. Open the integrated terminal (
    Alt+F12
    ).
  2. Run the same agent-specific commands as above.
  3. Use Run Configurations → Shell Script to save common ralph invocations per agent as reusable run configurations.
  1. 打开集成终端(
    Alt+F12
    )。
  2. 运行上述对应Agent的命令。
  3. 使用运行配置 → 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 20
Claude Code:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent claude-code --model claude-sonnet-4 --max-iterations 20
Codex:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent codex --model gpt-5-codex --max-iterations 20
Copilot CLI:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent copilot --max-iterations 20
Or use a plugin like
toggleterm.nvim
for a persistent terminal.
在分屏终端中运行ralph。各Agent示例:
OpenCode:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --max-iterations 20
Claude Code:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent claude-code --model claude-sonnet-4 --max-iterations 20
Codex:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent codex --model gpt-5-codex --max-iterations 20
Copilot CLI:
vim
:split | terminal ralph "Your task. Output <promise>COMPLETE</promise> when done." --agent copilot --max-iterations 20
或使用
toggleterm.nvim
等插件实现持久化终端。

Any 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 30
Claude Code:
bash
ralph --prompt-file ./task.md --agent claude-code --model claude-sonnet-4 --max-iterations 30
Codex:
bash
ralph --prompt-file ./task.md --agent codex --model gpt-5-codex --max-iterations 30
Copilot CLI:
bash
ralph --prompt-file ./task.md --agent copilot --max-iterations 30

对于复杂提示,可将其保存为文件,避免Shell转义问题,并让提示可版本控制。
OpenCode:
bash
ralph --prompt-file ./task.md --max-iterations 30
Claude Code:
bash
ralph --prompt-file ./task.md --agent claude-code --model claude-sonnet-4 --max-iterations 30
Codex:
bash
ralph --prompt-file ./task.md --agent codex --model gpt-5-codex --max-iterations 30
Copilot CLI:
bash
ralph --prompt-file ./task.md --agent copilot --max-iterations 30

Tasks Mode

任务模式

Break large projects into a tracked task list:
bash
undefined
将大型项目拆分为可跟踪的任务列表:
bash
undefined

Start 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 hint
The status dashboard shows iteration count, time elapsed, tool usage per iteration, and struggle warnings (e.g., no file changes in N iterations).
The
--status
output includes:
  • 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 API
Good 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
    --max-iterations
    as a safety net (20–50 is a common range)
  • For complex projects, use
    --tasks
    or a
    --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必须输出
  • 设置
    --max-iterations
    作为安全保障(20–50是常见范围)
  • 对于复杂项目,使用
    --tasks
    --prompt-file

Custom Prompt Templates

自定义提示模板

Create a Markdown template with Mustache-style variables:
markdown
undefined
创建带有Mustache风格变量的Markdown模板:
markdown
undefined

Iteration {{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.md

Check 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.md

Agent Rotation

Agent轮换

Cycle through different agent/model combinations across iterations:
bash
undefined
在迭代中循环切换不同的Agent/模型组合:
bash
undefined

Alternate 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
ralph "Build a REST API"
--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

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

格式:以逗号分隔的`agent:model`条目。设置`--rotation`后,`--agent`和`--model`参数将被忽略。列表会循环(2条目的轮换中,第3次迭代会回到第1条)。

---

Agent-Specific Notes

Agent专属说明

OpenCode (default)

OpenCode(默认)

  • Default model can be set in
    ~/.config/opencode/opencode.json
    :
    json
    {
      "$schema": "https://opencode.ai/config.json",
      "model": "your-provider/model-name"
    }
  • Use
    --no-plugins
    if OpenCode tries to load a
    ralph-wiggum
    plugin.
  • 可在
    ~/.config/opencode/opencode.json
    中设置默认模型:
    json
    {
      "$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 15
bash
ralph "Refactor the auth module and ensure tests pass" \
  --agent claude-code --model claude-sonnet-4 --max-iterations 15

OpenAI Codex

OpenAI Codex

bash
ralph "Generate unit tests for all utility functions" \
  --agent codex --model gpt-5-codex --max-iterations 10
bash
ralph "Generate unit tests for all utility functions" \
  --agent codex --model gpt-5-codex --max-iterations 10

Copilot CLI

Copilot CLI

Requires a GitHub Copilot subscription. Authenticate before running:
bash
copilot /login   # or set GH_TOKEN / GITHUB_TOKEN env var
Install:
bash
npm install -g @github/copilot
需要GitHub Copilot订阅。运行前请先认证:
bash
copilot /login   # 或设置GH_TOKEN / GITHUB_TOKEN环境变量
安装方式:
bash
npm install -g @github/copilot

or

brew install copilot-cli

Usage:

```bash
ralph "Refactor the auth module and add tests" \
  --agent copilot --max-iterations 15
brew install copilot-cli

使用方式:

```bash
ralph "Refactor the auth module and add tests" \
  --agent copilot --max-iterations 15

With a specific model

使用指定模型

ralph "Build a REST API"
--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

注意事项:

- 默认模型为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
--prompt-file
. Use this structure:
  • 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

故障排除

SymptomFix
bun: command not found
Install Bun:
curl -fsSL https://bun.sh/install | bash
command not found: ralph
Re-run install, or check
$PATH
includes npm/bun global bin
ProviderModelNotFoundError
Set a default model in
~/.config/opencode/opencode.json
or pass
--model
Plugin conflicts (OpenCode)Run with
--no-plugins
Windows "command not found"Set
$env:RALPH_<AGENT>_BINARY
to the full
.cmd
path
Agent loops on a questionEither answer interactively or use
--no-questions
Loop never terminatesCheck your prompt includes the completion promise tag; reduce
--max-iterations

症状解决方案
bun: command not found
安装Bun:
curl -fsSL https://bun.sh/install | bash
command not found: ralph
重新运行安装命令,或检查
$PATH
是否包含npm/bun全局bin目录
ProviderModelNotFoundError
~/.config/opencode/opencode.json
中设置默认模型,或传递
--model
参数
插件冲突(OpenCode)使用
--no-plugins
参数运行
Windows下“命令未找到”设置
$env:RALPH_<AGENT>_BINARY
为完整的
.cmd
路径
Agent在问题处循环要么交互式回答问题,要么使用
--no-questions
参数
循环永不终止检查提示是否包含完成承诺标签;降低
--max-iterations
参数值

Uninstall

卸载

bash
npm uninstall -g @th0rgal/ralph-wiggum
bash
npm uninstall -g @th0rgal/ralph-wiggum