|
| 1 | +# opencode-augment-auth |
| 2 | + |
| 3 | +OpenCode plugin for [Augment Code](https://augmentcode.com) — access Claude and GPT models **at zero cost** through Augment Code's infrastructure. |
| 4 | + |
| 5 | +**No separate server process needed.** The plugin embeds the API server directly inside OpenCode and auto-configures everything. |
| 6 | + |
| 7 | +## Quick Start |
| 8 | + |
| 9 | +### 1. Install the Auggie CLI and authenticate |
| 10 | + |
| 11 | +```bash |
| 12 | +npm install -g @augmentcode/auggie |
| 13 | +auggie login |
| 14 | +``` |
| 15 | + |
| 16 | +### 2. Add the plugin to your `opencode.json` |
| 17 | + |
| 18 | +```json |
| 19 | +{ |
| 20 | + "plugin": ["opencode-augment-auth"], |
| 21 | + "model": "augment/claude-opus-4-6" |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +That's it — no provider config needed. The plugin auto-registers all models. |
| 26 | + |
| 27 | +### 3. Authenticate in OpenCode |
| 28 | + |
| 29 | +```bash |
| 30 | +opencode auth login |
| 31 | +# Select "Augment Code (auto-detect session.json)" |
| 32 | +``` |
| 33 | + |
| 34 | +### 4. Use it |
| 35 | + |
| 36 | +```bash |
| 37 | +opencode |
| 38 | +``` |
| 39 | + |
| 40 | +## How It Works |
| 41 | + |
| 42 | +1. **Config hook** auto-injects the `augment` provider with all 8 models into OpenCode |
| 43 | +2. **Auth hook** validates your `~/.augment/session.json` from `auggie login` |
| 44 | +3. **Embedded server** starts automatically on a random port when OpenCode loads the provider |
| 45 | +4. Requests flow: OpenCode → embedded server → Auggie SDK → Augment Code API → Claude/GPT |
| 46 | + |
| 47 | +No separate process to manage. No port conflicts. Everything runs inside OpenCode. |
| 48 | + |
| 49 | +## Available Models |
| 50 | + |
| 51 | +Use `augment/<model-id>` in OpenCode (e.g., `augment/claude-opus-4-6`). |
| 52 | + |
| 53 | +| Model ID | Description | Context | Output | |
| 54 | +|----------|-------------|---------|--------| |
| 55 | +| `claude-opus-4-6` | Most capable Claude | 200K | 32K | |
| 56 | +| `claude-opus-4-5` | Previous Opus gen | 200K | 32K | |
| 57 | +| `claude-sonnet-4-5` | Balanced performance | 200K | 16K | |
| 58 | +| `claude-sonnet-4` | Previous Sonnet gen | 200K | 16K | |
| 59 | +| `claude-haiku-4-5` | Fast, lightweight | 200K | 8K | |
| 60 | +| `gpt-5` | GPT-5 | 128K | 16K | |
| 61 | +| `gpt-5-1` | Strong reasoning | 128K | 16K | |
| 62 | +| `gpt-5-2` | Smarter, slower | 128K | 16K | |
| 63 | + |
| 64 | +## Local Development |
| 65 | + |
| 66 | +```bash |
| 67 | +cd plugin |
| 68 | +npm install |
| 69 | +npm run build |
| 70 | +``` |
| 71 | + |
| 72 | +Reference the local build in `opencode.json`: |
| 73 | + |
| 74 | +```json |
| 75 | +{ |
| 76 | + "plugin": ["/path/to/auggie-wrapper/plugin"] |
| 77 | +} |
| 78 | +``` |
| 79 | + |
| 80 | +## Troubleshooting |
| 81 | + |
| 82 | +| Issue | Solution | |
| 83 | +|-------|----------| |
| 84 | +| "Session file not found" | Run `auggie login` to authenticate | |
| 85 | +| Auth login fails | Ensure `~/.augment/session.json` exists and has `accessToken` + `tenantURL` | |
| 86 | +| Model not found | Use hyphenated IDs: `claude-opus-4-6`, not `claude-opus-4.6` | |
| 87 | + |
| 88 | +## License |
| 89 | + |
| 90 | +MIT |
0 commit comments