Skip to content

Instantly share code, notes, and snippets.

@pierrecorsini
Created January 11, 2026 21:13
Show Gist options
  • Select an option

  • Save pierrecorsini/55c435b6b006f04ea2199b761c4ee1da to your computer and use it in GitHub Desktop.

Select an option

Save pierrecorsini/55c435b6b006f04ea2199b761c4ee1da to your computer and use it in GitHub Desktop.
Minimal Ralph loop with Opencode (powershell)
$prompt = "Improve app; reply RALPHCOMPLETED when completely done"
for ($i = 1; $i -le 50; $i++) {
Write-Host "Attempt #$i running..." -ForegroundColor Cyan
# Removed --format text (not a valid option)
$found = opencode run $prompt 2>&1 | ForEach-Object {
Write-Host $_
$_
} | Select-String -Pattern "RALPHCOMPLETED" -Quiet
if ($found) {
Write-Host "RALPHCOMPLETED found! Exiting." -ForegroundColor Green
exit 0
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment