Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ dist/
opencode.json
.opencode/
tmp
.codex-cache
.codex-cache

# opensrc - source code for packages
opensrc/
23 changes: 23 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,26 @@ This plugin **intentionally differs from opencode defaults** because it accesses
- TypeScript

**Zero external runtime dependencies** - only uses Node.js built-ins for file I/O, HTTP, crypto.

<!-- opensrc:start -->

## Source Code Reference

Source code for dependencies is available in `opensrc/` for deeper understanding of implementation details.

See `opensrc/sources.json` for the list of available packages and their versions.

Use this source code when you need to understand how a package works internally, not just its types/interface.

### Fetching Additional Source Code

To fetch source code for a package or repository you need to understand, run:

```bash
npx opensrc <package> # npm package (e.g., npx opensrc zod)
npx opensrc pypi:<package> # Python package (e.g., npx opensrc pypi:requests)
npx opensrc crates:<package> # Rust crate (e.g., npx opensrc crates:serde)
npx opensrc <owner>/<repo> # GitHub repo (e.g., npx opensrc vercel/ai)
```

<!-- opensrc:end -->
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,40 @@ Minimal configs are not supported for GPT‑5.x; use the full configs above.
- Variant system support (v1.0.210+) + legacy presets
- Multimodal input enabled for all models
- Usage‑aware errors + automatic token refresh
- **Multi-account support** with automatic rate limit rotation
---
## 👥 Multi-Account Support

Heavy users can configure up to 10 ChatGPT accounts. When one account hits rate limits, the plugin automatically switches to the next available account.

### Adding Accounts

**During initial login:**
```bash
opencode auth login
# After first account: "You have 1 account(s). Add another? [y/N]: y"
```

**Add accounts later:**
```bash
codex-accounts add # Opens browser OAuth
codex-accounts list # Show all accounts
codex-accounts remove 1 # Remove account at index 1
```

### How It Works

1. Request sent using current account
2. If 429 (rate limit) received, marks account as rate-limited
3. Automatically retries with next available account (up to 3 retries)
4. Rate limit state persists across sessions

### Storage

Account metadata stored at:
- **Linux/macOS:** `~/.local/share/opencode/openai-codex-accounts.json`
- **Windows:** `%APPDATA%/opencode/openai-codex-accounts.json`

---
## 📚 Docs
- Getting Started: `docs/getting-started.md`
Expand Down
Loading