anygate 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/LICENSE +21 -0
- package/README.md +613 -0
- package/dist/chunk-OACEC5EH.js +10552 -0
- package/dist/chunk-OACEC5EH.js.map +1 -0
- package/dist/chunk-YYSUTRMV.js +390 -0
- package/dist/chunk-YYSUTRMV.js.map +1 -0
- package/dist/cli.js +12484 -0
- package/dist/cli.js.map +1 -0
- package/dist/command-SVHKYXNL.js +1452 -0
- package/dist/command-SVHKYXNL.js.map +1 -0
- package/dist/provider-templates-75KU6VA6.js +18 -0
- package/dist/provider-templates-75KU6VA6.js.map +1 -0
- package/dist/ui/public/app.js +2450 -0
- package/dist/ui/public/icon-antigravity-ide.png +0 -0
- package/dist/ui/public/icon-antigravity.png +0 -0
- package/dist/ui/public/index.html +217 -0
- package/dist/ui/public/style.css +1751 -0
- package/package.json +89 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ramanan-techlover
|
|
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,613 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/banner.svg" alt="anygate" width="100%">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# anygate
|
|
7
|
+
|
|
8
|
+
> Route any model into any coding agent — launch tools, switch providers, and run local API gateways.
|
|
9
|
+
|
|
10
|
+
[](https://www.npmjs.com/package/anygate)
|
|
11
|
+
[](https://www.npmjs.com/package/anygate)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
[](https://nodejs.org)
|
|
14
|
+
[]()
|
|
15
|
+
|
|
16
|
+
**anygate** is an interactive CLI — and a **visual launcher** — that connects AI coding tools to any provider and runs local API gateways on your machine. It supports **Claude Code**, **Claude Desktop (Cowork + Code)**, the **OpenAI Codex CLI**, the **ChatGPT desktop app in Codex mode (macOS + Windows)**, **Google Gemini CLI**, and experimental **Antigravity CLI / app / IDE** support.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Table of contents
|
|
21
|
+
|
|
22
|
+
- [Overview](#overview)
|
|
23
|
+
- [Features](#features)
|
|
24
|
+
- [Quick start](#quick-start)
|
|
25
|
+
- [Installation](#installation)
|
|
26
|
+
- [Supported tools](#supported-tools)
|
|
27
|
+
- [Commands](#commands)
|
|
28
|
+
- [Configuration](#configuration)
|
|
29
|
+
- [Usage](#usage)
|
|
30
|
+
- [Visual launcher](#visual-launcher-anygate-ui)
|
|
31
|
+
- [Launch Claude Code](#launch-claude-code)
|
|
32
|
+
- [Server mode](#server-mode)
|
|
33
|
+
- [OAuth providers](#oauth-providers)
|
|
34
|
+
- [Codex CLI](#codex-cli)
|
|
35
|
+
- [Claude Desktop](#claude-desktop)
|
|
36
|
+
- [ChatGPT / Codex app](#chatgpt--codex-app)
|
|
37
|
+
- [Gemini CLI](#gemini-cli)
|
|
38
|
+
- [Antigravity](#antigravity)
|
|
39
|
+
- [How it works](#how-it-works)
|
|
40
|
+
- [Troubleshooting](#troubleshooting)
|
|
41
|
+
- [Contributing](#contributing)
|
|
42
|
+
- [Disclaimer](#disclaimer)
|
|
43
|
+
- [License](#license)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Overview
|
|
48
|
+
|
|
49
|
+
Pick your backend:
|
|
50
|
+
|
|
51
|
+
- **Your providers** — configure once with `anygate providers` (Groq, Mistral, Nvidia, DeepSeek, custom OpenAI/Anthropic endpoints, and more)
|
|
52
|
+
- **OpenCode Zen / Go** — cloud models with your OpenCode API key (optional; add via `anygate providers`)
|
|
53
|
+
- **One-time OpenCode import** — bring existing OpenCode provider settings into the registry (`anygate providers import`)
|
|
54
|
+
- **Google Vertex AI** — Claude on Vertex via `anygate server --vertex` and local gcloud credentials (no OpenCode key required)
|
|
55
|
+
|
|
56
|
+
### Prerequisites
|
|
57
|
+
|
|
58
|
+
- Node.js 18+
|
|
59
|
+
- A supported AI coding tool installed (e.g. [Claude Code](https://www.npmjs.com/package/@anthropic-ai/claude-code), [OpenAI Codex](https://www.npmjs.com/package/@openai/codex), or [Google Gemini CLI](https://www.npmjs.com/package/@google/gemini-cli))
|
|
60
|
+
- At least one provider configured via `anygate providers add` or `import` — **or** an [OpenCode API key](https://opencode.ai/auth) for Zen/Go cloud backends
|
|
61
|
+
- [OpenCode CLI](https://opencode.ai) only if you want **one-time import** from an existing OpenCode setup (optional)
|
|
62
|
+
- For **Vertex gateway:** [Google Cloud SDK](https://cloud.google.com/sdk) with `gcloud auth application-default login`, a GCP project with Vertex AI enabled, and Claude partner models enabled in that project
|
|
63
|
+
- For **Antigravity CLI / app / IDE:** a Google account is still needed for Antigravity authentication. Do **not** use your main Google account. Use a throwaway or secondary account you can afford to lose.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Features
|
|
68
|
+
|
|
69
|
+
- **Visual launcher UI:** `anygate ui` opens a browser dashboard — launch any supported tool with a point-and-click model picker. Pick provider and model in the UI; the terminal opens straight to the running session with no second selection step. Manage providers and favorites without leaving the browser.
|
|
70
|
+
- **Server tab in the UI:** Run the same API gateway as `anygate server` — favorites-only or specific providers, discovery id masking for Claude Desktop / Cowork, local or network listen mode — from a browser form instead of a terminal wizard. Shows live URLs, the API key, and the full model catalog once started, with a one-click Stop.
|
|
71
|
+
- **Native provider registry:** `anygate providers` stores config in `~/.anygate/providers.json` and secrets in the OS keychain — no OpenCode binary required at launch. See **[docs/PROVIDERS.md](docs/PROVIDERS.md)** for a full list of providers and known issues.
|
|
72
|
+
- **Provider templates:** Add Groq, Mistral, Together, OpenRouter, and 15+ SDK-backed providers, plus custom OpenAI/Anthropic-compatible endpoints.
|
|
73
|
+
- **OpenCode import:** One-time import from OpenCode (`providers import`); validates API keys and skips placeholders like `anything`.
|
|
74
|
+
- **OpenCode Zen / Go:** Optional cloud backends when you have an OpenCode API key.
|
|
75
|
+
- **SDK adapter proxy:** Non-Anthropic providers route through the Vercel AI SDK (same packages OpenCode uses), so Claude Code still speaks Anthropic format. Labeled `(via proxy)` in the picker.
|
|
76
|
+
- **Favorite models:** Save up to 20 and switch mid-session with Claude Code's `/model` command.
|
|
77
|
+
- **Smart model pickers:** Recent models per provider, search for large lists (>25), paginated browse (15 per page).
|
|
78
|
+
- **Refresh model lists:** `anygate providers refresh-models` updates cached catalogs per provider.
|
|
79
|
+
- **API server:** Run a local gateway on port **17645** for Claude Code, Claude Desktop, or any Anthropic-compatible client.
|
|
80
|
+
- **Server wizard:** Filter exposed providers, mask discovery ids for Claude Desktop, optional favorites-only catalog, local vs network listen mode — available in the terminal (`anygate server`) or the `anygate ui` Server tab.
|
|
81
|
+
- **Vertex gateway:** Anthropic-compatible Claude on Google Vertex AI using gcloud Application Default Credentials.
|
|
82
|
+
- **Antigravity CLI / app / IDE support:** Experimental local Cloud Code gateway for Antigravity's native model picker. Read the account warning before using it.
|
|
83
|
+
- **Clean environment isolation:** Strips 17 conflicting env vars (Vertex AI, Bedrock, AWS, Foundry, stale Anthropic config) from the child process only. Never touches `~/.claude/settings.json` (see caveat below).
|
|
84
|
+
- **Secure key storage:** Per-provider keys and the OpenCode API key go in the OS credential store (macOS Keychain, Windows Credential Manager, Linux Secret Service) or your shell profile.
|
|
85
|
+
- **Cross-platform:** macOS, Windows, Linux (Ubuntu, Fedora, distros with GNOME Keyring or KWallet).
|
|
86
|
+
- **Dry run mode:** Walk through the full wizard and preview the launch command without starting anything.
|
|
87
|
+
- **Preference memory:** Last provider and model are pre-selected next time.
|
|
88
|
+
- **Agent / headless launch:** Boot flags (`--provider`, `--model`), clean NDJSON/JSONL stdout for automated agents, and `anygate --ai` reference — see **[docs/AI-AGENTS.md](docs/AI-AGENTS.md)**.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Quick start
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 1. Install globally
|
|
96
|
+
npm install -g anygate
|
|
97
|
+
|
|
98
|
+
# 2. Add a provider (or import from OpenCode once)
|
|
99
|
+
anygate providers add # pick a template or custom endpoint
|
|
100
|
+
|
|
101
|
+
# 3. Launch your tool of choice
|
|
102
|
+
anygate claude # pick provider + model → Claude Code
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
On first `anygate claude` run with an empty registry, an inline wizard walks you through Quick start (Zen), import, or opening `anygate providers`.
|
|
106
|
+
|
|
107
|
+
Prefer a browser? Run `anygate ui` for the visual launcher.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Installation
|
|
112
|
+
|
|
113
|
+
To install the CLI globally:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install -g anygate
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Upgrading
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
npm update -g anygate
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Uninstallation
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npm uninstall -g anygate
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
> [!NOTE]
|
|
132
|
+
> If you use a Node version manager like **NVM**, make sure you run the uninstall command using the active Node version that was used to install it (e.g., run `nvm use <version>` first).
|
|
133
|
+
|
|
134
|
+
To fully remove the tool and all its configuration data, delete the configuration directory (`.anygate`) on your operating system:
|
|
135
|
+
|
|
136
|
+
- **macOS / Linux**:
|
|
137
|
+
```bash
|
|
138
|
+
rm -rf ~/.anygate
|
|
139
|
+
```
|
|
140
|
+
- **Windows**:
|
|
141
|
+
- In Command Prompt:
|
|
142
|
+
```cmd
|
|
143
|
+
rmdir /s /q "%USERPROFILE%\.anygate"
|
|
144
|
+
```
|
|
145
|
+
- In PowerShell:
|
|
146
|
+
```powershell
|
|
147
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.anygate"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Supported tools
|
|
153
|
+
|
|
154
|
+
| Tool | Command | Status |
|
|
155
|
+
|------|---------|--------|
|
|
156
|
+
| **Visual launcher UI** | `anygate ui` | ✅ Supported — browser dashboard for all tools |
|
|
157
|
+
| Provider registry | `anygate providers` | ✅ Supported ([guide](docs/PROVIDERS.md)) |
|
|
158
|
+
| Claude Code | `anygate claude` | ✅ Supported |
|
|
159
|
+
| Favorite models | `anygate models` | ✅ Supported |
|
|
160
|
+
| OpenCode API server | `anygate server` | ✅ Supported |
|
|
161
|
+
| Vertex API gateway | `anygate server --vertex` | ✅ Supported |
|
|
162
|
+
| Claude Desktop (Cowork + Code) | `anygate claude-app` | ✅ Supported macOS + Windows ([guide](docs/CLAUDE_DESKTOP_SETUP.md)) |
|
|
163
|
+
| Codex CLI | `anygate codex` | ✅ Supported ([guide](docs/CODEX.md)) |
|
|
164
|
+
| ChatGPT desktop app (Codex mode) | `anygate codex-app` (alias `chatgpt`) | ✅ Supported macOS + Windows ([guide](docs/CODEX.md)) |
|
|
165
|
+
| Google Gemini CLI | `anygate gemini` | ⚠️ Experimental, model switching is done via `.model` prompt |
|
|
166
|
+
| Antigravity CLI | `anygate agy` | ⚠️ Experimental, use a throwaway Google account ([guide](docs/ANTIGRAVITY.md)) |
|
|
167
|
+
| Antigravity app | `anygate antigravity` | ⚠️ Experimental macOS + Windows support, use a throwaway Google account ([guide](docs/ANTIGRAVITY.md)) |
|
|
168
|
+
| Antigravity IDE | `anygate antigravity-ide` | ⚠️ Experimental macOS + Windows support, use a throwaway Google account ([guide](docs/ANTIGRAVITY.md)) |
|
|
169
|
+
| GitHub Copilot OAuth | `anygate providers auth github-copilot` | ✅ Device code flow ([guide](docs/SUBSCRIPTION-OAUTH.md)) |
|
|
170
|
+
| xAI SuperGrok OAuth | `anygate providers auth xai-oauth` | ✅ Device code flow ([guide](docs/SUBSCRIPTION-OAUTH.md)) |
|
|
171
|
+
| OpenAI ChatGPT OAuth | `anygate providers auth openai-oauth` | ✅ Device code flow ([guide](docs/SUBSCRIPTION-OAUTH.md)) |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Commands
|
|
176
|
+
|
|
177
|
+
| Command | Description |
|
|
178
|
+
|---------|-------------|
|
|
179
|
+
| `anygate` | Print help (does not launch Claude Code) |
|
|
180
|
+
| `anygate ui` | **Open the visual launcher** — manage providers and launch any tool from a browser UI |
|
|
181
|
+
| `anygate claude` | Pick a provider → launch Claude Code |
|
|
182
|
+
| `anygate providers` | Add, import, list, remove, and refresh your AI providers |
|
|
183
|
+
| `anygate models` | Manage favorite models for mid-session `/model` switching |
|
|
184
|
+
| `anygate server` | Foreground API gateway (registry providers + optional Zen/Go) |
|
|
185
|
+
| `anygate server --vertex` | Foreground Anthropic-compatible gateway to Claude on Vertex AI |
|
|
186
|
+
| `anygate claude-app` | Launch Claude Desktop app with registry providers ([guide](docs/CLAUDE_DESKTOP_SETUP.md)) |
|
|
187
|
+
| `anygate codex` | Launch OpenAI Codex CLI with registry providers ([guide](docs/CODEX.md)) |
|
|
188
|
+
| `anygate codex-app` (alias `chatgpt`) | Launch ChatGPT desktop app in Codex mode with registry providers ([guide](docs/CODEX.md)) |
|
|
189
|
+
| `anygate gemini` | Launch Google Gemini CLI with registry providers |
|
|
190
|
+
| `anygate agy` | Launch Antigravity CLI with anygate models ([warning + guide](docs/ANTIGRAVITY.md)) |
|
|
191
|
+
| `anygate antigravity` | Launch Antigravity app with anygate models, macOS ([warning + guide](docs/ANTIGRAVITY.md)) |
|
|
192
|
+
| `anygate antigravity-ide` | Launch Antigravity IDE with anygate models, macOS ([warning + guide](docs/ANTIGRAVITY.md)) |
|
|
193
|
+
| `anygate providers auth <id>` | Authenticate an OAuth provider (GitHub Copilot, xAI, OpenAI) |
|
|
194
|
+
| `anygate --ai` | Full agent reference for scripts and automated agents ([guide](docs/AI-AGENTS.md)) |
|
|
195
|
+
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
## Configuration
|
|
199
|
+
|
|
200
|
+
**Provider registry** (no secrets in this file):
|
|
201
|
+
|
|
202
|
+
```text
|
|
203
|
+
~/.anygate/providers.json
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Manage with `anygate providers`. API keys are stored in the OS keychain (`keyring:provider:<id>`).
|
|
207
|
+
|
|
208
|
+
**App preferences** — favorites, last provider/model, server settings, optional server password:
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
~/.anygate/config.json
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Override the config directory:
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
export ANYGATE_HOME="/path/to/your/anygate-home"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
The OpenCode API key (for Zen/Go) and per-provider keys are stored separately, based on what you chose during setup (Keychain, credential store, or shell profile).
|
|
221
|
+
|
|
222
|
+
### Credential storage
|
|
223
|
+
|
|
224
|
+
| Platform | Secure storage | Plaintext fallback |
|
|
225
|
+
|----------|---------------|-------------------|
|
|
226
|
+
| macOS | Keychain (optional: + `~/.zshrc` auto-load) | Shell profile |
|
|
227
|
+
| Windows | Credential Manager | `setx` user env var |
|
|
228
|
+
| Linux (desktop) | Secret Service (GNOME Keyring / KWallet) | Shell profile |
|
|
229
|
+
| Linux (headless) | n/a | Shell profile |
|
|
230
|
+
|
|
231
|
+
The key is active in your current session right away, no matter which option you pick. No terminal restart needed.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Usage
|
|
236
|
+
|
|
237
|
+
### Visual launcher (`anygate ui`)
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
anygate ui
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
Opens a browser-based dashboard on a random local port. From the UI you can:
|
|
244
|
+
|
|
245
|
+
- **Launch any supported tool** — app cards for Claude Code CLI, Codex CLI, Gemini CLI, Antigravity CLI, Antigravity App, Antigravity IDE, Claude Code Desktop, and the ChatGPT Desktop app (Codex mode). Select a provider and model in the card, then click **Launch** — a native terminal opens with the selection pre-wired. No second picker in the terminal.
|
|
246
|
+
- **Manage General Favorites** — the sidebar shows your saved favorite models with a slot indicator (Slots used X/20). Favorites launch through all supported agents.
|
|
247
|
+
- **Manage Antigravity Favorites** — separate favorites panel for Antigravity sessions.
|
|
248
|
+
- **Manage providers** — add providers from templates, delete providers, and refresh model lists inline, all without leaving the browser.
|
|
249
|
+
- **Run the Server tab** — configure and start the same gateway as `anygate server` (favorites-only or specific providers, discovery id masking, local/network listen mode) and see the resulting URLs, API key, and model catalog right in the browser. Runs in the same process as the UI, so it stops when you close the dashboard. See [Registry gateway](#registry-gateway-anygate-server) below for what each option does.
|
|
250
|
+
|
|
251
|
+
Press `Ctrl+C` in the terminal where `anygate ui` is running to shut down the dashboard server (this also stops the gateway if you started it from the Server tab).
|
|
252
|
+
|
|
253
|
+
### Launch Claude Code
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
anygate claude
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
First run: pick a provider from your registry (or complete the inline setup wizard). If you've added OpenCode Zen/Go, those appear alongside registry providers like Groq, Nvidia, or DeepSeek.
|
|
260
|
+
|
|
261
|
+
#### Favorite models and mid-session switching
|
|
262
|
+
|
|
263
|
+
Save the models you bounce between:
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
anygate models
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Add up to 20 favorites from Zen, Go, or any OpenCode-configured provider. When you have favorites, `anygate claude` starts a multi-route proxy automatically. Claude Code's `/model` command lists your starting model plus favorites. Switch live, no restart.
|
|
270
|
+
|
|
271
|
+
No favorites? Launch works like before: single model, no switch menu. `--dry-run` ignores saved favorites so you can preview a single-model launch.
|
|
272
|
+
|
|
273
|
+
#### `anygate claude` options
|
|
274
|
+
|
|
275
|
+
| Flag | Description |
|
|
276
|
+
|------|-------------|
|
|
277
|
+
| `--dry-run` | Run the full wizard but preview the launch command instead of executing |
|
|
278
|
+
| `--setup` | Reminder to use `anygate providers` for provider setup |
|
|
279
|
+
| `--trace` | Write debug logs to `~/.anygate/logs/` and show errors on exit |
|
|
280
|
+
| `--help` | Show command help |
|
|
281
|
+
| `--version` | Show version |
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
anygate claude --dry-run
|
|
285
|
+
anygate claude --setup
|
|
286
|
+
anygate claude --trace
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
Claude Code flags and session IDs pass through unchanged:
|
|
290
|
+
|
|
291
|
+
```bash
|
|
292
|
+
anygate claude -c
|
|
293
|
+
anygate claude --resume abc-123
|
|
294
|
+
anygate claude abc-123
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
**Non-interactive / agent launch** — skip the wizard with boot flags:
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
anygate claude --provider groq --model llama-3.3-70b-versatile -p "Summarize README.md"
|
|
301
|
+
anygate claude --model zen__deepseek-v4-flash-free -p "task" --output-format stream-json
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
| Flag | Description |
|
|
305
|
+
|------|-------------|
|
|
306
|
+
| `--provider` | Boot provider id (skip wizard with `--model` or in print mode) |
|
|
307
|
+
| `--model` | Boot model id, or slug `provider__model-id` |
|
|
308
|
+
|
|
309
|
+
For agent integrations, NDJSON streaming, Codex `exec --json`, and sandbox defaults, see **[docs/AI-AGENTS.md](docs/AI-AGENTS.md)** and run `anygate --ai`.
|
|
310
|
+
|
|
311
|
+
Use `--` when you want every following token passed directly to Claude Code:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
anygate claude -- --print "hello"
|
|
315
|
+
anygate claude -- --dangerously-skip-permissions
|
|
316
|
+
anygate claude --dry-run -- --print "test"
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Server mode
|
|
320
|
+
|
|
321
|
+
Run anygate as a foreground API gateway on port **17645**:
|
|
322
|
+
|
|
323
|
+
| Mode | Command | Auth | Models |
|
|
324
|
+
|------|---------|------|--------|
|
|
325
|
+
| **Registry gateway** | `anygate server` | Per-provider keys in registry (+ OpenCode key for Zen/Go if exposed) | Providers you configured |
|
|
326
|
+
| **Vertex gateway** | `anygate server --vertex` | gcloud Application Default Credentials | Claude on Vertex AI |
|
|
327
|
+
|
|
328
|
+
> **Claude Desktop (Cowork + Code):** For the automated macOS/Windows setup, use `anygate claude-app`. For manual or network setups, see [docs/CLAUDE_DESKTOP_SETUP.md](docs/CLAUDE_DESKTOP_SETUP.md).
|
|
329
|
+
|
|
330
|
+
#### Registry gateway (`anygate server`)
|
|
331
|
+
|
|
332
|
+
Works with any providers in your registry. Zen/Go models appear when you have an OpenCode API key and those providers are exposed.
|
|
333
|
+
|
|
334
|
+
The wizard asks:
|
|
335
|
+
|
|
336
|
+
| Prompt | What it does |
|
|
337
|
+
|--------|--------------|
|
|
338
|
+
| **Configure & start** vs **Start with saved settings** | Full wizard or one-step launch from saved server preferences |
|
|
339
|
+
| **Exposed providers** | Limit which providers appear in the catalog (Zen, Go, Groq, OpenAI, etc.) |
|
|
340
|
+
| **Mask gateway model ids for discovery?** | Recommended **Yes** for Claude Desktop — hides competitor vendor strings in model ids so discovery works |
|
|
341
|
+
| **Expose only favorite models?** | Optional cap at your favorites (manage with `anygate models`) |
|
|
342
|
+
| **Listen mode** | **Local only** (`127.0.0.1`) or **Network** (`0.0.0.0` + server password) |
|
|
343
|
+
|
|
344
|
+
The same options are available without a terminal in the [Server tab of `anygate ui`](#visual-launcher-anygate-ui), which also shows the resulting URLs, API key, and model catalog live.
|
|
345
|
+
|
|
346
|
+
After you configure the server once, start it without prompts:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
anygate server --quick
|
|
350
|
+
# same as:
|
|
351
|
+
anygate server --saved
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Any one-run server option also skips the wizard:
|
|
355
|
+
|
|
356
|
+
| Option | Meaning |
|
|
357
|
+
|--------|---------|
|
|
358
|
+
| `--listen local\|network` | Override the saved listen mode for this run |
|
|
359
|
+
| `--providers all\|favorites\|id1,id2` | Expose all providers, favorites only, or a comma-separated provider id list |
|
|
360
|
+
| `--free-only` / `--no-free-only` | Enable or disable the free/free-access model filter for this run |
|
|
361
|
+
| `--mask-gateway-ids` / `--no-mask-gateway-ids` | Enable or disable discovery id masking for this run |
|
|
362
|
+
| `--password <value>` | One-run password for network mode when you do not want to use a saved password |
|
|
363
|
+
|
|
364
|
+
Non-interactive shells (scripts, services, CI, pipes) use quick mode automatically. If quick mode resolves to network mode, anygate uses `--password` first, then a saved server password; without either it exits with a clear error instead of prompting.
|
|
365
|
+
|
|
366
|
+
**Local mode** — point any Anthropic-compatible client at your machine:
|
|
367
|
+
|
|
368
|
+
```bash
|
|
369
|
+
export ANTHROPIC_BASE_URL="http://127.0.0.1:17645/anthropic"
|
|
370
|
+
export ANTHROPIC_API_KEY="anything"
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
**Network mode** — other devices on your LAN:
|
|
374
|
+
|
|
375
|
+
```bash
|
|
376
|
+
export ANTHROPIC_BASE_URL="http://<server-ip>:17645/anthropic"
|
|
377
|
+
export ANTHROPIC_API_KEY="<server-password>"
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
By default the server password stays in memory only. If you choose to save it, anygate stores it in the OS credential store when available, with `~/.anygate/config.json` as a fallback.
|
|
381
|
+
|
|
382
|
+
OpenAI-format models also get an OpenAI-compatible endpoint:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
export OPENAI_BASE_URL="http://127.0.0.1:17645/openai/v1"
|
|
386
|
+
export OPENAI_API_KEY="anything"
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
Health check:
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
curl -s http://127.0.0.1:17645/health
|
|
393
|
+
curl -s http://127.0.0.1:17645/anthropic/v1/models | head
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
The spinner reports how many models loaded and how many came from registry providers.
|
|
397
|
+
|
|
398
|
+
#### Vertex gateway (`anygate server --vertex`)
|
|
399
|
+
|
|
400
|
+
Anthropic-compatible gateway to Claude on Google Vertex AI. No OpenCode API key required.
|
|
401
|
+
|
|
402
|
+
**Setup:**
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
gcloud auth application-default login
|
|
406
|
+
export ANTHROPIC_VERTEX_PROJECT_ID="your-gcp-project" # or GOOGLE_CLOUD_PROJECT
|
|
407
|
+
export GOOGLE_CLOUD_LOCATION="global" # optional; default: global
|
|
408
|
+
anygate server --vertex
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
**Default models:** `claude-sonnet-4-6`, `claude-opus-4-6`, `claude-haiku-4-5`
|
|
412
|
+
|
|
413
|
+
**Shorthand aliases** (for Claude Code `/model` and `settings.json`): `sonnet`, `opus`, `haiku`. Append `[1m]` for 1M context on Sonnet and Opus only (Haiku stays 200k).
|
|
414
|
+
|
|
415
|
+
**Custom catalog:** copy `assets/vertex-models.example.json` to `~/.anygate/vertex-models.json` and edit. Override the config directory with `ANYGATE_HOME`.
|
|
416
|
+
|
|
417
|
+
When the gateway is running:
|
|
418
|
+
|
|
419
|
+
```bash
|
|
420
|
+
export ANTHROPIC_BASE_URL="http://127.0.0.1:17645/anthropic"
|
|
421
|
+
export ANTHROPIC_API_KEY="anything"
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
**Claude Code tip:** When routing through the gateway, unset native Vertex env vars so Claude Code doesn't bypass the proxy:
|
|
425
|
+
|
|
426
|
+
```bash
|
|
427
|
+
unset CLAUDE_CODE_USE_VERTEX ANTHROPIC_VERTEX_PROJECT_ID CLOUD_ML_REGION
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### OAuth providers
|
|
431
|
+
|
|
432
|
+
anygate supports OAuth providers that use device-code sign-in, so you can connect an existing subscription without pasting an API key. See **[docs/SUBSCRIPTION-OAUTH.md](docs/SUBSCRIPTION-OAUTH.md)** for setup details.
|
|
433
|
+
|
|
434
|
+
Device code flows for existing subscriptions:
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
anygate providers auth github-copilot # GitHub Copilot
|
|
438
|
+
anygate providers auth openai-oauth # ChatGPT Plus / Pro
|
|
439
|
+
anygate providers auth xai-oauth # xAI SuperGrok
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Codex CLI (`anygate codex`)
|
|
443
|
+
|
|
444
|
+
Launch [OpenAI Codex CLI](https://developers.openai.com/codex/cli) with registry providers. Requires `npm install -g @openai/codex`.
|
|
445
|
+
|
|
446
|
+
```bash
|
|
447
|
+
anygate providers add # Anthropic, xAI, OpenAI, etc.
|
|
448
|
+
anygate codex # pick provider + model → Codex TUI
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
anygate writes a **temporary** profile (`~/.codex/anygate-launch.config.toml`) and removes it when Codex exits. After a crash: `anygate codex --restore`.
|
|
452
|
+
|
|
453
|
+
**Sandbox / network:** `anygate codex` defaults to **`danger-full-access`** (profile + `-s` flag) so shell tools like `curl`, `nlm`, and npm can reach the network. Override for one session:
|
|
454
|
+
|
|
455
|
+
```bash
|
|
456
|
+
anygate codex -s workspace-write
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
Pass Codex flags directly after `anygate codex` — you do **not** need `--` before `-s`. Codex's `--dangerously-bypass-approvals-and-sandbox` also passes through if you need it.
|
|
460
|
+
|
|
461
|
+
Full details: **[docs/CODEX.md](docs/CODEX.md)** — CLI + desktop app, configs, restore, sandbox, routing.
|
|
462
|
+
|
|
463
|
+
For agent integration (boot flags, NDJSON, JSONL): **[docs/AI-AGENTS.md](docs/AI-AGENTS.md)** and `anygate --ai`.
|
|
464
|
+
|
|
465
|
+
### Claude Desktop
|
|
466
|
+
|
|
467
|
+
Launch **Claude Desktop** (macOS or Windows) with registry providers:
|
|
468
|
+
|
|
469
|
+
```bash
|
|
470
|
+
anygate claude-app
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
This command automates the "Third-Party Inference" (Developer Mode) setup. It temporarily configures Claude Desktop to point at a local gateway, launches the app, and routes traffic to your chosen provider.
|
|
474
|
+
|
|
475
|
+
- **Keep the terminal open:** The proxy runs in the foreground.
|
|
476
|
+
- **Ctrl+C to restore:** When you're done, press `Ctrl+C` in the terminal to automatically restore Claude Desktop to its normal Anthropic cloud mode.
|
|
477
|
+
- **Cleanup:** If the terminal crashes, run `anygate claude-app --restore`.
|
|
478
|
+
|
|
479
|
+
For manual network setups (e.g., remote cloud desktop), you can still use `anygate server`. See the full [Claude Desktop Setup Guide](docs/CLAUDE_DESKTOP_SETUP.md).
|
|
480
|
+
|
|
481
|
+
### ChatGPT / Codex app (`anygate codex-app`, alias `anygate chatgpt`)
|
|
482
|
+
|
|
483
|
+
> OpenAI merged the standalone Codex app into the ChatGPT desktop app on 2026-07-09 — it's now named "ChatGPT" on disk (bundle id and config format unchanged) and opens in Codex mode for existing Codex users. `anygate codex-app` and `anygate chatgpt` are the same command.
|
|
484
|
+
|
|
485
|
+
Launch the **ChatGPT app in Codex mode** (macOS or Windows) with registry providers:
|
|
486
|
+
|
|
487
|
+
```bash
|
|
488
|
+
anygate codex-app
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
Patches `~/.codex/config.toml` with backup; **Ctrl+C** in the anygate terminal asks whether to close ChatGPT Desktop and restore your config (choose "No, keep session running" to decline and keep going). The app keeps Codex's built-in `openai` provider active so existing conversation history remains visible, and routes the selected model through a foreground local proxy. Preview config without writing: `anygate codex-app --config`. Recovery: `anygate codex-app --restore`.
|
|
492
|
+
|
|
493
|
+
See **[docs/CODEX.md](docs/CODEX.md)** for CLI vs app differences, file ownership, and troubleshooting.
|
|
494
|
+
|
|
495
|
+
> **Known limitation — MCP tools (Context7, chrome-devtools, etc.) don't work with non-native models.** Codex wraps local `[mcp_servers.*]` tools in a proprietary, undocumented format that only Codex's own ChatGPT backend can dispatch. When routed through anygate (or *any* non-native model provider — this also affects Ollama, OpenRouter, LiteLLM, LM Studio identically), the model can see and call the tools, but Codex's own dispatcher rejects every call with `unsupported call: ...`. This is a confirmed, currently open upstream bug ([openai/codex#20652](https://github.com/openai/codex/issues/20652)) — there is no workaround on anygate's side. MCP tools work normally with Codex's native OpenAI/ChatGPT models. See the [MCP troubleshooting row in docs/CODEX.md](docs/CODEX.md#troubleshooting) for details.
|
|
496
|
+
|
|
497
|
+
**Reasoning effort:** Capable models show Codex's native reasoning picker (low/medium/high, etc.). anygate maps your choice to each provider's SDK options and preserves existing `model_reasoning_effort` in Codex config. Claude Code `/effort` and the `anygate server` gateway use the same mapping — see the [reasoning section in docs/CODEX.md](docs/CODEX.md#reasoning-effort).
|
|
498
|
+
|
|
499
|
+
### Gemini CLI (`anygate gemini`)
|
|
500
|
+
|
|
501
|
+
Launch the [Google Gemini CLI](https://www.npmjs.com/package/@google/gemini-cli) with registry providers.
|
|
502
|
+
|
|
503
|
+
```bash
|
|
504
|
+
anygate gemini
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
Pick provider → pick model → Gemini prompt loop opens. Non-interactive tasks with streaming NDJSON are also fully supported:
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
anygate gemini --provider google --model gemini-2.5-flash -p "Review this file" -o stream-json
|
|
511
|
+
```
|
|
512
|
+
|
|
513
|
+
For agent integration (boot flags, NDJSON): **[docs/AI-AGENTS.md](docs/AI-AGENTS.md)** and `anygate --ai`.
|
|
514
|
+
|
|
515
|
+
### Antigravity
|
|
516
|
+
|
|
517
|
+
anygate can launch the Antigravity CLI, standalone Antigravity app, and Antigravity IDE through a local Cloud Code gateway. This lets Antigravity's native model picker show anygate models from your configured providers.
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
anygate agy
|
|
521
|
+
anygate antigravity
|
|
522
|
+
anygate antigravity-ide
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
> ⚠️ **Do not use your main Google account with Antigravity support.**
|
|
526
|
+
>
|
|
527
|
+
> Antigravity still requires Google authentication before it will run. anygate routes Cloud Code generation through your local gateway, but the Antigravity CLI, app, and IDE are still Google software and may contact Google for auth, telemetry, updates, or account checks.
|
|
528
|
+
>
|
|
529
|
+
> This kind of use is probably not what Google intended, may violate Google's terms of service, and could lead to account restrictions or bans. Use a throwaway Google account, a secondary account, or another account you can afford to lose. A free Google account should be enough for authentication. Seriously, don't risk your real Gmail, Workspace, YouTube, Drive, or business account for this.
|
|
530
|
+
|
|
531
|
+
Read the full setup and risk notes in **[docs/ANTIGRAVITY.md](docs/ANTIGRAVITY.md)** before launching any Antigravity surface.
|
|
532
|
+
|
|
533
|
+
---
|
|
534
|
+
|
|
535
|
+
## How it works
|
|
536
|
+
|
|
537
|
+
### OpenCode Zen / Go filtering
|
|
538
|
+
|
|
539
|
+
When OpenCode Zen is in your registry, `subscriptionFilter` controls which Zen models appear (`free` = free tier only; default = all Zen models). Add or change Zen via `anygate providers`.
|
|
540
|
+
|
|
541
|
+
### Environment isolation
|
|
542
|
+
|
|
543
|
+
When you launch, anygate builds a clean child environment:
|
|
544
|
+
|
|
545
|
+
1. Removes 17 conflicting env vars from the child process (Vertex AI, Bedrock, AWS, Foundry, stale Anthropic config)
|
|
546
|
+
2. Sets `ANTHROPIC_BASE_URL`, `ANTHROPIC_API_KEY`, and `ANTHROPIC_MODEL` for the session
|
|
547
|
+
3. Passes `--model <selected>` to Claude Code as a backup override
|
|
548
|
+
|
|
549
|
+
When Claude Code exits (normal exit, Ctrl+C, terminal close), your shell is unchanged. No cleanup step. No restore needed.
|
|
550
|
+
|
|
551
|
+
**Caveat: Claude Code persists the model.** anygate doesn't edit `~/.claude/settings.json`, but Claude Code saves the model you launched with (via `--model` and `ANTHROPIC_MODEL`). A later bare `claude` launch may still show that model, e.g. `anthropic-opencode-go__deepseek-v4-flash` from a prior anygate session. To get back to a first-party default, run `claude --model sonnet` (or your preferred Claude model), or remove the `"model"` key from `~/.claude/settings.json`. If you used the favorites switch menu, Claude Code may also cache the gateway catalog at `~/.claude/cache/gateway-models.json`. Delete that file if `/model` shows stale entries from a dead proxy.
|
|
552
|
+
|
|
553
|
+
### Model compatibility
|
|
554
|
+
|
|
555
|
+
OpenCode exposes models through different API formats. anygate handles them when it can:
|
|
556
|
+
|
|
557
|
+
| Model format | Examples | How it works | Label |
|
|
558
|
+
|---|---|---|---|
|
|
559
|
+
| Anthropic native | Claude, Qwen, MiniMax (Go) | Direct connection | *(none)* |
|
|
560
|
+
| OpenAI chat completions | DeepSeek, Kimi, MiMo, GLM, Grok, GPT-4o (OpenCode OpenAI provider) | SDK adapter proxy (Vercel AI SDK) | `via proxy` |
|
|
561
|
+
| OpenAI Responses API | GPT-5.4+, GPT-5.5, Codex, o-series (OpenCode OpenAI provider only) | Same proxy; SDK picks Responses API | `via proxy` |
|
|
562
|
+
| Gemini native | Gemini (OpenCode Google provider) | SDK adapter, Gemini native API | `via proxy` |
|
|
563
|
+
| Other SDK providers | Cerebras, Perplexity, Bedrock, Vertex, Together AI, etc. | Whatever `api.npm` OpenCode assigns | `via proxy` |
|
|
564
|
+
| Not in cloud wizard | GPT, Gemini on OpenCode Zen/Go | Use an OpenCode-configured provider instead (OpenAI/Google in OpenCode config) | `not yet supported` |
|
|
565
|
+
|
|
566
|
+
The SDK adapter proxy starts on a random local port for proxy-routed models and stops when Claude Code exits. Each `anygate claude` session gets its own port, so multiple terminals are fine. (`anygate server` uses fixed port `17645`. One server instance per machine.)
|
|
567
|
+
|
|
568
|
+
### Provider notes
|
|
569
|
+
|
|
570
|
+
**Mistral (free tier):** Rate limits are tight. Expect HTTP 429 during tool-heavy sessions. Claude Code retries with backoff. That's Mistral throttling, not a proxy bug.
|
|
571
|
+
|
|
572
|
+
**OpenAI (OpenCode-configured provider):** Configure OpenAI in [OpenCode](https://opencode.ai) with your API key, then pick the OpenAI provider at launch. Newer GPT models use OpenAI's Responses API. The SDK picks `responses` vs `chat` from the model ID. OpenCode catalog IDs can differ from API IDs (e.g. `gpt-5.5-fast` maps to upstream `gpt-5.5`). If you see "model not available", run `anygate claude --trace` and check `~/.anygate/logs/claude-debug.log`.
|
|
573
|
+
|
|
574
|
+
`CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1` is set for direct (non-proxy) routes only. Proxy sessions keep tool-search betas.
|
|
575
|
+
|
|
576
|
+
### API key storage
|
|
577
|
+
|
|
578
|
+
anygate uses [`@napi-rs/keyring`](https://www.npmjs.com/package/@napi-rs/keyring) for the OS credential store. On later runs it checks silently. Key found? Wizard skips the prompt.
|
|
579
|
+
|
|
580
|
+
| Platform | Credential store | Notes |
|
|
581
|
+
|----------|-----------------|-------|
|
|
582
|
+
| macOS | macOS Keychain | Optional `~/.zshrc` auto-load line for system-wide availability |
|
|
583
|
+
| Windows | Windows Credential Manager | `setx` available as plaintext alternative |
|
|
584
|
+
| Linux (desktop) | Secret Service API (GNOME Keyring, KWallet) | Needs a running keyring daemon |
|
|
585
|
+
| Linux (headless) | Not available | Falls back to shell profile or session-only |
|
|
586
|
+
|
|
587
|
+
If the native module fails to load, credential store options are skipped and you get shell profile / session-only storage.
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
## Troubleshooting
|
|
592
|
+
|
|
593
|
+
See **[docs/TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md)** for common issues — especially **"Not logged in"** after accidentally choosing **No** on Claude Code's custom API key prompt.
|
|
594
|
+
|
|
595
|
+
---
|
|
596
|
+
|
|
597
|
+
## Contributing
|
|
598
|
+
|
|
599
|
+
Contributions are welcome. Issues and pull requests are welcome on GitHub.
|
|
600
|
+
|
|
601
|
+
---
|
|
602
|
+
|
|
603
|
+
## Disclaimer
|
|
604
|
+
|
|
605
|
+
This project and its creator have **no affiliation** with OpenCode, Anthropic, Claude, Google, GitHub, OpenAI, xAI, or any other vendor named or integrated here. Trademarks belong to their respective owners.
|
|
606
|
+
|
|
607
|
+
anygate routes inference through services you configure yourself (OpenCode Zen/Go, OpenCode-configured providers, Vertex AI, and gateways you run locally). Use at your own risk.
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
## License
|
|
612
|
+
|
|
613
|
+
MIT
|