Ralph Wiggum is a loop runner for opencode iterations. It automates running multiple iterations of opencode with configurable timeouts, pre/post commands, and logging.
cargo build --release
Or install from github:
cargo install --git https://github.com/grenade/ralph
rw \
--model ${model} \
--project-prompt ${project_prompt} \
--framework-prompt ${framework_prompt} \
--generic-prompt ${generic_prompt} \
--project-path ${project_path} \
--iterations ${iterations} \
--log-path ${log_path} \
[OPTIONS]
Options:
--model <MODEL> Model to use for opencode (e.g., "claude-sonnet-4-20250514")
--project-prompt <PROJECT_PROMPT> Path to project prompt file
--framework-prompt <FRAMEWORK_PROMPT> Path to framework prompt file
--generic-prompt <GENERIC_PROMPT> Path to generic prompt file
--project-path <PROJECT_PATH> Path to the project directory
--iterations <ITERATIONS> Number of iterations to run
--log-path <LOG_PATH> Directory to store log files
--exec-timeout <SECONDS> Execution timeout in seconds [default: 180]
--pre-cmd <CMD> Command to run before each iteration (e.g., "git checkout .")
--post-cmd <CMD> Command to run after each iteration (e.g., "cargo build")
-h, --help Print help
./target/release/rw \
--model "claude-sonnet-4-20250514" \
--project-prompt ~/.rw/prompts/ralph.md \
--framework-prompt ~/.rw/prompts/rust-2021-cli.md \
--generic-prompt ~/.rw/prompts/generic.md \
--project-path ~/git/grenade/ralph \
--iterations 5 \
--log-path ~/.rw/logs/ralph \
--exec-timeout 300 \
--pre-cmd "git checkout ." \
--post-cmd "cargo build"
Logs are saved to <log-path>/<project-name>-iter<N>.log for each iteration.
MIT
3 activities