@jiayunxie/aerial 0.1.4 → 0.1.5

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
@@ -25,9 +25,8 @@ aerial login
25
25
  aerial key generate
26
26
  aerial key print
27
27
  aerial start
28
- aerial setup codex
29
- aerial setup claude --model <available-copilot-model-id>
30
- aerial setup all
28
+ aerial setup codex [--model <responses-model-id>]
29
+ aerial setup claude [--model <messages-model-id>]
31
30
  aerial setup status
32
31
  aerial setup restore <codex|claude|all> --latest
33
32
  aerial service install
@@ -85,10 +84,12 @@ node src/cli.js --help
85
84
 
86
85
  ## First Run
87
86
 
88
- Configure your local clients. This also creates Aerial's local API key and wires it into supported clients:
87
+ Configure the local client you use. These commands also create Aerial's local API key and wire it into the selected client:
89
88
 
90
89
  ```bash
91
- aerial setup all --model <available-copilot-model-id>
90
+ aerial setup codex
91
+ # optional, if you use Claude Code too:
92
+ aerial setup claude
92
93
  ```
93
94
 
94
95
  If Codex or Claude Code was already open, restart it after setup so it rereads the updated client config.
@@ -99,10 +100,10 @@ Log in to GitHub with device flow:
99
100
  aerial login
100
101
  ```
101
102
 
102
- Start the local server:
103
+ Install and start the background service:
103
104
 
104
105
  ```bash
105
- aerial start
106
+ aerial service install
106
107
  ```
107
108
 
108
109
  Check health:
@@ -116,7 +117,7 @@ curl http://127.0.0.1:18181/health
116
117
  Aerial configures Codex through the Responses wire API provider path:
117
118
 
118
119
  ```bash
119
- aerial setup codex --model <available-copilot-model-id>
120
+ aerial setup codex
120
121
  ```
121
122
 
122
123
  This updates `~/.codex/config.toml` and creates a timestamped backup first. If you only want to inspect the exact change, set `HOME`/`USERPROFILE` to a temporary directory before running setup. The inserted provider uses:
@@ -158,6 +159,8 @@ This updates `~/.claude/settings.json` and creates a timestamped backup first. I
158
159
 
159
160
  The `model` field is written when you pass `--model` or set Aerial's `defaultModel`; otherwise Aerial leaves any existing Claude Code model choice alone while still switching the gateway to the local Aerial endpoint.
160
161
 
162
+ If you need explicit models, pass `--model <responses-model-id>` to `aerial setup codex` and `--model <messages-model-id>` to `aerial setup claude`. Aerial intentionally does not provide `aerial setup all` as a setup shortcut because Codex and Claude Code may need different model IDs.
163
+
161
164
  `aerial key print` prints the locally stored Aerial API key for Claude Code's helper flow. Users normally do not need to call it directly.
162
165
 
163
166
  When switching from another Anthropic-compatible gateway, setup removes stale `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_MODEL`, and `ANTHROPIC_DEFAULT_*_MODEL` entries from Claude Code's managed `env` block so `apiKeyHelper` and the Aerial gateway are the active route.
@@ -186,7 +189,7 @@ Aerial is for personal local use only.
186
189
  - Copilot inference routes are an observed compatibility target, not a public stable GitHub REST API.
187
190
  - `/v1/messages/count_tokens` is a local estimate, not upstream tokenization.
188
191
  - Bundled service management is implemented for macOS (launchd) and Windows (Task Scheduler). On Linux, run `aerial start` directly or wrap it in your own init system.
189
- - Model choice is not automated; query `/v1/models` and select an available model explicitly.
192
+ - For explicit model overrides, query `/v1/models`, choose a `responses` model for Codex and a `messages` model for Claude Code, then rerun the client-specific setup command with `--model`.
190
193
  - Chat Completions requests normalize `max_tokens` to `max_completion_tokens` for newer OpenAI models that reject the older field.
191
194
  - Prompt caching is upstream-managed: Aerial does not store prompt bodies locally, and it preserves or injects cache protocol fields before forwarding.
192
195
 
package/docs/usage.md CHANGED
@@ -23,10 +23,12 @@ node src/cli.js --help
23
23
  ## 2. Configure Local Clients
24
24
 
25
25
  ```bash
26
- aerial setup all --model <model-id>
26
+ aerial setup codex
27
+ # optional, if you use Claude Code too:
28
+ aerial setup claude
27
29
  ```
28
30
 
29
- Aerial creates a local API key, stores it privately, and configures supported clients to use it. If Codex or Claude Code was already open, restart it after setup so it rereads the updated client config.
31
+ Aerial creates a local API key, stores it privately, and configures the selected clients to use it. There is intentionally no `aerial setup all` setup shortcut: Codex and Claude Code can need different model IDs, so setup stays client-specific. If Codex or Claude Code was already open, restart it after setup so it rereads the updated client config.
30
32
 
31
33
  ## 3. Login To GitHub
32
34
 
@@ -39,15 +41,15 @@ Open the printed URL, enter the user code, and authorize the GitHub OAuth device
39
41
  ## 4. Start Server
40
42
 
41
43
  ```bash
42
- aerial start
44
+ aerial service install
43
45
  ```
44
46
 
45
- Default URL: `http://127.0.0.1:18181`.
47
+ Default URL: `http://127.0.0.1:18181`. `aerial service install` is the daily-use path on macOS and Windows because it installs and starts the local background service. Use `aerial start` only when you want a foreground debug process in the current terminal.
46
48
 
47
49
  ## 5. Configure Codex CLI
48
50
 
49
51
  ```bash
50
- aerial setup codex --model <model-id>
52
+ aerial setup codex
51
53
  ```
52
54
 
53
55
  The setup command backs up and merges `~/.codex/config.toml`, then configures Codex to fetch the local Aerial key through a command-backed provider auth helper:
@@ -68,10 +70,12 @@ The local key is generated and stored by Aerial automatically. Users do not need
68
70
 
69
71
  For a dry inspection without touching your real config, set `HOME`/`USERPROFILE` to a temporary directory before running this command.
70
72
 
73
+ If you need to pin a model, first run `aerial probe` or call `/v1/models`, choose a model whose Aerial routes include `responses`, then run `aerial setup codex --model <responses-model-id>`.
74
+
71
75
  ## 6. Configure Claude Code
72
76
 
73
77
  ```bash
74
- aerial setup claude --model <model-id>
78
+ aerial setup claude
75
79
  ```
76
80
 
77
81
  The setup command backs up and merges `~/.claude/settings.json`, using `apiKeyHelper = "aerial key print"` and `ANTHROPIC_BASE_URL=http://127.0.0.1:18181`. When you pass `--model` or set Aerial's `defaultModel`, it also writes Claude Code's default `model` to that Aerial-routed model.
@@ -80,6 +84,8 @@ If Claude Code was previously pointed at another Anthropic-compatible gateway, s
80
84
 
81
85
  For a dry inspection without touching your real config, set `HOME`/`USERPROFILE` to a temporary directory before running this command.
82
86
 
87
+ If you need to pin a model, first run `aerial probe` or call `/v1/models`, choose a model whose Aerial routes include `messages`, then run `aerial setup claude --model <messages-model-id>`.
88
+
83
89
  ## 7. Verify
84
90
 
85
91
  ```bash
@@ -314,7 +320,7 @@ Best practice: put stable system/project/tool context first, put changing user i
314
320
  ## Troubleshooting
315
321
 
316
322
  - `503 Missing GitHub token`: run `aerial login`.
317
- - `401 Invalid or missing Aerial API key`: run `aerial setup all`, then restart the client terminal or VS Code.
323
+ - `401 Invalid or missing Aerial API key`: run `aerial setup codex` or `aerial setup claude` for the client you use, then restart the client terminal or VS Code.
318
324
  - Claude Code cannot read key: ensure `aerial` is on `PATH`; it uses `aerial key print` as its helper.
319
325
  - Upstream compatibility error: run `aerial doctor`, then retry with a model returned by `/v1/models`.
320
326
  - `Unsupported parameter: max_tokens`: Aerial normalizes Chat Completions `max_tokens` into `max_completion_tokens` before forwarding to newer OpenAI models.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiayunxie/aerial",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Local-only GitHub Copilot proxy for Codex CLI and Claude Code.",
5
5
  "type": "module",
6
6
  "private": false,
package/src/cli.js CHANGED
@@ -31,7 +31,6 @@ Usage:
31
31
  aerial start [--host 127.0.0.1] [--port 18181]
32
32
  aerial setup codex [--model <id>]
33
33
  aerial setup claude [--model <id>]
34
- aerial setup all [--model <id>]
35
34
  aerial setup status [--json]
36
35
  aerial setup restore <codex|claude|all> --latest
37
36
  aerial service install
@@ -117,14 +116,7 @@ async function main() {
117
116
  return;
118
117
  }
119
118
  if (subcommand === "all") {
120
- const model = argValue(rest, "--model");
121
- const codex = setupCodex({ model, authCommand: codexAuthCommand() });
122
- const claude = setupClaude({ model });
123
- console.log(`Updated Codex config: ${codex.file}`);
124
- console.log("Configured Codex to read the local Aerial key automatically.");
125
- console.log(`Updated Claude settings: ${claude.file}`);
126
- if (claude.model) console.log(`Configured Claude default model: ${claude.model}`);
127
- return;
119
+ throw new Error("aerial setup all has been removed. Run `aerial setup codex` and/or `aerial setup claude` instead.");
128
120
  }
129
121
  if (subcommand === "status") {
130
122
  const status = setupStatus();
package/src/doctor.js CHANGED
@@ -6,7 +6,7 @@ export function doctor() {
6
6
  const config = loadConfig();
7
7
  const checks = [
8
8
  { name: "config", ok: fs.existsSync(configPath()), detail: configPath() },
9
- { name: "api_key", ok: Boolean(config.apiKeyHash), detail: fs.existsSync(apiKeyPath()) ? apiKeyPath() : config.apiKeyHash ? "hash configured" : "run: aerial setup all" },
9
+ { name: "api_key", ok: Boolean(config.apiKeyHash), detail: fs.existsSync(apiKeyPath()) ? apiKeyPath() : config.apiKeyHash ? "hash configured" : "run: aerial setup codex or aerial setup claude" },
10
10
  { name: "github_token", ok: fs.existsSync(githubTokenPath()) || Boolean(process.env.AERIAL_GITHUB_TOKEN), detail: fs.existsSync(githubTokenPath()) ? githubTokenPath() : "run: aerial login" },
11
11
  { name: "node", ok: Number(process.versions.node.split(".")[0]) >= 22, detail: process.version },
12
12
  { name: "bind", ok: config.host === "127.0.0.1", detail: `${config.host}:${config.port}` }