cc-x10ded 3.0.11 → 3.0.13

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 CHANGED
@@ -5,40 +5,67 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [3.0.0] - 2025-12-24
8
+ ## [3.0.12] - 2025-12-24
9
9
 
10
- ### 🚀 Major Rewrite (The "30x" Release)
11
- This release is a complete reimagining of the project, rewriting the entire codebase from Bash/PowerShell to **Bun/TypeScript**.
10
+ ### Changed
11
+ - Updated README with correct package name and installation instructions
12
+ - Added migration guide for users upgrading from pre-3.0 versions
13
+ - Updated CHANGELOG with recent releases
12
14
 
13
- ### Added
14
- - **Single Binary (`ccx`)**: Replaced 5+ wrapper scripts with a single, standalone executable. No dependencies required.
15
- - **Interactive Setup (`ccx setup`)**: Beautiful CLI wizard to configure keys and aliases safely.
16
- - **Self-Healing Diagnostics (`ccx doctor`)**: Checks for API keys, Claude installation, shell paths, and configuration health.
17
- - **Auto-Discovery**: Automatically detects API keys (`ZAI_API_KEY`, `OPENAI_API_KEY`, etc.) from your environment.
18
- - **Smart Proxy**: `ccx` acts as a transparent proxy for OpenAI, Gemini, Minimax, and GLM models.
19
- - **Port Hunting**: Automatically finds an available port if 17870 is busy.
20
- - **Binary Hunting**: Robustly locates the `claude` binary in standard locations (Homebrew, NVM, npm global) even if it's missing from PATH.
21
- - **PowerShell Integration**: Native support for PowerShell profiles and aliases.
15
+ ## [3.0.11] - 2025-12-24
22
16
 
23
- ### Changed
24
- - **Renamed**: Project package name changed to `cc-x10ded`.
25
- - **Runtime**: Switched from Node.js to **Bun** for instant startup performance.
26
- - **Config**: Moved from hardcoded script variables to `~/.config/claude-glm/config.json`.
27
- - **Proxy**: Migrated from Fastify to `Bun.serve()` for lower latency streaming.
17
+ ### Fixed
18
+ - Shell aliases now use `bunx cc-x10ded` for zero-install experience
19
+ - No longer requires global npm install - aliases work out of the box after setup
28
20
 
29
- ### Removed
30
- - Removed legacy `install.sh` and `install.ps1` scripts.
31
- - Removed dependency on user having Node.js installed (for binary usage).
21
+ ## [3.0.10] - 2025-12-24
22
+
23
+ ### Fixed
24
+ - Fixed `ccx update` command to reference correct package name (`cc-x10ded`)
32
25
 
33
- ## [Unreleased]
26
+ ## [3.0.9] - 2025-12-24
27
+
28
+ ### Fixed
29
+ - Added `repository` field to package.json for npm OIDC provenance verification
30
+ - Updated package description
31
+
32
+ ## [3.0.0] - 2025-12-24
33
+
34
+ ### 🚀 Major Rewrite (The "Bun Edition")
35
+ This release is a complete reimagining of the project, rewriting the entire codebase from Bash/PowerShell to **Bun/TypeScript**.
34
36
 
35
37
  ### Added
38
+ - **Zero-Install Usage**: Just run `bunx cc-x10ded setup` - no global install needed
39
+ - **Interactive Setup (`ccx setup`)**: Beautiful CLI wizard to configure keys and aliases safely
40
+ - **Self-Healing Diagnostics (`ccx doctor`)**: Checks for API keys, Claude installation, shell paths, and configuration health
41
+ - **Auto-Discovery**: Automatically detects API keys (`ZAI_API_KEY`, `OPENAI_API_KEY`, etc.) from your environment
42
+ - **Smart Proxy**: Acts as a transparent proxy for OpenAI, Gemini, Minimax, and GLM models
43
+ - **Port Hunting**: Automatically finds an available port if 17870 is busy
44
+ - **Binary Hunting**: Robustly locates the `claude` binary in standard locations (Homebrew, NVM, npm global) even if it's missing from PATH
45
+ - **PowerShell Integration**: Native support for PowerShell profiles and aliases
36
46
  - GLM-4.7 model support as new default
37
- - GLM-4.6 wrapper (ccg46) for backward compatibility
38
47
 
39
48
  ### Changed
49
+ - **Renamed**: Package name changed to `cc-x10ded` (published on npm)
50
+ - **Runtime**: Switched from Node.js to **Bun** for instant startup performance
51
+ - **Config**: Moved from hardcoded script variables to `~/.config/claude-glm/config.json`
52
+ - **Proxy**: Migrated from Fastify to `Bun.serve()` for lower latency streaming
53
+ - **Architecture**: Proxy now runs in-process instead of spawning separate process
40
54
  - Updated default model from GLM-4.6 to GLM-4.7
41
55
 
56
+ ### Removed
57
+ - Removed legacy `install.sh` and `install.ps1` scripts
58
+ - Removed dependency on user having Node.js installed (for binary usage)
59
+ - Removed `~/.claude-proxy/` directory (no longer used)
60
+
61
+ ### Migration
62
+ If upgrading from pre-3.0 versions:
63
+ ```bash
64
+ npm uninstall -g claude-glm-wrapper
65
+ rm -rf ~/.claude-proxy/
66
+ bunx cc-x10ded setup
67
+ ```
68
+
42
69
  ## [1.0.3] - 2025-10-01
43
70
 
44
71
  ### Changed
@@ -103,7 +130,11 @@ This release is a complete reimagining of the project, rewriting the entire code
103
130
  - Subexpression parsing errors in piped contexts
104
131
  - Terminal/PowerShell window persistence after errors
105
132
 
106
- [Unreleased]: https://github.com/JoeInnsp23/claude-glm-wrapper/compare/v1.0.3...HEAD
133
+ [3.0.12]: https://github.com/MohMaya/claude-glm-wrapper/compare/v3.0.11...v3.0.12
134
+ [3.0.11]: https://github.com/MohMaya/claude-glm-wrapper/compare/v3.0.10...v3.0.11
135
+ [3.0.10]: https://github.com/MohMaya/claude-glm-wrapper/compare/v3.0.9...v3.0.10
136
+ [3.0.9]: https://github.com/MohMaya/claude-glm-wrapper/compare/v3.0.0...v3.0.9
137
+ [3.0.0]: https://github.com/MohMaya/claude-glm-wrapper/compare/v1.0.3...v3.0.0
107
138
  [1.0.3]: https://github.com/JoeInnsp23/claude-glm-wrapper/compare/v1.0.2...v1.0.3
108
139
  [1.0.2]: https://github.com/JoeInnsp23/claude-glm-wrapper/compare/v1.0.1...v1.0.2
109
140
  [1.0.1]: https://github.com/JoeInnsp23/claude-glm-wrapper/compare/v1.0.0...v1.0.1
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  > This is an actively maintained community fork of the original [claude-glm-wrapper](https://github.com/JoeInnsp23/claude-glm-wrapper).
6
6
  > Now rewritten in **Bun** for 10x speed and single-binary simplicity.
7
7
  >
8
- > Install via: `bunx claude-glm-wrapper` or download the binary.
8
+ > Install via: `bunx cc-x10ded setup` or download the binary.
9
9
 
10
10
  ---
11
11
 
@@ -25,9 +25,9 @@ Use [Z.AI's GLM models](https://z.ai), [Minimax](https://minimax.io), [OpenAI](h
25
25
 
26
26
  ### Installation
27
27
 
28
- **If you have Bun:**
28
+ **If you have Bun (recommended):**
29
29
  ```bash
30
- bunx claude-glm-wrapper setup
30
+ bunx cc-x10ded setup
31
31
  ```
32
32
 
33
33
  **Manual Download (Mac/Linux/Windows):**
@@ -58,13 +58,15 @@ Run `ccx setup` to:
58
58
 
59
59
  If you enabled aliases during setup:
60
60
 
61
+
62
+ **🆕 New: ccx Multi-Provider Proxy**
61
63
  | Alias | Equivalent Command |
62
64
  |-------|-------------------|
63
- | `cc` | `claude` (Standard Anthropic) |
64
- | `ccg` | `ccx --model=glm-4.7` |
65
- | `ccg45` | `ccx --model=glm-4.5` |
66
- | `ccf` | `ccx --model=glm-4.5-air` |
67
- | `ccm` | `ccx --model=MiniMax-M2.1` |
65
+ | `ccx` | `bunx cc-x10ded` |
66
+ | `ccg` | `bunx cc-x10ded --model=glm-4.7` |
67
+ | `ccg45` | `bunx cc-x10ded --model=glm-4.5` |
68
+ | `ccf` | `bunx cc-x10ded --model=glm-4.5-air` |
69
+ | `ccm` | `bunx cc-x10ded --model=MiniMax-M2.1` |
68
70
 
69
71
  ### Multi-Provider Proxy
70
72
 
@@ -109,13 +111,33 @@ You can edit it with `ccx config`.
109
111
  }
110
112
  ```
111
113
 
114
+ ## Migrating from Old Versions
115
+
116
+ If you're upgrading from `claude-glm-wrapper` (pre-3.0), you need to clean up the old installation:
117
+
118
+ ```bash
119
+ # Remove old global package
120
+ npm uninstall -g claude-glm-wrapper
121
+
122
+ # Remove old proxy files (no longer used)
123
+ rm -rf ~/.claude-proxy/
124
+
125
+ # Install new version
126
+ bunx cc-x10ded setup
127
+ ```
128
+
129
+ The new version:
130
+ - Uses `bunx cc-x10ded` instead of `ccx` command
131
+ - Runs proxy in-process (no separate process or `~/.claude-proxy/`)
132
+ - Stores config in `~/.config/claude-glm/` (unchanged)
133
+
112
134
  ## Troubleshooting
113
135
 
114
136
  **"ccx: command not found"**
115
- Ensure the binary is in your PATH, or that you've run the setup which helps install aliases.
137
+ Run `bunx cc-x10ded setup` to install shell aliases, then restart your terminal.
116
138
 
117
139
  **"Error: 'claude' command not found"**
118
- Run `ccx doctor` or `ccx setup` — it will offer to install Claude Code for you automatically!
140
+ Run `bunx cc-x10ded doctor` — it will check your Claude Code installation.
119
141
 
120
142
  ## License
121
143
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-x10ded",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "description": "Extend Claude Code with custom OpenAI-compatible model providers",
5
5
  "repository": {
6
6
  "type": "git",
@@ -2,6 +2,7 @@ import { spawn } from "bun";
2
2
  import { ConfigManager } from "../core/config";
3
3
  import { startProxyServer } from "../proxy/server";
4
4
  import { ShellIntegrator } from "../core/shell";
5
+ import { parseProviderModel } from "../proxy/map";
5
6
  import * as pc from "picocolors";
6
7
 
7
8
  export async function runCommand(args: string[], options: { model?: string; port?: number }) {
@@ -16,31 +17,40 @@ export async function runCommand(args: string[], options: { model?: string; port
16
17
  Object.assign(config, await configManager.read());
17
18
  }
18
19
 
20
+ const model = options.model || config.defaults.model || "glm-4.7";
21
+ const { provider } = parseProviderModel(model);
22
+
23
+ // Check if we should use the proxy or fallback to native Claude (for Anthropic without API Key)
24
+ let useProxy = true;
25
+ if (provider === "anthropic" && !config.providers.anthropic?.apiKey) {
26
+ useProxy = false;
27
+ }
28
+
19
29
  // Port hunting logic
20
30
  let port = options.port || 17870;
21
31
  let server;
22
- let retries = 0;
23
32
 
24
- while (retries < 10) {
25
- try {
26
- server = startProxyServer(config, port);
27
- break;
28
- } catch (e: any) {
29
- if (e.code === "EADDRINUSE" || e.message.includes("EADDRINUSE")) {
30
- port++;
31
- retries++;
32
- } else {
33
- throw e;
34
- }
35
- }
33
+ if (useProxy) {
34
+ let retries = 0;
35
+ while (retries < 10) {
36
+ try {
37
+ server = startProxyServer(config, port);
38
+ break;
39
+ } catch (e: any) {
40
+ if (e.code === "EADDRINUSE" || e.message.includes("EADDRINUSE")) {
41
+ port++;
42
+ retries++;
43
+ } else {
44
+ throw e;
45
+ }
46
+ }
47
+ }
48
+
49
+ if (!server) {
50
+ console.error(pc.red(`Failed to start proxy server after 10 attempts (ports ${options.port || 17870}-${port}).`));
51
+ process.exit(1);
52
+ }
36
53
  }
37
-
38
- if (!server) {
39
- console.error(pc.red(`Failed to start proxy server after 10 attempts (ports ${options.port || 17870}-${port}).`));
40
- process.exit(1);
41
- }
42
-
43
- const model = options.model || config.defaults.model || "glm-4.7";
44
54
 
45
55
  // Robust binary finding
46
56
  const shellInt = new ShellIntegrator();
@@ -52,16 +62,19 @@ export async function runCommand(args: string[], options: { model?: string; port
52
62
  process.exit(1);
53
63
  }
54
64
 
55
- const env = {
65
+ const env: Record<string, string | undefined> = {
56
66
  ...process.env,
57
- ANTHROPIC_BASE_URL: `http://127.0.0.1:${port}`,
58
- ANTHROPIC_AUTH_TOKEN: "ccx-proxy-token", // Dummy token for the client
59
- ANTHROPIC_MODEL: model,
60
67
  };
61
68
 
69
+ if (useProxy) {
70
+ env.ANTHROPIC_BASE_URL = `http://127.0.0.1:${port}`;
71
+ env.ANTHROPIC_AUTH_TOKEN = "ccx-proxy-token"; // Dummy token for the client
72
+ env.ANTHROPIC_MODEL = model;
73
+ }
74
+
62
75
  try {
63
76
  const proc = spawn([claudePath, ...args], {
64
- env,
77
+ env: env as any,
65
78
  stdio: ["inherit", "inherit", "inherit"],
66
79
  });
67
80
 
@@ -71,6 +84,6 @@ export async function runCommand(args: string[], options: { model?: string; port
71
84
  console.error(pc.red(`Error starting Claude: ${e.message}`));
72
85
  process.exit(1);
73
86
  } finally {
74
- server.stop();
87
+ if (server) server.stop();
75
88
  }
76
89
  }
package/src/core/shell.ts CHANGED
@@ -89,7 +89,6 @@ export class ShellIntegrator {
89
89
  if (shell === "zsh" || shell === "bash") {
90
90
  return `
91
91
  alias ccx='${cmd}'
92
- alias cc='${cmd}'
93
92
  alias ccg='${cmd} --model=glm-4.7'
94
93
  alias ccg46='${cmd} --model=glm-4.6'
95
94
  alias ccg45='${cmd} --model=glm-4.5'
@@ -100,7 +99,6 @@ alias ccm='${cmd} --model=MiniMax-M2.1'
100
99
  if (shell === "fish") {
101
100
  return `
102
101
  alias ccx '${cmd}'
103
- alias cc '${cmd}'
104
102
  alias ccg '${cmd} --model=glm-4.7'
105
103
  alias ccg46 '${cmd} --model=glm-4.6'
106
104
  alias ccg45 '${cmd} --model=glm-4.5'
@@ -111,7 +109,6 @@ alias ccm '${cmd} --model=MiniMax-M2.1'
111
109
  if (shell === "powershell") {
112
110
  return `
113
111
  Function ccx { ${cmd} @args }
114
- Function cc { ${cmd} @args }
115
112
  Function ccg { ${cmd} --model=glm-4.7 @args }
116
113
  Function ccg46 { ${cmd} --model=glm-4.6 @args }
117
114
  Function ccg45 { ${cmd} --model=glm-4.5 @args }