{"id":46689498,"url":"https://github.com/j4rviscmd/opencode-agent-modes","last_synced_at":"2026-03-09T03:10:11.238Z","repository":{"id":333469706,"uuid":"1136830346","full_name":"j4rviscmd/opencode-agent-modes","owner":"j4rviscmd","description":"OpenCode plugin to switch agent models between performance and economy modes","archived":false,"fork":false,"pushed_at":"2026-01-27T17:00:01.000Z","size":659,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T03:13:33.680Z","etag":null,"topics":["ai-agents","model-switching","npm-package","oh-my-opencode","opencode","opencode-plugin","typescript"],"latest_commit_sha":null,"homepage":"","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/j4rviscmd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-18T12:45:56.000Z","updated_at":"2026-01-27T17:11:03.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/j4rviscmd/opencode-agent-modes","commit_stats":null,"previous_names":["j4rviscmd/opencode-agent-modes"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/j4rviscmd/opencode-agent-modes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4rviscmd%2Fopencode-agent-modes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4rviscmd%2Fopencode-agent-modes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4rviscmd%2Fopencode-agent-modes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4rviscmd%2Fopencode-agent-modes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/j4rviscmd","download_url":"https://codeload.github.com/j4rviscmd/opencode-agent-modes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/j4rviscmd%2Fopencode-agent-modes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30281166,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"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":["ai-agents","model-switching","npm-package","oh-my-opencode","opencode","opencode-plugin","typescript"],"created_at":"2026-03-09T03:10:10.656Z","updated_at":"2026-03-09T03:10:11.219Z","avatar_url":"https://github.com/j4rviscmd.png","language":"TypeScript","readme":"# opencode-agent-modes\n\n[![npm license](https://img.shields.io/npm/l/opencode-agent-modes?logo=npm\u0026logoColor=fff)](https://www.npmjs.com/package/opencode-agent-modes)\n[![npm downloads](https://img.shields.io/npm/dt/opencode-agent-modes?logo=npm\u0026logoColor=fff)](https://www.npmjs.com/package/opencode-agent-modes)\n[![npm version](https://img.shields.io/npm/v/opencode-agent-modes?logo=npm\u0026logoColor=fff)](https://www.npmjs.com/package/opencode-agent-modes)\n![OpenCode Plugin](https://img.shields.io/badge/OpenCode-Plugin-4c8bf5)\n![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript\u0026logoColor=fff)\n\nOpenCode plugin to switch agent models between performance and economy modes.\n\n\u003e [!NOTE]\n\u003e **Primary Use Case**: When approaching your token limit, switch to\n\u003e pre-defined economy models to extend your session until your quota resets.\n\u003e Changes take effect after restarting opencode.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/image/sample.png\" width=\"700\" alt=\"Change mode example\" /\u003e\n\u003c/p\u003e\n\n## Star this repo to keep me motivated ⭐\n\nI build this in my spare time. Every star shows that my work is valued and keeps me going!\n\n![Star](docs/images/star-github.gif)\n\n## Features\n\n- Switch between different model presets (performance, economy, or custom)\n- Configurable presets with user-defined models\n- Toast notifications for mode changes\n\n### Supported Agents\n\n| Agent Type            | Description                                                                                     |\n| --------------------- | ----------------------------------------------------------------------------------------------- |\n| opencode agents       | Standard agents (`build`, `plan`, etc.)                                                         |\n| oh-my-opencode agents | Optional - applies if [oh-my-opencode](https://github.com/pekepeke/oh-my-opencode) is installed |\n\n## Installation\n\nAdd the plugin to your `opencode.json`:\n\n```json\n{\n  \"plugin\": [\"opencode-agent-modes@latest\"]\n}\n```\n\nThe following command files are automatically copied to\n`~/.config/opencode/command/` when the plugin initializes:\n\n- `mode-performance.md`\n- `mode-economy.md`\n- `mode-status.md`\n- `mode-list.md`\n\n## Usage\n\n### Available Commands\n\n- `/mode-performance` - Switch to high-performance models\n- `/mode-economy` - Switch to cost-efficient free models\n- `/mode-status` - Show current mode and configuration\n- `/mode-list` - List all available mode presets\n\n### Available Tools\n\n- `mode_switch` - Switch to a specified mode preset\n- `mode_status` - Display current mode settings\n- `mode_list` - List all available presets\n\n## Configuration\n\nThe plugin configuration is stored at `~/.config/opencode/agent-mode-switcher.json`.\n\nOn first run, the plugin automatically generates this file by:\n\n1. Reading current models from `opencode.json` for the \"performance\" preset\n2. Setting `opencode/glm-4.7-free` for the \"economy\" preset\n\n### Example Configuration\n\n\u003e [!TIP]\n\u003e The `oh-my-opencode` section is optional. Omit it if you don't use oh-my-opencode.\n\n```json\n{\n  \"currentMode\": \"performance\",\n  \"showToastOnStartup\": true,\n  \"presets\": {\n    \"performance\": {\n      \"description\": \"High-performance models for complex tasks\",\n      \"opencode\": {\n        \"build\": { \"model\": \"github-copilot/gpt-5.2\" },\n        \"plan\": { \"model\": \"github-copilot/gpt-5.2\" }\n      },\n      \"oh-my-opencode\": {\n        \"Sisyphus\": { \"model\": \"anthropic/claude-opus-4-5-20251101\" }\n      }\n    },\n    \"economy\": {\n      \"description\": \"Cost-efficient free model for routine tasks\",\n      \"opencode\": {\n        \"build\": { \"model\": \"opencode/glm-4.7-free\" }\n      },\n      \"oh-my-opencode\": {\n        \"Sisyphus\": { \"model\": \"opencode/glm-4.7-free\" }\n      }\n    }\n  }\n}\n```\n\n### Model Priority\n\nWhen both global `model` and agent-specific `opencode` settings are configured,\nthe priority is:\n\n```text\nagent.\u003cname\u003e.model \u003e model (global)\n```\n\nAgent-specific settings override the global model setting.\n\n## Custom Presets\n\nTo add a custom preset (e.g., \"premium\"):\n\n1. Add the preset to `~/.config/opencode/agent-mode-switcher.json`:\n\n   ```json\n   {\n     \"presets\": {\n       \"premium\": {\n         \"description\": \"High-end models for critical tasks\",\n         \"opencode\": {\n           \"build\": { \"model\": \"anthropic/claude-opus-4-5-20251101\" }\n         }\n       }\n     }\n   }\n   ```\n\n2. Create a command file at `~/.config/opencode/command/mode-premium.md`:\n\n   ```md\n   ---\n   description: \"Switch to premium mode (high-end models)\"\n   ---\n\n   Use mode_switch tool to switch agent mode to \"premium\".\n   ```\n\n3. Restart opencode to apply changes.\n\n\u003e [!INFO]\n\u003e - Changes require an opencode restart to take effect\n\u003e - Custom mode presets can be added by editing the configuration file\n\u003e - Built-in command files (`mode-performance.md`, `mode-economy.md`, etc.)\n\u003e   are overwritten on every plugin startup. Do not modify them directly.\n\u003e - Custom command files (e.g., `mode-premium.md`) are not affected by\n\u003e   this overwrite and will persist across restarts.\n\n## Development\n\nThis project uses [Bun](https://bun.sh/) as the runtime and package manager.\n\n### Prerequisites\n\n- [Bun](https://bun.sh/) v1.0 or later\n\n### Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/j4rviscmd/opencode-agent-modes.git\ncd opencode-agent-modes\n\n# Install dependencies\nbun install\n\n# Run tests\nbun test\n\n# Type check\nbun run typecheck\n\n# Lint \u0026 format\nbun run lint\nbun run format\n\n# Build\nbun run build\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj4rviscmd%2Fopencode-agent-modes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fj4rviscmd%2Fopencode-agent-modes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fj4rviscmd%2Fopencode-agent-modes/lists"}