@js4683/auto-router 0.1.0
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/CHANGELOG.md +13 -0
- package/LICENSE +21 -0
- package/README.md +148 -0
- package/dist/cli.js +7150 -0
- package/dist/cli.js.map +7 -0
- package/package.json +36 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Preparing the first public `@js4683/auto-router` npm package and consumer CLI.
|
|
6
|
+
|
|
7
|
+
## 0.1.0
|
|
8
|
+
|
|
9
|
+
- Local loopback proxy for OpenAI, Anthropic, Gemini, Antigravity, xAI, and OpenCode-compatible clients.
|
|
10
|
+
- Provider login through the CLI or local settings page.
|
|
11
|
+
- Managed client setup for Claude Code, Codex, OpenCode, and Cursor.
|
|
12
|
+
- Local-only default at `127.0.0.1:8787`.
|
|
13
|
+
- Experimental release: live provider coverage, real-client installer behavior, and some OAuth/provider acceptance paths remain unverified.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Jashanpreet Singh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# auto-router
|
|
2
|
+
|
|
3
|
+
`auto-router` is a local model router for AI coding clients. It keeps a task on one
|
|
4
|
+
model when possible, moves harder work to stronger models, and lets you use several
|
|
5
|
+
provider accounts through one local endpoint.
|
|
6
|
+
|
|
7
|
+
This is an experimental release. It runs on your computer and does not host models or
|
|
8
|
+
provide API credits.
|
|
9
|
+
|
|
10
|
+
## Requirements
|
|
11
|
+
|
|
12
|
+
- Node.js 22 or newer
|
|
13
|
+
- At least one provider account or API key
|
|
14
|
+
- A supported client: Claude Code, OpenCode, Codex, Cursor, or another compatible client
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
After the npm release is available:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install --global @js4683/auto-router
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
You can also run it without a global install:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx @js4683/auto-router
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Until the npm release is published, run the current source checkout instead:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git clone https://github.com/js4683/auto-router.git
|
|
34
|
+
cd auto-router
|
|
35
|
+
npm ci --ignore-scripts --no-audit --no-fund
|
|
36
|
+
npm run build
|
|
37
|
+
node dist/cli.js
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Start
|
|
41
|
+
|
|
42
|
+
Start the local proxy:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
auto-router
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The default address is `http://127.0.0.1:8787`. Open that address in a browser to see
|
|
49
|
+
provider status, connect accounts, add API keys, and view recent routes.
|
|
50
|
+
|
|
51
|
+
Keep the proxy running while your client uses it.
|
|
52
|
+
|
|
53
|
+
## Connect A Provider
|
|
54
|
+
|
|
55
|
+
You can connect accounts from the browser at `http://127.0.0.1:8787`, or use the CLI:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
auto-router login claude
|
|
59
|
+
auto-router login codex
|
|
60
|
+
auto-router login gemini
|
|
61
|
+
auto-router login antigravity
|
|
62
|
+
auto-router login grok
|
|
63
|
+
auto-router login zen
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The login names are aliases for Anthropic, OpenAI, Google, xAI, and OpenCode Zen. API
|
|
67
|
+
keys can be entered in the local settings page. They are stored locally with restricted
|
|
68
|
+
file permissions.
|
|
69
|
+
|
|
70
|
+
Google Antigravity login needs a Google Desktop OAuth client that you control. The
|
|
71
|
+
client ID is not bundled with auto-router.
|
|
72
|
+
|
|
73
|
+
## Configure Your Client
|
|
74
|
+
|
|
75
|
+
Let the installer update supported client settings:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
auto-router install --opencode
|
|
79
|
+
auto-router install --claude
|
|
80
|
+
auto-router install --codex
|
|
81
|
+
auto-router install --cursor
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
To configure every supported client, omit the client flags:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
auto-router install
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Review existing settings before installing. Conflicting values are preserved rather
|
|
91
|
+
than overwritten. To remove unchanged auto-router settings:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
auto-router install --uninstall
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
You can also configure a client manually:
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
Claude Code: ANTHROPIC_BASE_URL=http://127.0.0.1:8787
|
|
101
|
+
Codex: OPENAI_BASE_URL=http://127.0.0.1:8787/v1
|
|
102
|
+
OpenAI API: http://127.0.0.1:8787/v1
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
In OpenCode, select the `auto-router/auto` model after adding the provider.
|
|
106
|
+
|
|
107
|
+
## Safety
|
|
108
|
+
|
|
109
|
+
- The proxy listens on loopback by default.
|
|
110
|
+
- Do not expose it to your network unless you have secured the surrounding boundary.
|
|
111
|
+
- Credentials stay in your local configuration; do not commit `.env` or auth files.
|
|
112
|
+
- Provider credentials are not interchangeable. auto-router does not send an API key or
|
|
113
|
+
OAuth token to a different provider.
|
|
114
|
+
- `auto-router --help` and `auto-router install --help` show the available commands.
|
|
115
|
+
|
|
116
|
+
## Troubleshooting
|
|
117
|
+
|
|
118
|
+
Check that the proxy is running, then visit:
|
|
119
|
+
|
|
120
|
+
```text
|
|
121
|
+
http://127.0.0.1:8787/health
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
If a client still uses its original provider, check its base URL and restart the client.
|
|
125
|
+
If the installer reports a conflict, keep the existing setting and configure the base
|
|
126
|
+
URL manually or remove only the setting you own.
|
|
127
|
+
|
|
128
|
+
## Current Limitations
|
|
129
|
+
|
|
130
|
+
The package is local and experimental. Live coverage for every provider, Google browser
|
|
131
|
+
OAuth, real-client installer behavior, and some account rotation paths still need
|
|
132
|
+
separate verification. Offline tests and package checks are not proof of successful live
|
|
133
|
+
inference or provider quota behavior.
|
|
134
|
+
|
|
135
|
+
## For Contributors
|
|
136
|
+
|
|
137
|
+
The [project plan](PLAN.md) contains the implementation status and evidence boundaries.
|
|
138
|
+
The [audit](docs/plans/2026-09-06-proxy-account-audit.md) records open release blockers.
|
|
139
|
+
|
|
140
|
+
Run the local checks from the repository root:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npm run build
|
|
144
|
+
npm test
|
|
145
|
+
npm run package:smoke
|
|
146
|
+
npm run release:check
|
|
147
|
+
git diff --check
|
|
148
|
+
```
|