claude-codex-proxy 1.0.1 → 1.0.2
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 +5 -5
- package/docs/ACCOUNTS.md +3 -3
- package/docs/ARCHITECTURE.md +1 -1
- package/package.json +4 -4
- package/public/index.html +2 -2
- package/public/js/app.js +4 -3
- package/src/account-manager.js +1 -1
- package/src/cli/accounts.js +1 -1
- package/src/index.js +1 -1
- package/src/routes/api-routes.js +4 -1
package/README.md
CHANGED
|
@@ -4,12 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://choosealicense.com/licenses/mit/)
|
|
6
6
|
[](https://nodejs.org/)
|
|
7
|
-
[](https://github.com/zzy-life/claude-codex-proxy)
|
|
8
8
|
|
|
9
9
|
> **Use Claude Code CLI with the power of ChatGPT Codex models.**
|
|
10
10
|
> A local proxy that translates Anthropic API requests into ChatGPT Codex calls, enabling you to use the `claude` CLI tool with your ChatGPT Free/Plus/Pro subscription.
|
|
11
11
|
|
|
12
|
-
> This project is forked from the original
|
|
12
|
+
> This project is forked from the original Claude/Codex proxy project and maintained with additional changes for this distribution.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -234,7 +234,7 @@ This project is an independent open-source tool and is not affiliated with, endo
|
|
|
234
234
|
|
|
235
235
|
<div align="center">
|
|
236
236
|
<p>If you find this project useful, please give it a star! ⭐️</p>
|
|
237
|
-
<a href="https://github.com/zzy-life/codex-
|
|
238
|
-
<img src="https://img.shields.io/github/stars/zzy-life/codex-
|
|
237
|
+
<a href="https://github.com/zzy-life/claude-codex-proxy">
|
|
238
|
+
<img src="https://img.shields.io/github/stars/zzy-life/claude-codex-proxy?style=social" alt="Star on GitHub">
|
|
239
239
|
</a>
|
|
240
|
-
</div>
|
|
240
|
+
</div>
|
package/docs/ACCOUNTS.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
### Main Registry
|
|
6
6
|
|
|
7
|
-
**Location:** `~/.codex-
|
|
7
|
+
**Location:** `~/.claude-codex-proxy/accounts.json`
|
|
8
8
|
|
|
9
9
|
```json
|
|
10
10
|
{
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
### Per-Account Tokens
|
|
35
35
|
|
|
36
|
-
**Location:** `~/.codex-
|
|
36
|
+
**Location:** `~/.claude-codex-proxy/accounts/<email>/auth.json`
|
|
37
37
|
|
|
38
38
|
```json
|
|
39
39
|
{
|
|
@@ -196,7 +196,7 @@ On server startup:
|
|
|
196
196
|
|
|
197
197
|
## Security
|
|
198
198
|
|
|
199
|
-
- Tokens stored locally in `~/.codex-
|
|
199
|
+
- Tokens stored locally in `~/.claude-codex-proxy/`
|
|
200
200
|
- Directory permissions: user read/write only
|
|
201
201
|
- Never logged or exposed in API responses
|
|
202
202
|
- Per-account isolation via separate directories
|
package/docs/ARCHITECTURE.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-codex-proxy",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Multi-account proxy server for OpenAI Codex CLI with Claude API compatibility",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
},
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/zzy-life/codex-
|
|
25
|
+
"url": "git+https://github.com/zzy-life/claude-codex-proxy.git"
|
|
26
26
|
},
|
|
27
27
|
"bugs": {
|
|
28
|
-
"url": "https://github.com/zzy-life/codex-
|
|
28
|
+
"url": "https://github.com/zzy-life/claude-codex-proxy/issues"
|
|
29
29
|
},
|
|
30
|
-
"homepage": "https://github.com/zzy-life/codex-
|
|
30
|
+
"homepage": "https://github.com/zzy-life/claude-codex-proxy#readme",
|
|
31
31
|
"scripts": {
|
|
32
32
|
"start": "node src/index.js",
|
|
33
33
|
"portfolio:dev": "npm --prefix apps/portfolio run dev",
|
package/public/index.html
CHANGED
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
<div class="flex flex-col gap-0.5">
|
|
72
72
|
<div class="flex items-center gap-1.5">
|
|
73
73
|
<span class="text-[10px] text-gray-500 font-mono tracking-wider">CLAUDE PROXY SYSTEM</span>
|
|
74
|
-
<span class="text-[10px] text-gray-500 font-mono tracking-wider" x-text="'v' + version"></span>
|
|
74
|
+
<span class="text-[10px] text-gray-500 font-mono tracking-wider" x-text="version ? 'v' + version : ''"></span>
|
|
75
75
|
</div>
|
|
76
|
-
<a href="https://github.com/zzy-life/codex-
|
|
76
|
+
<a href="https://github.com/zzy-life/claude-codex-proxy" target="_blank" class="text-[10px] text-neon-purple hover:text-purple-400 hover:underline transition-colors flex items-center gap-1">
|
|
77
77
|
<svg class="w-3 h-3" fill="currentColor" viewBox="0 0 24 24"><path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/></svg>
|
|
78
78
|
<span>Star on GitHub</span>
|
|
79
79
|
</a>
|
package/public/js/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
document.addEventListener('alpine:init', () => {
|
|
2
2
|
Alpine.data('app', () => ({
|
|
3
|
-
version: '
|
|
3
|
+
version: '',
|
|
4
4
|
connectionStatus: 'connecting',
|
|
5
5
|
activeTab: 'dashboard',
|
|
6
6
|
sidebarOpen: window.innerWidth >= 1024,
|
|
@@ -39,7 +39,7 @@ document.addEventListener('alpine:init', () => {
|
|
|
39
39
|
testResponse: '',
|
|
40
40
|
testing: false,
|
|
41
41
|
|
|
42
|
-
configPath: '~/.codex-
|
|
42
|
+
configPath: '~/.claude-codex-proxy/accounts.json',
|
|
43
43
|
|
|
44
44
|
logs: [],
|
|
45
45
|
logSearchQuery: '',
|
|
@@ -110,8 +110,9 @@ document.addEventListener('alpine:init', () => {
|
|
|
110
110
|
},
|
|
111
111
|
|
|
112
112
|
async checkHealth() {
|
|
113
|
-
const { ok } = await this.api('/health');
|
|
113
|
+
const { ok, data } = await this.api('/health');
|
|
114
114
|
this.connectionStatus = ok ? 'connected' : 'disconnected';
|
|
115
|
+
if (ok && data?.version) this.version = data.version;
|
|
115
116
|
},
|
|
116
117
|
|
|
117
118
|
async refreshAccounts() {
|
package/src/account-manager.js
CHANGED
|
@@ -9,7 +9,7 @@ import { homedir } from 'os';
|
|
|
9
9
|
import { refreshAccessToken, extractAccountInfo } from './oauth.js';
|
|
10
10
|
import { getAccountQuota as fetchQuota } from './model-api.js';
|
|
11
11
|
|
|
12
|
-
const CONFIG_DIR = join(homedir(), '.codex-
|
|
12
|
+
const CONFIG_DIR = join(homedir(), '.claude-codex-proxy');
|
|
13
13
|
const ACCOUNTS_FILE = join(CONFIG_DIR, 'accounts.json');
|
|
14
14
|
const ACCOUNTS_DIR = join(CONFIG_DIR, 'accounts');
|
|
15
15
|
|
package/src/cli/accounts.js
CHANGED
|
@@ -10,7 +10,7 @@ import { homedir } from 'os';
|
|
|
10
10
|
import { join } from 'path';
|
|
11
11
|
import crypto from 'crypto';
|
|
12
12
|
|
|
13
|
-
const CONFIG_DIR = join(homedir(), '.codex-
|
|
13
|
+
const CONFIG_DIR = join(homedir(), '.claude-codex-proxy');
|
|
14
14
|
const ACCOUNTS_FILE = join(CONFIG_DIR, 'accounts.json');
|
|
15
15
|
const DEFAULT_PORT = 8081;
|
|
16
16
|
|
package/src/index.js
CHANGED
|
@@ -40,7 +40,7 @@ console.log(`
|
|
|
40
40
|
╠══════════════════════════════════════════════════════════════╣
|
|
41
41
|
║ Support: ║
|
|
42
42
|
║ ★ Give it a star on GitHub! ║
|
|
43
|
-
║ https://github.com/zzy-life/codex-
|
|
43
|
+
║ https://github.com/zzy-life/claude-codex-proxy ║
|
|
44
44
|
╚══════════════════════════════════════════════════════════════╝
|
|
45
45
|
`);
|
|
46
46
|
|
package/src/routes/api-routes.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import express from 'express';
|
|
8
|
+
import { createRequire } from 'module';
|
|
8
9
|
import { join, dirname } from 'path';
|
|
9
10
|
import { fileURLToPath } from 'url';
|
|
10
11
|
|
|
@@ -41,6 +42,8 @@ import {
|
|
|
41
42
|
} from './accounts-route.js';
|
|
42
43
|
|
|
43
44
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
45
|
+
const require = createRequire(import.meta.url);
|
|
46
|
+
const packageJson = require('../../package.json');
|
|
44
47
|
|
|
45
48
|
export function registerApiRoutes(app, { port }) {
|
|
46
49
|
// ─── Static Web UI ─────────────────────────────────────────────────────────
|
|
@@ -48,7 +51,7 @@ export function registerApiRoutes(app, { port }) {
|
|
|
48
51
|
|
|
49
52
|
// ─── Health ────────────────────────────────────────────────────────────────
|
|
50
53
|
app.get('/health', (req, res) => {
|
|
51
|
-
res.json({ status: 'ok', ...getStatus(), configPath: ACCOUNTS_FILE });
|
|
54
|
+
res.json({ status: 'ok', version: packageJson.version, ...getStatus(), configPath: ACCOUNTS_FILE });
|
|
52
55
|
});
|
|
53
56
|
|
|
54
57
|
// ─── Anthropic Messages API ────────────────────────────────────────────────
|