{"id":49331920,"url":"https://github.com/patbaumgartner/copilot-ralph","last_synced_at":"2026-04-26T23:00:45.538Z","repository":{"id":354040986,"uuid":"1221898658","full_name":"patbaumgartner/copilot-ralph","owner":"patbaumgartner","description":"Iterative AI development loop CLI built on the GitHub Copilot SDK","archived":false,"fork":false,"pushed_at":"2026-04-26T21:34:14.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T22:21:42.252Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patbaumgartner.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-04-26T20:24:34.000Z","updated_at":"2026-04-26T21:34:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/patbaumgartner/copilot-ralph","commit_stats":null,"previous_names":["patbaumgartner/copilot-ralph"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/patbaumgartner/copilot-ralph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patbaumgartner%2Fcopilot-ralph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patbaumgartner%2Fcopilot-ralph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patbaumgartner%2Fcopilot-ralph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patbaumgartner%2Fcopilot-ralph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patbaumgartner","download_url":"https://codeload.github.com/patbaumgartner/copilot-ralph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patbaumgartner%2Fcopilot-ralph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32315712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T21:09:39.134Z","status":"ssl_error","status_checked_at":"2026-04-26T21:09:21.240Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-26T23:00:44.775Z","updated_at":"2026-04-26T23:00:45.529Z","avatar_url":"https://github.com/patbaumgartner.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ralph\r\n\r\n```text\r\n              --.                        .-+.\r\n              -+++--.                 .-+++#.\r\n              +++++++-.            .-+++++++-\r\n              +++++++++-. .....   .+++++++++-\r\n              +++++++++++-++++++--++++++++++-\r\n              ++++++++++++++++++++++++++++++-\r\n              +++++++++++++++++++----+++++++-\r\n              -++++++++++++++++++.   ..--+++.\r\n              .+++++-...--+++++++     ...-+-\r\n               -+++-      ..---++...   ...+.\r\n               .++++.     +#+ -++.+#+ ...--\r\n                -++++..   -++.-++-+#-...-+.\r\n                  -++++-     .###-  .-++.\r\n                    .-+.       .     .+\r\n                     .+-.   --.    ...\r\n                    .++++       ..-+-. ..\r\n                    .++++      ...-.-+--.\r\n                    .++++-.    +#+-..-----\r\n                    -+++++++--######++-- .\r\n       ...          -++++---++#####+++-+-.\r\n       ..     .-.   -++++.    ...-+--...\r\n        .    .-++--..+++++-.. ...-+++-\r\n        ...  .-+++++-+++++++----+++++.\r\n          ...++++++++++++--....--+++-\r\n           .-+++++++++++-        .++.\r\n         .......-----##+..........+##-.....\r\n              ........................\r\n```\r\n\r\n\u003e A small, opinionated Go CLI that drives an iterative loop against the\r\n\u003e [GitHub Copilot SDK](https://github.com/github/copilot-sdk). One prompt\r\n\u003e in, many turns of progress out — until Ralph decides he's done, you run\r\n\u003e out of iterations, or you hit `Ctrl+C`.\r\n\r\n[![CI](https://github.com/patbaumgartner/copilot-ralph/actions/workflows/ci.yml/badge.svg)](https://github.com/patbaumgartner/copilot-ralph/actions/workflows/ci.yml)\r\n[![Release](https://github.com/patbaumgartner/copilot-ralph/actions/workflows/release.yml/badge.svg)](https://github.com/patbaumgartner/copilot-ralph/actions/workflows/release.yml)\r\n[![Go Reference](https://pkg.go.dev/badge/github.com/patbaumgartner/copilot-ralph.svg)](https://pkg.go.dev/github.com/patbaumgartner/copilot-ralph)\r\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\r\n\r\n## Why Ralph\r\n\r\nThe \"Ralph Wiggum\" technique is dead simple: keep poking the model with the\r\nsame prompt until the work is actually done. Ralph wraps that idea in a\r\nsingle binary so you can hand a task to Copilot and watch it iterate\r\nwithout babysitting the chat window.\r\n\r\n- **Stream first.** Tokens, reasoning, and tool calls land on stdout the\r\n  moment they arrive.\r\n- **Promise-based completion.** The model wraps its sign-off in\r\n  `\u003cpromise\u003e...\u003c/promise\u003e`; Ralph emits an event when it sees one.\r\n- **Hard limits.** `--max-iterations` and `--timeout` keep runaway loops\r\n  in check.\r\n- **No magic.** Plain CLI, plain logs, no TUI, no wizard.\r\n\r\n## Install\r\n\r\nRequires Go 1.25+ and the [GitHub Copilot CLI](https://github.com/github/copilot)\r\non `$PATH`.\r\n\r\n```bash\r\n# Install the latest release directly\r\ngo install github.com/patbaumgartner/copilot-ralph/cmd/ralph@latest\r\n\r\n# Or grab a binary from the Releases page\r\n# https://github.com/patbaumgartner/copilot-ralph/releases\r\n\r\n# Or build from source\r\ngit clone https://github.com/patbaumgartner/copilot-ralph.git\r\ncd copilot-ralph\r\nmake build   # produces ./bin/ralph\r\n```\r\n\r\n## Usage\r\n\r\n```bash\r\n# Inline prompt\r\nralph run \"Add unit tests for the parser module\"\r\n\r\n# Markdown file as prompt\r\nralph run task.md\r\n\r\n# Cap iterations and runtime\r\nralph run --max-iterations 5 --timeout 10m \"Refactor authentication\"\r\n\r\n# Show the resolved config without calling the model\r\nralph run --dry-run \"Implement OAuth\"\r\n\r\n# Custom system prompt (note: --system-prompt-mode=replace removes Ralph's\r\n# built-in \u003cpromise\u003e...\u003c/promise\u003e instruction)\r\nralph run \\\r\n  --system-prompt prompts/expert-go.md \\\r\n  --system-prompt-mode replace \\\r\n  \"Optimise the hot path\"\r\n```\r\n\r\n### Useful flags\r\n\r\n| Flag                          | Default       | Purpose                                       |\r\n| ----------------------------- | ------------- | --------------------------------------------- |\r\n| `-m`, `--max-iterations`      | `10`          | Stop after N loops.                           |\r\n| `-t`, `--timeout`             | `30m`         | Stop after this duration.                     |\r\n| `--promise`                   | `I'm special!`| Phrase the model wraps in `\u003cpromise\u003e`.        |\r\n| `--model`                     | `gpt-4`       | Copilot model id.                             |\r\n| `--working-dir`               | cwd           | Where the assistant runs tools.               |\r\n| `--log-level`                 | `info`        | `debug` / `info` / `warn` / `error`.          |\r\n| `--streaming`                 | `true`        | Stream deltas vs. wait for full messages.     |\r\n| `--system-prompt`             | (built-in)    | Inline text or path to a Markdown file.       |\r\n| `--system-prompt-mode`        | `append`      | `append` or `replace` Ralph's system prompt.  |\r\n| `--dry-run`                   | `false`       | Print the config and exit.                    |\r\n\r\n`ralph version` prints build metadata. `ralph --help` lists everything.\r\n\r\n## How it works\r\n\r\n```text\r\n   prompt ──► Copilot SDK ──► assistant tokens, tool calls\r\n                  ▲                      │\r\n                  └──── next iteration ──┘\r\n                  (until promise / max-iterations / timeout / Ctrl+C)\r\n```\r\n\r\nThe loop lives in `internal/core`. The SDK wrapper (`internal/sdk`) handles\r\nsessions, retries, and translates SDK events into Ralph-flavoured events.\r\nThe CLI layer (`cmd/ralph`, `internal/cli`) wires flags to a `LoopConfig`\r\nand prints events as they stream in. There is no shared mutable state\r\nbeyond Cobra flag bindings.\r\n\r\n## Exit codes\r\n\r\n| Code | Meaning                                        |\r\n| ---- | ---------------------------------------------- |\r\n| `0`  | Loop finished cleanly (max iterations or done).|\r\n| `1`  | Generic failure / SDK error.                   |\r\n| `2`  | Invalid configuration or arguments.            |\r\n| `3`  | `--timeout` exceeded.                          |\r\n| `130`| Cancelled with `Ctrl+C`.                       |\r\n\r\n## Development\r\n\r\n```bash\r\nmake all        # tidy + fmt + vet + lint + test + build\r\nmake test       # go test -race -cover ./...\r\nmake build      # ./bin/ralph\r\n```\r\n\r\nConventions, architecture, and \"how to add X\" live in [AGENTS.md](./AGENTS.md).\r\nContribution workflow is in [CONTRIBUTING.md](./CONTRIBUTING.md). User-visible\r\nchanges belong in [CHANGELOG.md](./CHANGELOG.md). Security disclosures go\r\nthrough [SECURITY.md](./SECURITY.md).\r\n\r\n## Acknowledgements\r\n\r\n- The original [Ralph Wiggum plugin](https://github.com/anthropics/claude-code/tree/main/plugins/ralph-wiggum)\r\n  for Claude Code that inspired the loop pattern.\r\n- The [GitHub Copilot SDK](https://github.com/github/copilot-sdk) team.\r\n- [Charmbracelet](https://github.com/charmbracelet) for `lipgloss`.\r\n\r\n## License\r\n\r\n[MIT](./LICENSE)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatbaumgartner%2Fcopilot-ralph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatbaumgartner%2Fcopilot-ralph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatbaumgartner%2Fcopilot-ralph/lists"}