{"id":44870160,"url":"https://github.com/pyrex41/rho","last_synced_at":"2026-05-23T07:11:17.564Z","repository":{"id":338354154,"uuid":"1157544185","full_name":"pyrex41/rho","owner":"pyrex41","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-23T02:58:15.000Z","size":2098,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-23T05:31:11.929Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyrex41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-14T00:08:03.000Z","updated_at":"2026-04-23T02:57:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pyrex41/rho","commit_stats":null,"previous_names":["pyrex41/rho"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/pyrex41/rho","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrex41%2Frho","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrex41%2Frho/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrex41%2Frho/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrex41%2Frho/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyrex41","download_url":"https://codeload.github.com/pyrex41/rho/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrex41%2Frho/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33386158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"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-02-17T12:36:00.683Z","updated_at":"2026-05-23T07:11:17.558Z","avatar_url":"https://github.com/pyrex41.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rho\n\nA fast, extensible AI coding agent built in Rust. Rho gives an LLM a set of developer tools — file editing, shell access, web search, sub-agents — and runs an autonomous loop to complete coding tasks.\n\n## Features\n\n- **Multi-provider support** — Anthropic Claude, xAI Grok, and any OpenAI-compatible API (Groq, Ollama, etc.)\n- **Rich tool set** — Read/write/edit files, run shell commands, regex search, glob find, web fetch \u0026 search, sub-agent tasks\n- **LINE:HASH editing** — Hash-based line anchoring for precise, resilient file edits\n- **Session persistence** — SQLite-backed sessions with full history and resume support\n- **Autonomous loop** — Plan and build modes for hands-off multi-step execution\n- **Autoresearch** — Autonomous optimization loop: iteratively improve a metric via code changes, benchmarking, and git\n- **Extended thinking** — First-class support for reasoning models (Claude Opus, Grok reasoning)\n- **Project config** — Per-project settings via `RHO.md` or `CLAUDE.md` with YAML frontmatter\n- **Post-tool hooks** — Run validation commands (tests, lints) automatically after tool use\n- **Skills \u0026 commands** — Auto-discover project-specific skills and slash commands\n- **Streaming output** — Text or JSON streaming for integration with other tools\n\n## Installation\n\n### From source (CLI + GUI)\n\n```bash\ngit clone https://github.com/pyrex41/rho.git\ncd rho\ncargo install --path .\ncargo install --path crates/rho-gui\n```\n\nThis installs both `rho-cli` and `rho` (GUI) binaries.\n\n### Install script (CLI + GUI)\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/pyrex41/rho/main/install.sh | bash\n```\n\nThis downloads the latest pre-built binaries for both `rho-cli` and `rho` (GUI).\n\n### Pre-built binaries\n\nDownload from [GitHub Releases](https://github.com/pyrex41/rho/releases). Pre-built binaries are provided for both the CLI (`rho-cli`) and GUI (`rho`).\n\nThe GUI provides a rich native interface with model picker, markdown rendering, autocomplete, and visual tool call display.\n\n## Quick start\n\n```bash\n# Set your API key\nexport ANTHROPIC_API_KEY=\"sk-...\"\n```\n\n**CLI:**\n\n```bash\n# One-shot prompt\nrho-cli \"add error handling to src/main.rs\"\n\n# Or use GUI\nrho\n```\n\nThe GUI provides an interactive chat with model selection, history, and visual tool call display.\n## Usage\n\n```\nrho-cli [OPTIONS] [PROMPT]\nrho-cli loop [OPTIONS]\nrho-cli autoresearch --benchmark \u003cCMD\u003e --metric \u003cNAME\u003e [OPTIONS]\n```\n\n### Options\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--model \u003cID\u003e` | Model registry ID or raw model ID | `claude-sonnet` |\n| `--thinking \u003cLEVEL\u003e` | Thinking level: off, minimal, low, medium, high | `off` |\n| `--show-thinking` | Display thinking output on stderr | |\n| `--api-key \u003cKEY\u003e` | Override API key | env var / keychain |\n| `-C, --directory \u003cPATH\u003e` | Working directory | current dir |\n| `--prompt-file \u003cFILE\u003e` | Read prompt from file | |\n| `--resume \u003cSESSION\u003e` | Resume an existing session | |\n| `--tools \u003cLIST\u003e` | Restrict available tools (comma-separated) | all |\n| `--system-append \u003cTEXT\u003e` | Append to the system prompt | |\n| `--output-format \u003cFMT\u003e` | `text` or `stream-json` | `text` |\n\n### Autonomous loop\n\n```bash\n# Build mode — execute tasks from an implementation plan\nrho-cli loop\n\n# Plan mode — create or refine IMPLEMENTATION_PLAN.md\nrho-cli loop --mode plan\n\n# Custom plan file, more iterations\nrho-cli loop --plan my-plan.md --max-iterations 100\n```\n\n### Autoresearch\n\nAn autonomous optimization loop inspired by [pi-autoresearch](https://github.com/davebcn87/pi-autoresearch). The agent iteratively makes code changes to improve a measurable metric — the runner benchmarks, commits improvements, reverts regressions, and persists state for resumability.\n\n```bash\n# Optimize a benchmark metric (lower is better by default)\nrho-cli autoresearch \\\n  --benchmark \"cargo bench --bench parse\" \\\n  --metric latency_ns \\\n  --metric-regex \"latency_ns\\s+(\\d+)\" \\\n  --direction lower\n\n# Maximize a score, with correctness checks before benchmarking\nrho-cli autoresearch \\\n  --benchmark \"./bench.sh\" \\\n  --metric score \\\n  --metric-regex \"score:\\s*(\\d+\\.?\\d*)\" \\\n  --direction higher \\\n  --checks \"cargo test\" \\\n  --max-iterations 20\n\n# Use wall-clock time as the metric (omit --metric-regex)\nrho-cli autoresearch \\\n  --benchmark \"cargo build --release\" \\\n  --metric build_time \\\n  --direction lower\n```\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `--benchmark \u003cCMD\u003e` | Command to measure the metric (required) | |\n| `--metric \u003cNAME\u003e` | Name of the metric being optimized (required) | |\n| `--direction \u003cDIR\u003e` | `lower` or `higher` | `lower` |\n| `--metric-regex \u003cRE\u003e` | Regex with capture group to extract metric from output | wall-clock time |\n| `--checks \u003cCMD\u003e` | Correctness check (tests/lint) run before benchmarking | |\n| `--max-iterations \u003cN\u003e` | Maximum optimization iterations | `50` |\n| `--sleep \u003cSECS\u003e` | Seconds between iterations | `5` |\n| `--objective \u003cTEXT\u003e` | Description of the optimization goal | |\n| `--benchmark-timeout \u003cSECS\u003e` | Kill benchmark after this many seconds | `300` |\n| `--output-format \u003cFMT\u003e` | `text` or `stream-json` | `text` |\n\n**How it works:**\n\n1. Runs a baseline benchmark to capture the starting metric value\n2. Each iteration: the agent analyzes experiment history, hypothesizes an optimization, and implements one focused code change\n3. The runner validates changes (optional `--checks`), then benchmarks\n4. If the metric improved: changes are committed. If it regressed: changes are reverted\n5. State is persisted in `autoresearch.jsonl` (structured log) and `autoresearch.md` (session document with strategy notes)\n6. Resumable — kill and restart anytime; it picks up from the JSONL log\n7. The agent can write `EXHAUSTED` to `.stop` when no more optimizations are viable\n\n**Output files:**\n\n- `autoresearch.jsonl` — One JSON object per experiment (iteration, metric value, status, commit hash)\n- `autoresearch.md` — Human-readable session document with config, best result, history table, and agent strategy notes\n\n## Built-in tools\n\n| Tool | Description |\n|------|-------------|\n| `read` | Read files with `LINE:HASH` format, or list directories |\n| `write` | Create or overwrite files |\n| `edit` | Edit files using `LINE:HASH` anchors or text replacement |\n| `bash` | Execute shell commands (PTY, up to 1 hour timeout) |\n| `grep` | Search file contents with regex (respects `.gitignore`) |\n| `find` | Find files by glob pattern (respects `.gitignore`) |\n| `task` | Launch a sub-agent in a separate context |\n| `web_fetch` | Fetch a URL and convert to markdown |\n| `web_search` | Search the web via DuckDuckGo (no API key needed) |\n\n## Supported models\n\n### Anthropic Claude\n- `claude-sonnet` — Claude Sonnet 4.6 (default)\n- `claude-opus` — Claude Opus 4.6 (with extended thinking)\n- `claude-haiku` — Claude Haiku 4.5\n\n### OpenAI\n- `gpt-5.4` — Latest flagship model with 1M context\n- `gpt-5.4-mini` — Strong mini model for coding and agents\n- `gpt-5.4-nano` — Efficient for high-volume tasks\n\n### xAI Grok\n- `grok-3`, `grok-3-mini`, `grok-2`\n- `grok-4.20-reasoning`, `grok-4.20-non-reasoning` (experimental)\n- `grok-4.20-multi-agent` (multi-agent responses endpoint)\n- Additional experimental: `grok-code-fast-1`, `grok-4-1-reasoning`, etc.\n\nThe built-in models are kept up-to-date in `crates/rho-core/src/models.rs`. Zen models (via `OPENCODE_ZEN_API_KEY`) provide additional latest options prefixed with `zen-`.\n\n### Local Models (Ollama, MLX, etc.)\nRho has generic support for any OpenAI-compatible local server via custom config.\n\n**Ollama example:**\n```bash\n# Start Ollama and pull model\nollama serve\nollama pull gemma2:9b\n```\n\nThen add to `~/.rho/models.toml`:\n```toml\n[[model]]\nid = \"ollama-gemma\"\nprovider = \"openai\"\nmodel_id = \"gemma2:9b\"\nbase_url = \"http://localhost:11434/v1\"\ncontext_window = 8192\nmax_tokens = 4096\n# No api_key needed for localhost\n```\n\n**MLX (for ../gemma or other local models on Apple Silicon):**\n```bash\n# Install and run MLX server pointing to your model dir\npip install mlx-lm\nmlx_lm.server --model ../gemma --port 8080\n```\n\nThen:\n```toml\n[[model]]\nid = \"mlx-gemma\"\nprovider = \"openai\"\nmodel_id = \"gemma\"  # adjust to what the server expects\nbase_url = \"http://localhost:8080/v1\"\ncontext_window = 8192\nmax_tokens = 4096\n```\n\nLocalhost base URLs automatically use `\"local\"` as the API key (no auth required).\n\n## Configuration\n\nCreate a `RHO.md` (or `CLAUDE.md`) in your project root:\n\n```markdown\n---\nmodel: claude-sonnet\nthinking: high\nmemories: true\ncompact_threshold: 0.7\nvalidation_commands: [\"cargo test\", \"cargo clippy\"]\npost_tools_hooks:\n  - name: tests\n    command: cargo test\n    timeout: 60\n    inject_on_failure: true\n    trigger_tools: [write, edit]\n---\n\nAdditional system prompt instructions go here as markdown.\n```\n\n### Environment variables\n\n| Variable | Description |\n|----------|-------------|\n| `ANTHROPIC_API_KEY` | Anthropic API key |\n| `XAI_API_KEY` | xAI / Grok API key |\n| `OPENAI_API_KEY` | OpenAI API key |\n| `RHO_SESSION_DB` | Custom path for the session database |\n| `RUST_LOG` | Tracing filter (default: `warn`) |\n\n## Project structure\n\n```\ncrates/\n├── rho-core        # Agent loop, types, config, event system\n├── rho-provider    # LLM provider implementations (Anthropic, OpenAI-compat)\n├── rho-tools       # Built-in tool implementations\n├── rho-hashline    # LINE:HASH file anchoring\n├── rho-server      # HTTP server mode\n└── rho-gui         # GUI frontend (iced, in development)\nsrc/\n├── main.rs         # CLI entry point\n├── loop_runner.rs  # Autonomous loop logic\n└── autoresearch.rs # Autoresearch optimization loop\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrex41%2Frho","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyrex41%2Frho","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrex41%2Frho/lists"}