Autonomous AI coding loop. Runs AI agents on tasks until done.
Option A: npm (recommended)
npm install -g ralphy-cli
# Then use anywhere
ralphy "add login button"
ralphy --prd PRD.mdOption B: Clone
git clone https://github.com/michaelshimeles/ralphy.git
cd ralphy && chmod +x ralphy.sh
./ralphy.sh "add login button"
./ralphy.sh --prd PRD.mdBoth versions have identical features. Examples below use ralphy (npm) - substitute ./ralphy.sh if using the bash script.
Single task - just tell it what to do:
ralphy "add dark mode"
ralphy "fix the auth bug"Task list - work through a PRD:
ralphy # uses PRD.md
ralphy --prd tasks.mdOptional. Stores rules the AI must follow.
ralphy --init # auto-detects project settings
ralphy --config # view config
ralphy --add-rule "use TypeScript strict mode"Creates .ralphy/config.yaml:
project:
name: "my-app"language: "TypeScript"framework: "Next.js"commands:
test: "npm test"lint: "npm run lint"build: "npm run build"rules:
- "use server actions not API routes"
- "follow error pattern in src/utils/errors.ts"boundaries:
never_touch:
- "src/legacy/**"
- "*.lock"Rules apply to all tasks (single or PRD).
ralphy # Claude Code (default)
ralphy --opencode # OpenCode
ralphy --cursor # Cursor
ralphy --codex # Codex
ralphy --qwen # Qwen-Code
ralphy --droid # Factory DroidOverride the default model for any engine:
ralphy --model sonnet "add feature"# use sonnet with Claude
ralphy --sonnet "add feature"# shortcut for above
ralphy --opencode --model opencode/glm-4.7-free "task"# custom OpenCode model
ralphy --qwen --model qwen-max "build api"# custom Qwen modelMarkdown file (default):
ralphy --prd PRD.md## Tasks-[ ] create auth
-[ ] add dashboard
-[x] done task (skipped)Markdown folder (for large projects):
ralphy --prd ./prd/When pointing to a folder, Ralphy reads all .md files and aggregates tasks:
prd/
backend.md # - [ ] create user API
frontend.md # - [ ] add login page
infra.md # - [ ] setup CI/CD
Tasks are tracked per-file so completion updates the correct file.
YAML:
ralphy --yaml tasks.yamltasks:
- title: create authcompleted: false
- title: add dashboardcompleted: falseGitHub Issues:
ralphy --github owner/repo
ralphy --github owner/repo --github-label "ready"ralphy --parallel # 3 agents default
ralphy --parallel --max-parallel 5 # 5 agentsEach agent gets isolated worktree + branch:
Agent 1 → /tmp/xxx/agent-1 → ralphy/agent-1-create-auth
Agent 2 → /tmp/xxx/agent-2 → ralphy/agent-2-add-dashboard
Agent 3 → /tmp/xxx/agent-3 → ralphy/agent-3-build-api
Without --create-pr: auto-merges back to base branch, AI resolves conflicts.
With --create-pr: keeps branches, creates PRs.
With --no-merge: keeps branches without merging or creating PRs.
YAML parallel groups - control execution order:
tasks:
- title: Create User modelparallel_group: 1
- title: Create Post modelparallel_group: 1# same group = runs together
- title: Add relationshipsparallel_group: 2# runs after group 1ralphy --branch-per-task # branch per task
ralphy --branch-per-task --create-pr # + create PRs
ralphy --branch-per-task --draft-pr # + draft PRs
ralphy --base-branch main # branch from mainBranch naming: ralphy/<task-slug>
Ralphy can use agent-browser to automate browser interactions during tasks.
ralphy "test the login flow" --browser # force enable
ralphy "add checkout" --no-browser # force disable
ralphy "build feature"# auto-detect (default)When enabled, the AI gets browser commands:
agent-browser open <url>- navigate to URLagent-browser snapshot- get element refs (@e1, @e2)agent-browser click @e1- click elementagent-browser type @e1 "text"- type into inputagent-browser screenshot <file>- capture screenshot
Use cases:
- Testing UI after implementing features
- Verifying deployments
- Form filling and workflow testing
Config (.ralphy/config.yaml):
capabilities:
browser: "auto"# "auto", "true", or "false"| Flag | What it does |
|---|---|
--prd PATH | task file or folder (auto-detected, default: PRD.md) |
--yaml FILE | YAML task file |
--github REPO | use GitHub issues |
--github-label TAG | filter issues by label |
--model NAME | override model for any engine |
--sonnet | shortcut for --claude --model sonnet |
--parallel | run parallel |
--max-parallel N | max agents (default: 3) |
--no-merge | skip auto-merge in parallel mode |
--branch-per-task | branch per task |
--base-branch NAME | base branch |
--create-pr | create PRs |
--draft-pr | draft PRs |
--no-tests | skip tests |
--no-lint | skip lint |
--fast | skip tests + lint |
--no-commit | don't auto-commit |
--max-iterations N | stop after N tasks |
--max-retries N | retries per task (default: 3) |
--retry-delay N | seconds between retries |
--dry-run | preview only |
--browser | enable browser automation |
--no-browser | disable browser automation |
-v, --verbose | debug output |
--init | setup .ralphy/ config |
--config | show config |
--add-rule "rule" | add rule to config |
Required:
- AI CLI: Claude Code, OpenCode, Cursor, Codex, Qwen-Code, or Factory Droid
npm version (ralphy-cli):
- Node.js 18+ or Bun
Bash version (ralphy.sh):
jqyq(optional, for YAML tasks)bc(optional, for cost calc)
Both versions:
gh(optional, for GitHub issues /--create-pr)- agent-browser (optional, for
--browser)
| Engine | CLI | Permissions | Output |
|---|---|---|---|
| Claude | claude | --dangerously-skip-permissions | tokens + cost |
| OpenCode | opencode | full-auto | tokens + cost |
| Codex | codex | N/A | tokens |
| Cursor | agent | --force | duration |
| Qwen | qwen | --approval-mode yolo | tokens |
| Droid | droid exec | --auto medium | duration |
- model override:
--model <name>flag to override model for any engine --sonnetshortcut for--claude --model sonnet--no-mergeflag to skip auto-merge in parallel mode- AI-assisted merge conflict resolution during parallel auto-merge
- root user detection: error for Claude/Cursor, warning for other engines
- improved OpenCode error handling and model override support
- browser automation:
--browser/--no-browserwith agent-browser - auto-detects agent-browser when available
- config option:
capabilities.browserin.ralphy/config.yaml
- TypeScript CLI:
npm install -g ralphy-cli - cross-platform binaries (macOS, Linux, Windows)
- no dependencies on jq/yq/bc for npm version
- single-task mode:
ralphy "task"without PRD - project config:
--initcreates.ralphy/with rules + auto-detection - new:
--config,--add-rule,--no-commit
- Factory Droid support (
--droid)
- Qwen-Code support (
--qwen)
- Cursor support (
--cursor) - better task verification
- parallel execution with worktrees
- branch-per-task + auto-PR
- YAML + GitHub Issues sources
- parallel groups
- OpenCode support
- retry logic
--max-iterations,--dry-run
- initial release
MIT
