|
1 | 1 | # opencoder |
2 | 2 |
|
3 | | -**Autonomous OpenCode Runner** - A POSIX-compliant Bash script that runs [OpenCode](https://opencode.ai) CLI in a fully autonomous way, creating development plans and executing them continuously without manual intervention. |
| 3 | +[](https://github.com/opencodeco/opencoder/actions/workflows/ci.yml) |
| 4 | + |
| 5 | +**Autonomous OpenCode Runner** - A Zig-powered CLI that runs [OpenCode](https://opencode.ai) in a fully autonomous way, creating development plans and executing them continuously without manual intervention. |
4 | 6 |
|
5 | 7 | ## Features |
6 | 8 |
|
7 | 9 | - **Autonomous Development Loop** - Continuously plans, executes, and evaluates without stopping |
8 | 10 | - **Two-Model Architecture** - Uses a high-capability model for planning and a faster model for execution |
9 | 11 | - **Provider Presets** - Quick setup with GitHub Copilot, Anthropic, OpenAI, or OpenCode backends |
10 | | -- **State Persistence** - Resumes from where it left off after interruptions |
| 12 | +- **State Persistence** - Resumes from where it left off after interruptions (JSON format) |
11 | 13 | - **Exponential Backoff** - Graceful retry logic for transient failures |
12 | 14 | - **Plan History** - Archives completed plans for reference |
13 | 15 | - **Signal Handling** - Clean shutdown with state preservation |
| 16 | +- **Cross-Platform** - Builds for Linux and macOS (amd64/arm64) |
14 | 17 |
|
15 | 18 | ## Installation |
16 | 19 |
|
17 | | -### Quick Install |
| 20 | +### Pre-built Binaries |
| 21 | + |
| 22 | +Download the latest release for your platform from [GitHub Releases](https://github.com/opencodeco/opencoder/releases): |
18 | 23 |
|
19 | 24 | ```bash |
20 | | -curl -fsSL https://raw.githubusercontent.com/opencodeco/opencoder/main/opencoder -o opencoder |
| 25 | +# Linux (amd64) |
| 26 | +curl -fsSL https://github.com/opencodeco/opencoder/releases/latest/download/opencoder-linux-amd64 -o opencoder |
| 27 | + |
| 28 | +# Linux (arm64) |
| 29 | +curl -fsSL https://github.com/opencodeco/opencoder/releases/latest/download/opencoder-linux-arm64 -o opencoder |
| 30 | + |
| 31 | +# macOS (Intel) |
| 32 | +curl -fsSL https://github.com/opencodeco/opencoder/releases/latest/download/opencoder-macos-amd64 -o opencoder |
| 33 | + |
| 34 | +# macOS (Apple Silicon) |
| 35 | +curl -fsSL https://github.com/opencodeco/opencoder/releases/latest/download/opencoder-macos-arm64 -o opencoder |
| 36 | + |
| 37 | +# Make executable and move to PATH |
21 | 38 | chmod +x opencoder |
22 | 39 | sudo mv opencoder /usr/local/bin/ |
23 | 40 | ``` |
24 | 41 |
|
25 | | -### Manual Install |
| 42 | +### Build from Source |
| 43 | + |
| 44 | +Requires [Zig 0.15+](https://ziglang.org/download/): |
26 | 45 |
|
27 | | -1. Download the script: |
28 | 46 | ```bash |
29 | 47 | git clone https://github.com/opencodeco/opencoder.git |
30 | 48 | cd opencoder |
31 | | -``` |
32 | | - |
33 | | -2. Make it executable and move to PATH: |
34 | | -```bash |
35 | | -chmod +x opencoder |
36 | | -sudo cp opencoder /usr/local/bin/ |
| 49 | +zig build -Doptimize=ReleaseSafe |
| 50 | +sudo cp zig-out/bin/opencoder /usr/local/bin/ |
37 | 51 | ``` |
38 | 52 |
|
39 | 53 | ## Requirements |
40 | 54 |
|
41 | 55 | - [OpenCode CLI](https://opencode.ai) installed and configured |
42 | | -- Bash 4.0+ (macOS may need `brew install bash`) |
43 | | -- Standard POSIX utilities (sed, grep, date) |
44 | 56 |
|
45 | 57 | ## Usage |
46 | 58 |
|
@@ -87,6 +99,7 @@ opencoder -P openai/gpt-4 -E openai/gpt-4o-mini "build a CLI tool" |
87 | 99 | | `-p, --project DIR` | Project directory (default: current directory) | |
88 | 100 | | `-v, --verbose` | Enable verbose logging | |
89 | 101 | | `-h, --help` | Show help message | |
| 102 | +| `--version` | Show version | |
90 | 103 |
|
91 | 104 | ## Provider Presets |
92 | 105 |
|
@@ -124,10 +137,8 @@ Opencoder creates a `.opencoder/` directory in your project: |
124 | 137 |
|
125 | 138 | ``` |
126 | 139 | .opencoder/ |
127 | | -├── state # Current execution state |
| 140 | +├── state.json # Current execution state (JSON) |
128 | 141 | ├── current_plan.md # Active task plan |
129 | | -├── alerts.log # Critical error alerts |
130 | | -├── config.env # Optional configuration overrides |
131 | 142 | ├── history/ # Archived completed plans |
132 | 143 | │ └── plan_YYYYMMDD_HHMMSS_cycleN.md |
133 | 144 | └── logs/ |
@@ -176,6 +187,22 @@ Using bcrypt for password hashing, JWT for tokens. |
176 | 187 | - **Check the logs** - Detailed logs are in `.opencoder/logs/` if something goes wrong |
177 | 188 | - **Review history** - Completed plans are archived in `.opencoder/history/` |
178 | 189 |
|
| 190 | +## Development |
| 191 | + |
| 192 | +```bash |
| 193 | +# Build debug version |
| 194 | +zig build |
| 195 | + |
| 196 | +# Run tests |
| 197 | +zig build test |
| 198 | + |
| 199 | +# Check formatting |
| 200 | +zig fmt --check src/ |
| 201 | + |
| 202 | +# Build release |
| 203 | +zig build -Doptimize=ReleaseSafe |
| 204 | +``` |
| 205 | + |
179 | 206 | ## License |
180 | 207 |
|
181 | 208 | MIT License - See [LICENSE](LICENSE) file. |
|
0 commit comments