github-router 0.3.16 → 0.3.18

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.
package/README.md CHANGED
@@ -28,7 +28,21 @@ The server runs at `http://localhost:8787`. Now pick your tool below.
28
28
 
29
29
  ## Use with Claude Code
30
30
 
31
- **Option A: Interactive (recommended)**
31
+ **Option A: One-shot subcommand (recommended)**
32
+
33
+ ```sh
34
+ npx github-router@latest claude
35
+ ```
36
+
37
+ Boots the proxy on a random port and spawns Claude Code wired to it. Sets `ANTHROPIC_MODEL=claude-opus-4-7` (Anthropic's dashed slug — Claude Code's `/model` UI displays this as menu entry "Opus 4.7 (1M context)"). The proxy translates to Copilot's `claude-opus-4.7-1m-internal` on enterprise tokens or `claude-opus-4.7` on Pro+/Business/Max at request time. Major.minor fallback chain: `claude-opus-4-6` → `claude-opus-4-5`. Override with `-m`:
38
+
39
+ ```sh
40
+ npx github-router@latest claude -m claude-opus-4-7
41
+ ```
42
+
43
+ The launcher sanitizes parent-env auth keys and sets `CLAUDE_CONFIG_DIR=$HOME/.claude` so the spawned `claude` ignores any persisted Console OAuth credential without requiring `claude /logout`. Settings, MCP servers, hooks, and CLAUDE.md auto-discovery still load from `~/.claude` as normal.
44
+
45
+ **Option B: Interactive launch-command generator**
32
46
 
33
47
  ```sh
34
48
  npx github-router@latest start --claude-code
@@ -36,7 +50,7 @@ npx github-router@latest start --claude-code
36
50
 
37
51
  Select your models, a launch command gets copied to your clipboard. Paste it in a new terminal.
38
52
 
39
- **Option B: Copy-paste config**
53
+ **Option C: Copy-paste config**
40
54
 
41
55
  Create `.claude/settings.json` in your project:
42
56
 
@@ -65,16 +79,26 @@ Then run `claude` as normal.
65
79
 
66
80
  ## Use with Codex CLI
67
81
 
82
+ The fastest path is the `codex` subcommand — it boots the proxy on a random port and spawns Codex CLI wired to it:
83
+
84
+ ```sh
85
+ npx github-router@latest codex
86
+ ```
87
+
88
+ Defaults to `gpt-5.5`; falls back to `gpt-5.4` → `gpt-5.3-codex` → `gpt-5.2-codex` if your Copilot tier doesn't expose 5.5 yet. Override with `-m`:
89
+
68
90
  ```sh
69
- npx github-router@latest start --codex
91
+ npx github-router@latest codex -m gpt-5.3-codex
70
92
  ```
71
93
 
72
- Or set the env vars yourself:
94
+ Or run the proxy and Codex CLI separately:
73
95
 
74
96
  ```sh
97
+ npx github-router@latest start --codex # interactive launch-command generator
98
+ # — or set env vars yourself —
75
99
  export OPENAI_BASE_URL="http://localhost:8787/v1"
76
100
  export OPENAI_API_KEY="dummy"
77
- codex --full-auto -m gpt-5.3-codex
101
+ codex --full-auto -m gpt-5.5
78
102
  ```
79
103
 
80
104
  ---
@@ -113,8 +137,10 @@ Anthropic endpoints are only available under `/v1/messages`.
113
137
  | Model | /chat/completions | /responses | /v1/messages |
114
138
  |---|---|---|---|
115
139
  | gpt-4.1, gpt-4o | Yes | Yes | No |
140
+ | gpt-5.5, gpt-5.4 | No | Yes | No |
116
141
  | gpt-5.3-codex, gpt-5.2-codex | No | Yes | No |
117
- | claude-opus-4.6, claude-sonnet-4.6 | Yes | No | Yes |
142
+ | claude-opus-4.7-1m-internal (enterprise), claude-opus-4.7 | Yes | No | Yes |
143
+ | claude-opus-4.6-1m, claude-opus-4.6, claude-sonnet-4.6 | Yes | No | Yes |
118
144
  | o3, o4-mini | Yes | Yes | No |
119
145
 
120
146
  </details>
@@ -169,11 +195,20 @@ docker run -p 8787:8787 -v $(pwd)/github-router-data:/root/.local/share/github-r
169
195
 
170
196
  ```
171
197
  github-router start [options] Start the proxy server
198
+ github-router claude [options] Start proxy + spawn Claude Code wired to it
199
+ github-router codex [options] Start proxy + spawn Codex CLI wired to it
172
200
  github-router auth Authenticate with GitHub
173
201
  github-router check-usage Show Copilot usage/quotas
174
202
  github-router debug Print diagnostic info
175
203
  ```
176
204
 
205
+ The `claude` and `codex` subcommands accept all the shared flags below plus `-m`/`--model` to override the default model. Default models live in `src/lib/port.ts`:
206
+
207
+ - `claude` → `claude-opus-4-7` (Anthropic dashed slug for UI compatibility; the proxy translates to Copilot's `claude-opus-4.7-1m-internal` on enterprise or `claude-opus-4.7` elsewhere). Major.minor fallback chain: `claude-opus-4-6` → `claude-opus-4-5`.
208
+ - `codex` → `gpt-5.5` → `gpt-5.4` → `gpt-5.3-codex` → `gpt-5.2-codex`
209
+
210
+ Fallback chains fire only on the implicit-default path; explicit `-m`/`--model` is always respected as-is.
211
+
177
212
  | Flag | Description | Default |
178
213
  |---|---|---|
179
214
  | `--port, -p` | Port | 8787 |