{"id":50283721,"url":"https://github.com/rahadiana/opencode-multi-account","last_synced_at":"2026-05-28T01:11:07.577Z","repository":{"id":351622435,"uuid":"1211791106","full_name":"rahadiana/opencode-multi-account","owner":"rahadiana","description":"A plugin for OpenCode that automatically manages multiple API accounts. When one account hits its rate limit, the plugin will automatically switch to the next account based on priority.","archived":false,"fork":false,"pushed_at":"2026-04-26T15:47:37.000Z","size":88,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-26T16:21:48.333Z","etag":null,"topics":["account-rotation","opencode","opencode-plugin"],"latest_commit_sha":null,"homepage":"https://github.com/rahadiana/opencode-multi-account","language":"TypeScript","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/rahadiana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-04-15T18:48:44.000Z","updated_at":"2026-04-26T15:50:21.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rahadiana/opencode-multi-account","commit_stats":null,"previous_names":["rahadiana/opencode-multi-account"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahadiana/opencode-multi-account","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahadiana%2Fopencode-multi-account","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahadiana%2Fopencode-multi-account/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahadiana%2Fopencode-multi-account/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahadiana%2Fopencode-multi-account/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahadiana","download_url":"https://codeload.github.com/rahadiana/opencode-multi-account/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahadiana%2Fopencode-multi-account/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33589813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["account-rotation","opencode","opencode-plugin"],"created_at":"2026-05-28T01:10:58.635Z","updated_at":"2026-05-28T01:11:07.571Z","avatar_url":"https://github.com/rahadiana.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🔌 OpenCode Multi-Account Manager Plugin\n\nA plugin for [OpenCode](https://opencode.ai) that automatically manages multiple API accounts. When one account hits its rate limit, the plugin will **automatically switch to the next account** based on priority.\n\n## ✨ Features\n\n- **Priority Rotation** — Accounts are sorted by priority (P1 → P2 → P3, etc.)\n- **Provider-Level Auto-Switch** — When a rate limit is detected for Provider X, rotation occurs only within Provider X's account pool.\n- **All Providers Supported** — Compatible with 35+ providers supported by OpenCode (Anthropic, OpenAI, Google, Groq, DeepSeek, OpenRouter, xAI, etc.)\n- **Provider Exhausted Notifications** — Alerts you when **all accounts for a provider are exhausted**.\n- **Custom Tools** — Manage accounts directly from the OpenCode TUI.\n- **Cooldown Tracking** — Rate-limited accounts automatically reactivate after the cooldown period.\n\n## 🛠️ Installation\n\n### Method 1: Via NPM (Recommended)\n\nThis plugin is officially published on npm. You can easily install it into OpenCode by adding it to your `opencode.json` configuration file:\n\n```json\n{\n  \"plugin\": [\"@rahadiana/opencode-multi-account\"]\n}\n```\n\n### Method 2: Automatic AI Installation 🤖\n\nYou can instruct your AI assistant (like OpenCode, Claude, or Cursor) to install and configure this plugin for you automatically. Just provide them with this prompt:\n\n\u003e \"Please install the OpenCode Multi-Account Manager plugin for me. You can read the instructions at `AI_PLUGIN_GUIDE.md` from this repository: https://github.com/rahadiana/opencode-multi-account\"\n\n### Method 3: Manual Installation from Source (For Developers)\n\nIf you are a developer wanting to test, modify, or contribute to this plugin, you can install it manually from the GitHub repository.\n\n#### Prerequisites\n- Node.js 18+ (latest LTS recommended)\n- npm \u0026 Git\n\n#### Developer Install (Linux/macOS)\n```bash\n# Clone the repository\ngit clone https://github.com/rahadiana/opencode-multi-account.git\ncd opencode-multi-account\n\n# Install dependencies and build\nnpm ci\nnpm run build\n\n# Copy to global plugins directory\nmkdir -p ~/.config/opencode/plugins\ncp -r . ~/.config/opencode/plugins/multi-account\n```\n\n#### Developer Install (Windows PowerShell)\n```powershell\n# Clone the repository\ngit clone https://github.com/rahadiana/opencode-multi-account.git\ncd opencode-multi-account\n\n# Install dependencies and build\nnpm ci\nnpm run build\n\n# Copy to global plugins directory\nNew-Item -Path \"$env:USERPROFILE\\.config\\opencode\\plugins\" -ItemType Directory -Force\nCopy-Item . \"$env:USERPROFILE\\.config\\opencode\\plugins\\multi-account\" -Recurse -Force\n```\n\n### Multi-Account Configuration Location\n\nAfter installation, the plugin requires an `accounts.json` configuration file. Place it in the appropriate directory for your OS:\n\n| OS | Config Directory |\n|----|------------------|\n| Linux / macOS | `~/.config/opencode/multi-account/` |\n| Windows | `$env:USERPROFILE\\.config\\opencode\\multi-account\\` |\n\n### Troubleshooting\n- **Plugin not detected in OpenCode**: Ensure you've added it to `opencode.json` properly (if using npm) or that the folder is copied correctly (if installing from source).\n- **Build failed (Source Install)**: Run `npm ci` again, check for TypeScript errors, and ensure Node 18+ is installed.\n- **Account configuration not read**: Ensure `accounts.json` exists in the exact config directory mentioned above and contains valid JSON.\n\n### Generator accounts.example.json\nUse the following script to create or update `accounts.example.json`:\n\n```bash\nnode scripts/generate_accounts_example.mjs\n```\n\nThis script will:\n- Read `accounts.json` (if it exists) and generate `accounts.example.json` with sanitized tokens.\n- Create a default template if `accounts.json` is not found.\n\nMake sure to run this script whenever the structure of `accounts.json` changes.\n\n## 📖 Usage\n\nThis plugin provides custom tools that you can use directly in OpenCode:\n\n- **`account_status`** — Check the status of all configured accounts (active, rate-limited, cooldown)\n- **`account_list`** — View a list of all configured accounts with their priorities\n- **`account_switch`** — Manually switch to a specific account by ID\n- **`account_config_path`** — View the path to the accounts configuration file\n\n### Example Usage\n\n```\n/account_status\n/account_list\n/account_switch \u003caccount-id\u003e\n/account_config_path\n```\n\n## ⚙️ Configuration\n\nThe plugin uses an `accounts.json` configuration file to manage your API accounts.\n\n### Configuration File Location\n\n| OS | Path |\n|----|------|\n| Linux / macOS | `~/.config/opencode/multi-account/accounts.json` |\n| Windows | `%USERPROFILE%\\.config\\opencode\\multi-account\\accounts.json` |\n\n### accounts.json Format\n\n```json\n{\n  \"accounts\": [\n    {\n      \"id\": \"anthropic-p1\",\n      \"name\": \"Anthropic Primary\",\n      \"provider\": \"anthropic\",\n      \"apiKey\": \"sk-ant-...\",\n      \"priority\": 1,\n      \"cooldownPeriod\": 300000\n    },\n    {\n      \"id\": \"anthropic-p2\",\n      \"name\": \"Anthropic Secondary\",\n      \"provider\": \"anthropic\",\n      \"apiKey\": \"sk-ant-...\",\n      \"priority\": 2,\n      \"cooldownPeriod\": 300000\n    },\n    {\n      \"id\": \"openai-p1\",\n      \"name\": \"OpenAI Primary\",\n      \"provider\": \"openai\",\n      \"apiKey\": \"sk-...\",\n      \"priority\": 1,\n      \"cooldownPeriod\": 300000\n    }\n  ]\n}\n```\n\n### Configuration Fields\n\n| Field | Required | Description |\n|-------|----------|-------------|\n| `id` | ✅ | Unique identifier for the account (e.g., `anthropic-p1`) |\n| `name` | ✅ | Human-readable name for the account |\n| `provider` | ✅ | Provider name (e.g., `anthropic`, `openai`, `google`) |\n| `apiKey` | ✅ | Your API key for this provider |\n| `priority` | ✅ | Priority level (1 = highest, higher numbers = lower priority) |\n| `cooldownPeriod` | ✅ | Cooldown time in milliseconds after rate limit (e.g., `300000` = 5 minutes) |\n| `baseUrl` | ❌ | Optional custom base URL for the provider API |\n\n### Provider Support\n\nThe plugin supports 35+ providers including:\n- **Anthropic** (Claude)\n- **OpenAI** (GPT-4, GPT-3.5)\n- **Google** (Gemini)\n- **Groq**\n- **DeepSeek**\n- **OpenRouter**\n- **xAI** (Grok)\n- And many more supported by OpenCode\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahadiana%2Fopencode-multi-account","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahadiana%2Fopencode-multi-account","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahadiana%2Fopencode-multi-account/lists"}