@codexapi/codexclaude 2.0.25 → 2.0.26

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/CUSTOMIZATIONS.md CHANGED
@@ -5,10 +5,10 @@
5
5
  ## Runtime
6
6
 
7
7
  - Customer-facing app name: `MagnetAPI.org Codex CLI`
8
- - Local launcher version: `2.0.25`
8
+ - Local launcher version: `2.0.26`
9
9
  - Bundled official runtime dependency: `@openai/codex@0.145.0`
10
10
  - Required install command: `npm install -g @codexapi/codexclaude@latest`
11
- - Hosted fallback: `npm install -g https://codexapi.pro/downloads/codexapi-codexclaude-2.0.25.tgz`
11
+ - Hosted fallback: `npm install -g https://codexapi.pro/downloads/codexapi-codexclaude-2.0.26.tgz`
12
12
  - Bundled runtime version is managed internally and must not be used for customer update prompts.
13
13
  - Launcher update checks may call the CodexAPI.pro version endpoint and `@codexapi/codexclaude` npm metadata only.
14
14
  - The launcher must never check `@openai/codex` npm metadata or OpenAI GitHub releases for update notices.
@@ -27,8 +27,8 @@
27
27
  - Does not expose separate `codexclaude status` or `codexclaude usage` commands; wallet information remains a compact pre-launch line.
28
28
  - Version `2.0.25` is forced by the backend minimum version and older clients must show an update-required message.
29
29
  - Mandatory updates present `Upgrade Now` in an interactive terminal, invoke npm with an argument array and no shell interpolation, then relaunch the requested action automatically.
30
- - The npm package exposes `codexclaude` and `codex` as managed launch commands.
31
- - Global installation creates `claude` only when no existing command is present anywhere on `PATH`; native Claude Code must never be overwritten.
30
+ - The npm package manifest exposes only `codexclaude`, preventing npm from colliding with a native `codex` or `claude` command before postinstall runs.
31
+ - Global installation creates optional `codex` and `claude` aliases only when no existing command is present in the npm prefix or anywhere on `PATH`; native clients must never be overwritten.
32
32
 
33
33
  ## Provider Config
34
34
 
@@ -65,7 +65,7 @@ Before launching the runtime, the launcher calls `/api/v1/wallet/status`, then `
65
65
  Expected status line:
66
66
 
67
67
  ```text
68
- MagnetAPI.org Codex CLI v2.0.25 · gpt-5.6 xhigh · ~/project · Wallet $20.00
68
+ MagnetAPI.org Codex CLI v2.0.26 · gpt-5.6 xhigh · ~/project · Wallet $20.00
69
69
  ```
70
70
 
71
71
  ## Upgrade Checklist
@@ -84,7 +84,7 @@ When updating the bundled runtime:
84
84
  10. Keep direct platform binary launch and do not fall back to the upstream npm wrapper.
85
85
  11. Keep update checks limited to `/api/v1/codexclaude/version` and `@codexapi/codexclaude` npm metadata.
86
86
  12. Keep the interactive `Upgrade Now` flow installing `@codexapi/codexclaude@latest` without a shell and relaunching automatically.
87
- 13. Keep `codex` as a package alias and the conditional, non-overwriting `claude` postinstall alias.
87
+ 13. Keep `codexclaude` as the only manifest-owned command and preserve the conditional, non-overwriting `codex` and `claude` postinstall aliases.
88
88
  14. Keep the managed `MODELS` map and local model catalog, including Terra, SOL Max, and SOL Ultra.
89
89
  15. Keep bearer username auth and the `X-CodexAPI-*` headers.
90
90
  16. Update `README.md`, `CUSTOMIZATIONS.md`, and `codexclaude.md`.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `codexclaude` installs the MagnetAPI.org Codex CLI for customers who want one coding CLI that can use GPT-5.6, GPT-5.6 Terra, GPT-5.6 SOL, GPT-5.6 SOL Max, GPT-5.6 SOL Ultra, ChatGPT-5.5, Opus 4.8, Sonnet 5, or Fable 5 against the same Token Wallet.
4
4
 
5
- Version `2.0.25` is a required client sync release. It bundles official Codex runtime dependency `@openai/codex@0.145.0`, launches the platform-native runtime binary directly, disables upstream OpenAI update prompts, and applies account, wallet, model, Full Access, GPT-5.6/xhigh defaults, and managed model metadata before each coding session starts. Model menus no longer display wallet multiplier notices; billing remains managed by the server.
5
+ Version `2.0.26` fixes upgrades on systems that already have a native `codex` or `claude` command. It bundles official Codex runtime dependency `@openai/codex@0.145.0`, launches the platform-native runtime binary directly, disables upstream OpenAI update prompts, and applies account, wallet, model, Full Access, GPT-5.6/xhigh defaults, and managed model metadata before each coding session starts.
6
6
 
7
7
  ## Install Or Update
8
8
 
@@ -48,7 +48,7 @@ Available model labels are `GPT-5.6`, `GPT-5.6 SOL Max`, `GPT-5.6 SOL Ultra`, `G
48
48
 
49
49
  ## Launch Commands
50
50
 
51
- The managed package installs `codexclaude` and `codex` as equivalent launch commands. During a global install, it also creates a `claude` alias only when no existing `claude` command can be found. If official Claude Code is already installed, its native `claude` command is preserved.
51
+ The npm package owns only the collision-free `codexclaude` command. During a global install, its postinstall step creates optional `codex` and `claude` aliases only when those command names are unused. Native Codex CLI and Claude Code commands are always preserved. This avoids npm `EEXIST` failures and never requires `--force`.
52
52
 
53
53
  ```bash
54
54
  codexclaude
@@ -67,7 +67,7 @@ codexclaude changelog
67
67
  Before launching the coding runtime, the app prints a compact status line like:
68
68
 
69
69
  ```text
70
- MagnetAPI.org Codex CLI v2.0.25 · gpt-5.6 xhigh · ~/project · Wallet $20.00
70
+ MagnetAPI.org Codex CLI v2.0.26 · gpt-5.6 xhigh · ~/project · Wallet $20.00
71
71
  ```
72
72
 
73
73
  ## Preserved Customizations
@@ -8,11 +8,11 @@ import path from "node:path";
8
8
  import readline from "node:readline/promises";
9
9
  import { stdin as input, stdout as output } from "node:process";
10
10
  import { fileURLToPath } from "node:url";
11
- import { installSafeClaudeAlias } from "../scripts/install-safe-aliases.js";
11
+ import { installSafeCommandAliases } from "../scripts/install-safe-aliases.js";
12
12
 
13
13
  const require = createRequire(import.meta.url);
14
14
 
15
- const APP_VERSION = "2.0.25";
15
+ const APP_VERSION = "2.0.26";
16
16
  const CODEX_VERSION = "0.145.0";
17
17
  const APP_DISPLAY_NAME = "MagnetAPI.org Codex CLI";
18
18
  const DEFAULT_MODEL_ID = "gpt-5.6";
@@ -1222,7 +1222,7 @@ function ensureSafeCommandAliases() {
1222
1222
  if (!prefix) {
1223
1223
  return;
1224
1224
  }
1225
- installSafeClaudeAlias({
1225
+ installSafeCommandAliases({
1226
1226
  isGlobalInstall: true,
1227
1227
  prefix,
1228
1228
  quiet: true,
package/codexclaude.md CHANGED
@@ -5,11 +5,11 @@ This file is the durable handoff for the `@codexapi/codexclaude` package in `/ro
5
5
  ## Current Release
6
6
 
7
7
  - Package name: `@codexapi/codexclaude`
8
- - Launcher version: `2.0.25`
8
+ - Launcher version: `2.0.26`
9
9
  - Customer-facing app name: `MagnetAPI.org Codex CLI`
10
10
  - Bundled runtime dependency: `@openai/codex@0.145.0`
11
11
  - Required install command: `npm install -g @codexapi/codexclaude@latest`
12
- - Hosted fallback: `npm install -g https://codexapi.pro/downloads/codexapi-codexclaude-2.0.25.tgz`
12
+ - Hosted fallback: `npm install -g https://codexapi.pro/downloads/codexapi-codexclaude-2.0.26.tgz`
13
13
  - Backend minimum version: `2.0.25`
14
14
  - Default visible model: `GPT-5.6`
15
15
  - Default model slug: `gpt-5.6`
@@ -25,13 +25,13 @@ This file is the durable handoff for the `@codexapi/codexclaude` package in `/ro
25
25
  The launcher must present itself as:
26
26
 
27
27
  ```text
28
- MagnetAPI.org Codex CLI v2.0.25
28
+ MagnetAPI.org Codex CLI v2.0.26
29
29
  ```
30
30
 
31
31
  Normal pre-launch status should look like:
32
32
 
33
33
  ```text
34
- MagnetAPI.org Codex CLI v2.0.25 · gpt-5.6 xhigh · ~/project · Wallet $20.00
34
+ MagnetAPI.org Codex CLI v2.0.26 · gpt-5.6 xhigh · ~/project · Wallet $20.00
35
35
  ```
36
36
 
37
37
  Do not show OpenAI update notices, OpenAI npm install commands, OpenAI release links, or the upstream runtime version in launcher-owned output. The package still depends on the official runtime internally, but the customer update surface is ours.
@@ -57,9 +57,9 @@ GPT-5.6 must be the default when a new config is created or a legacy config cont
57
57
  - `https://codexapi.pro/api/v1/codexclaude/version`
58
58
  - `https://registry.npmjs.org/@codexapi%2Fcodexclaude/latest`
59
59
 
60
- It must not check `@openai/codex` npm metadata, OpenAI GitHub releases, or any upstream OpenAI update endpoint. Version `2.0.25` is a forced release: the backend `minimumVersion` equals `2.0.25`. Compatible older launchers offer an interactive `Upgrade Now` action that invokes `npm install -g @codexapi/codexclaude@latest` without shell interpolation. Non-interactive terminals print the exact update command and exit instead of waiting for input. After a successful interactive update, the launcher starts the requested action again automatically.
60
+ It must not check `@openai/codex` npm metadata, OpenAI GitHub releases, or any upstream OpenAI update endpoint. Version `2.0.25` remains the enforced minimum release while `2.0.26` is the current latest release. Compatible older launchers offer an interactive `Upgrade Now` action that invokes `npm install -g @codexapi/codexclaude@latest` without shell interpolation. Non-interactive terminals print the exact update command and exit instead of waiting for input. After a successful interactive update, the launcher starts the requested action again automatically.
61
61
 
62
- The npm package owns `codexclaude` and `codex`. Its postinstall script may create a `claude` alias only during a global installation and only when neither the target npm prefix nor any directory on `PATH` already contains a Claude command. If native Claude Code exists, report that it was preserved and do not write any `claude` shim.
62
+ The npm package manifest owns only `codexclaude`. This is deliberate: npm creates manifest binaries before postinstall, so claiming `codex` there causes an `EEXIST` upgrade failure on machines with native Codex CLI. During a global installation, postinstall may create optional `codex` and `claude` aliases only when neither the target npm prefix nor any directory on `PATH` already contains the command. Existing native clients are preserved and no install path requires `--force`.
63
63
 
64
64
  The launcher writes `check_for_update_on_startup = false` and removes `~/.codex/version.json` so the bundled runtime does not display stale upstream update prompts. The launcher also resolves the platform-native runtime binary directly from the optional package (`@openai/codex-linux-x64`, `@openai/codex-darwin-arm64`, and so on). Do not fall back to the upstream npm wrapper, because that wrapper can re-enable upstream managed update behavior.
65
65
 
@@ -87,7 +87,7 @@ base_url = "<service Responses URL>"
87
87
  experimental_bearer_token = "<customer System Token/API username>"
88
88
  wire_api = "responses"
89
89
  supports_websockets = false
90
- http_headers = { "X-CodexAPI-Client" = "codexclaude", "X-CodexAPI-Client-Version" = "2.0.25", "X-CodexAPI-Selected-Model" = "<selected model>" }
90
+ http_headers = { "X-CodexAPI-Client" = "codexclaude", "X-CodexAPI-Client-Version" = "2.0.26", "X-CodexAPI-Selected-Model" = "<selected model>" }
91
91
 
92
92
  [tui]
93
93
  status_line = ["model-with-reasoning", "fast-mode", "current-dir"]
@@ -136,7 +136,7 @@ When updating the bundled runtime dependency:
136
136
  9. Preserve direct platform-native binary launch.
137
137
  10. Preserve update checks through our version endpoint and `@codexapi/codexclaude` npm metadata only.
138
138
  11. Preserve the interactive `Upgrade Now` flow, shell-free npm invocation, and automatic relaunch.
139
- 12. Preserve `codex` as a package alias and the conditional native-Claude-safe postinstall alias.
139
+ 12. Preserve `codexclaude` as the only manifest-owned binary and the conditional native-client-safe `codex` and `claude` postinstall aliases.
140
140
  13. Preserve deletion of `~/.codex/version.json` and `check_for_update_on_startup = false`.
141
141
  14. Update customer setup scripts on CodexAPI.pro, ChatPlus.chat, MyAPI.world, MagnetAPI.org, and VIP pages to use the current release.
142
142
  15. Update backend `CODEXCLAUDE_LATEST_VERSION`, `CODEXCLAUDE_MIN_VERSION`, and hosted tarball URL.
@@ -159,7 +159,7 @@ tmp_home="$(mktemp -d)"
159
159
  mkdir -p "$tmp_home/.codexclaude"
160
160
  cat > "$tmp_home/.codexclaude/config.json" <<'JSON'
161
161
  {
162
- "version": "2.0.25",
162
+ "version": "2.0.26",
163
163
  "serviceId": "codexapi",
164
164
  "serviceLabel": "CodexAPI.pro",
165
165
  "apiOrigin": "https://codexapi.pro",
@@ -197,10 +197,16 @@ After packaging, copy the tarball to the public downloads directories, restart t
197
197
 
198
198
  ```bash
199
199
  curl -fsS "https://codexapi.pro/api/v1/codexclaude/version?current=2.0.17"
200
- curl -fsSI "https://codexapi.pro/downloads/codexapi-codexclaude-2.0.25.tgz"
200
+ curl -fsSI "https://codexapi.pro/downloads/codexapi-codexclaude-2.0.26.tgz"
201
201
  ```
202
202
 
203
- The version endpoint must report `latestVersion = 2.0.25`, `minimumVersion = 2.0.25`, and `updateRequired = true` for old clients.
203
+ The version endpoint must report `latestVersion = 2.0.26`, `minimumVersion = 2.0.25`, and `updateRequired = true` only for clients below the minimum.
204
+
205
+ ## Version 2.0.26 Changes
206
+
207
+ - Fixed npm `EEXIST` upgrades on systems that already have native Codex CLI installed.
208
+ - Limited package-manifest ownership to `codexclaude`.
209
+ - Kept optional `codex` and `claude` convenience aliases without replacing native clients.
204
210
 
205
211
  ## Version 2.0.25 Changes
206
212
 
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@codexapi/codexclaude",
3
- "version": "2.0.25",
3
+ "version": "2.0.26",
4
4
  "description": "MagnetAPI.org Codex CLI for GPT-5.6, Opus 4.8, Sonnet 5, and Fable 5.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "bin": {
8
- "codexclaude": "bin/codexclaude.js",
9
- "codex": "bin/codexclaude.js"
8
+ "codexclaude": "bin/codexclaude.js"
10
9
  },
11
10
  "files": [
12
11
  "bin",
@@ -16,7 +15,8 @@
16
15
  "codexclaude.md"
17
16
  ],
18
17
  "scripts": {
19
- "postinstall": "node scripts/install-safe-aliases.js"
18
+ "postinstall": "node scripts/install-safe-aliases.js",
19
+ "test": "node --test test/*.test.js"
20
20
  },
21
21
  "engines": {
22
22
  "node": ">=20"
@@ -14,7 +14,25 @@ import { fileURLToPath } from "node:url";
14
14
  const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
15
15
  const launcherPath = path.join(packageRoot, "bin", "codexclaude.js");
16
16
 
17
+ export function installSafeCommandAliases(options = {}) {
18
+ return {
19
+ status: "complete",
20
+ aliases: {
21
+ codex: installSafeAlias("codex", options),
22
+ claude: installSafeAlias("claude", options),
23
+ },
24
+ };
25
+ }
26
+
27
+ export function installSafeCodexAlias(options = {}) {
28
+ return installSafeAlias("codex", options);
29
+ }
30
+
17
31
  export function installSafeClaudeAlias(options = {}) {
32
+ return installSafeAlias("claude", options);
33
+ }
34
+
35
+ function installSafeAlias(command, options = {}) {
18
36
  const isGlobalInstall =
19
37
  options.isGlobalInstall ??
20
38
  String(process.env.npm_config_global || "").toLowerCase() === "true";
@@ -26,20 +44,20 @@ export function installSafeClaudeAlias(options = {}) {
26
44
  const prefix = String(options.prefix || process.env.npm_config_prefix || "").trim();
27
45
  if (!prefix) {
28
46
  if (!quiet) {
29
- console.warn("codexclaude: skipped the optional claude alias because npm did not provide its global prefix.");
47
+ console.warn(`codexclaude: skipped the optional ${command} alias because npm did not provide its global prefix.`);
30
48
  }
31
49
  return { status: "missing-prefix" };
32
50
  }
33
51
 
34
52
  const binDir = process.platform === "win32" ? prefix : path.join(prefix, "bin");
35
- const aliasPaths = claudeAliasPaths(binDir);
36
- const existingCommand = findCommandOnPath("claude", aliasPaths);
53
+ const aliasPaths = commandAliasPaths(binDir, command);
54
+ const existingCommand = findCommandOnPath(command, aliasPaths);
37
55
  const existingAlias = aliasPaths.find((candidate) => existsSync(candidate));
38
56
 
39
57
  if (existingCommand || existingAlias) {
40
58
  const preserved = existingCommand || existingAlias;
41
59
  if (!quiet) {
42
- console.log(`codexclaude: preserved the existing native claude command at ${preserved}.`);
60
+ console.log(`codexclaude: preserved the existing ${command} command at ${preserved}.`);
43
61
  }
44
62
  return { status: "preserved", path: preserved };
45
63
  }
@@ -53,27 +71,27 @@ export function installSafeClaudeAlias(options = {}) {
53
71
  chmodSync(aliasPaths[0], 0o755);
54
72
  }
55
73
  if (!quiet) {
56
- console.log("codexclaude: installed the optional claude launch alias; codex and codexclaude are also available.");
74
+ console.log(`codexclaude: installed the optional ${command} launch alias.`);
57
75
  }
58
76
  return { status: "installed", paths: aliasPaths.filter((candidate) => existsSync(candidate)) };
59
77
  } catch (error) {
60
78
  if (!quiet) {
61
- console.warn(`codexclaude: could not install the optional claude alias (${error.message}).`);
79
+ console.warn(`codexclaude: could not install the optional ${command} alias (${error.message}).`);
62
80
  }
63
81
  return { status: "failed", error: error.message };
64
82
  }
65
83
  }
66
84
 
67
- function claudeAliasPaths(directory) {
85
+ function commandAliasPaths(directory, command) {
68
86
  if (process.platform === "win32") {
69
87
  return [
70
- path.join(directory, "claude"),
71
- path.join(directory, "claude.cmd"),
72
- path.join(directory, "claude.ps1"),
73
- path.join(directory, "claude.exe"),
88
+ path.join(directory, command),
89
+ path.join(directory, `${command}.cmd`),
90
+ path.join(directory, `${command}.ps1`),
91
+ path.join(directory, `${command}.exe`),
74
92
  ];
75
93
  }
76
- return [path.join(directory, "claude")];
94
+ return [path.join(directory, command)];
77
95
  }
78
96
 
79
97
  function findCommandOnPath(command, ignoredPaths) {
@@ -147,5 +165,5 @@ function isTruthy(value) {
147
165
  }
148
166
 
149
167
  if (path.resolve(process.argv[1] || "") === fileURLToPath(import.meta.url)) {
150
- installSafeClaudeAlias();
168
+ installSafeCommandAliases();
151
169
  }