@s-berdia/opencode-router 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +22 -1
  2. package/USAGE.md +19 -4
  3. package/package.json +9 -4
package/README.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # opencode-router
2
2
 
3
- Automatic model routing for [OpenCode](https://opencode.ai) on the **Go**, **Go Plus**, and **Free** plans.
3
+ [![npm version](https://img.shields.io/npm/v/@s-berdia/opencode-router)](https://www.npmjs.com/package/@s-berdia/opencode-router)
4
+ [![npm downloads](https://img.shields.io/npm/dm/@s-berdia/opencode-router)](https://www.npmjs.com/package/@s-berdia/opencode-router)
5
+ [![CI](https://github.com/s-berdia/Opencode_router/actions/workflows/ci.yml/badge.svg)](https://github.com/s-berdia/Opencode_router/actions/workflows/ci.yml)
6
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
7
+
8
+ **Switch models before you hit your [OpenCode](https://opencode.ai) limit.** Automatic
9
+ model routing and quota failover for the **Go**, **Go Plus**, and **Free** plans.
4
10
 
5
11
  ![opencode-router demo: the scorecard gives each agent a model, and the build agent changes to the next model at 85% of its 5-hour limit](docs/router-demo.gif)
6
12
 
@@ -41,6 +47,15 @@ the router, read its [known limits](./USAGE.md#11-known-limits).
41
47
 
42
48
  ## Quick start
43
49
 
50
+ If you have the OpenCode command-line tool, run this command. Then close OpenCode, start
51
+ it again, and go to step 4.
52
+
53
+ ```bash
54
+ opencode plugin @s-berdia/opencode-router --global
55
+ ```
56
+
57
+ If you do not have the command-line tool, edit the config file:
58
+
44
59
  1. Open your global OpenCode config file in a text editor:
45
60
  - Windows: `C:\Users\<your-user-name>\.config\opencode\opencode.json`
46
61
  - macOS and Linux: `~/.config/opencode/opencode.json`
@@ -210,6 +225,12 @@ To use your local build in OpenCode, put the absolute path of the folder in the
210
225
  list. Example for Windows: `"plugin": ["file:///C:/code/Opencode_router"]`. Run
211
226
  `npm run build` after each change, then restart OpenCode.
212
227
 
228
+ ## Contributing
229
+
230
+ Bug reports, model scores, and code changes are welcome. Read
231
+ [CONTRIBUTING.md](./CONTRIBUTING.md). For questions and ideas, use
232
+ [Discussions](https://github.com/s-berdia/Opencode_router/discussions).
233
+
213
234
  ## License
214
235
 
215
236
  [MIT](./LICENSE)
package/USAGE.md CHANGED
@@ -42,7 +42,22 @@ Make sure that you have these items:
42
42
 
43
43
  ## 2. Install the plugin
44
44
 
45
- ### Option A: from npm (recommended)
45
+ ### Option A: with the OpenCode command-line tool (fastest)
46
+
47
+ 1. Run this command. It works in PowerShell, CMD, Git Bash, macOS, and Linux:
48
+
49
+ ```bash
50
+ opencode plugin @s-berdia/opencode-router --global
51
+ ```
52
+
53
+ The command downloads the plugin and adds `"@s-berdia/opencode-router"` to the
54
+ `plugin` list of your global config file.
55
+ 2. Close OpenCode. Start OpenCode again.
56
+
57
+ If the `opencode` command is not found, use Option B. Or install the command-line tool
58
+ with `npm install -g opencode-ai`, and then do step 1 again.
59
+
60
+ ### Option B: from npm, by hand
46
61
 
47
62
  1. Open the global OpenCode config file.
48
63
 
@@ -82,7 +97,7 @@ Make sure that you have these items:
82
97
  To use the router in one project only, put the `plugin` entry in `opencode.json` in the
83
98
  root folder of that project, not in the global file.
84
99
 
85
- ### Option B: from source
100
+ ### Option C: from source
86
101
 
87
102
  Use this option to test changes to the code.
88
103
 
@@ -482,7 +497,7 @@ Do not commit the `router/` folder. It contains your usage data.
482
497
 
483
498
  ## 11. Known limits
484
499
 
485
- These are the limits of version 1.1.0.
500
+ These are the limits of version 1.1.1.
486
501
 
487
502
  1. The router sets the model of the `plan`, `build`, `general`, and `explore` agents at
488
503
  each message. If you select a different model by hand, the router replaces it. To
@@ -544,7 +559,7 @@ To select the version yourself, write it in the `plugin` list:
544
559
 
545
560
  ```json
546
561
  {
547
- "plugin": ["@s-berdia/opencode-router@1.1.0"]
562
+ "plugin": ["@s-berdia/opencode-router@1.1.1"]
548
563
  }
549
564
  ```
550
565
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@s-berdia/opencode-router",
3
- "version": "1.1.0",
4
- "description": "Dynamic model routing for OpenCode Go / Go Plus / Free. Picks the best value-for-money model per agent (plan, build, general, explore) and rotates automatically so a 24/7 build plan never runs out.",
3
+ "version": "1.1.1",
4
+ "description": "Automatic model routing and quota failover for OpenCode Go, Go Plus, and Free. Switches models before you hit your limit.",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "author": "s-berdia",
@@ -16,9 +16,14 @@
16
16
  "keywords": [
17
17
  "opencode",
18
18
  "opencode-plugin",
19
- "router",
19
+ "opencode-go",
20
20
  "model-routing",
21
- "llm"
21
+ "failover",
22
+ "rate-limit",
23
+ "quota",
24
+ "llm",
25
+ "ai-coding",
26
+ "ai-agents"
22
27
  ],
23
28
  "main": "./dist/index.js",
24
29
  "types": "./dist/index.d.ts",