claude-codex-proxy 1.0.5-beta.6 → 1.0.5-beta.7

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.
Files changed (3) hide show
  1. package/README.md +16 -0
  2. package/bin/cli.js +30 -2
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -95,6 +95,22 @@ The startup prompt asks you to choose **local deployment** or **public deploymen
95
95
  - Local deployment: no access key is required.
96
96
  - Public deployment: enter the UI/admin access key to unlock the Web Dashboard and management APIs. After startup, create and manage Claude Code client API keys from **Settings → Claude Code Client API Keys**.
97
97
 
98
+ For non-interactive deployments, pass the mode and admin key directly. The command-line options take precedence over environment variables:
99
+
100
+ ```bash
101
+ claude-codex-proxy start --mode public --admin-key "your-admin-key"
102
+ ```
103
+
104
+ ```bash
105
+ PROXY_DEPLOYMENT_MODE=public PROXY_ADMIN_KEY="your-admin-key" claude-codex-proxy start
106
+ ```
107
+
108
+ PowerShell:
109
+
110
+ ```powershell
111
+ $env:PROXY_DEPLOYMENT_MODE="public"; $env:PROXY_ADMIN_KEY="your-admin-key"; npm start
112
+ ```
113
+
98
114
  The server will start at `http://localhost:8081` by default. To use another port:
99
115
 
100
116
  ```bash
package/bin/cli.js CHANGED
@@ -38,13 +38,19 @@ COMMANDS:
38
38
  OPTIONS:
39
39
  --help, -h Show this help message
40
40
  --version, -v Show version number
41
+ --mode <local|public> Deployment mode for the start command
42
+ --admin-key <key> UI/admin access key for public deployment
41
43
 
42
44
  ENVIRONMENT:
43
45
  PORT Server port (default: 8081)
46
+ PROXY_DEPLOYMENT_MODE Deployment mode (local or public)
47
+ PROXY_ADMIN_KEY UI/admin access key for public deployment
44
48
 
45
49
  EXAMPLES:
46
50
  claude-codex-proxy start
47
51
  PORT=3000 claude-codex-proxy start
52
+ claude-codex-proxy start --mode public --admin-key "your-admin-key"
53
+ PROXY_DEPLOYMENT_MODE=public PROXY_ADMIN_KEY="your-admin-key" claude-codex-proxy start
48
54
  claude-codex-proxy accounts add
49
55
  claude-codex-proxy accounts add --no-browser
50
56
  claude-codex-proxy accounts list
@@ -101,12 +107,34 @@ async function askRequiredKey(label) {
101
107
  }
102
108
  }
103
109
 
110
+ /**
111
+ * Reads an option value from either `--option value` or `--option=value`.
112
+ * @param {string} option
113
+ * @returns {string|undefined}
114
+ */
115
+ function getOptionValue(option) {
116
+ const optionIndex = args.indexOf(option);
117
+ if (optionIndex !== -1) {
118
+ return args[optionIndex + 1];
119
+ }
120
+
121
+ const prefixedOption = `${option}=`;
122
+ const matchedOption = args.find((arg) => arg.startsWith(prefixedOption));
123
+ return matchedOption?.slice(prefixedOption.length);
124
+ }
125
+
104
126
  async function configureStartMode() {
105
- const mode = await askDeploymentMode();
127
+ const requestedMode = getOptionValue('--mode') || process.env.PROXY_DEPLOYMENT_MODE;
128
+ if (requestedMode && !['local', 'public'].includes(requestedMode)) {
129
+ throw new Error('Deployment mode must be "local" or "public".');
130
+ }
131
+
132
+ const mode = requestedMode || await askDeploymentMode();
106
133
  process.env.PROXY_DEPLOYMENT_MODE = mode;
107
134
 
108
135
  if (mode === 'public') {
109
- process.env.PROXY_ADMIN_KEY = await askRequiredKey('Enter UI/admin access key');
136
+ const adminKey = getOptionValue('--admin-key') || process.env.PROXY_ADMIN_KEY;
137
+ process.env.PROXY_ADMIN_KEY = adminKey || await askRequiredKey('Enter UI/admin access key');
110
138
  }
111
139
  }
112
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-codex-proxy",
3
- "version": "1.0.5-beta.6",
3
+ "version": "1.0.5-beta.7",
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",