@kamel-ahmed/proxy-claude 1.0.0 → 1.0.1
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 +26 -25
- package/bin/cli.js +7 -7
- package/package.json +1 -1
- package/src/cli/setup.js +7 -14
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Antigravity Claude Proxy
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@kamel-ahmed/proxy-claude)
|
|
4
|
+
[](https://www.npmjs.com/package/@kamel-ahmed/proxy-claude)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
6
|
|
|
7
7
|
<a href="https://buymeacoffee.com/badrinarayanans" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="50"></a>
|
|
@@ -40,11 +40,12 @@ A proxy server that exposes an **Anthropic-compatible API** backed by **Antigrav
|
|
|
40
40
|
Run the setup command to automatically install Claude Code CLI and create a global `proxy-claude` command:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
#
|
|
44
|
-
|
|
43
|
+
# Install globally (recommended)
|
|
44
|
+
npm install -g @kamel-ahmed/proxy-claude
|
|
45
|
+
proxy-claude setup
|
|
45
46
|
|
|
46
|
-
#
|
|
47
|
-
|
|
47
|
+
# Or run via npx
|
|
48
|
+
npx @kamel-ahmed/proxy-claude setup
|
|
48
49
|
|
|
49
50
|
# If cloned locally
|
|
50
51
|
npm run setup
|
|
@@ -78,11 +79,11 @@ proxy-claude --model sonnet
|
|
|
78
79
|
|
|
79
80
|
```bash
|
|
80
81
|
# Run directly with npx (no install needed)
|
|
81
|
-
npx
|
|
82
|
+
npx @kamel-ahmed/proxy-claude start
|
|
82
83
|
|
|
83
84
|
# Or install globally
|
|
84
|
-
npm install -g
|
|
85
|
-
|
|
85
|
+
npm install -g @kamel-ahmed/proxy-claude
|
|
86
|
+
proxy-claude start
|
|
86
87
|
```
|
|
87
88
|
|
|
88
89
|
### Option 2: Clone Repository
|
|
@@ -102,10 +103,10 @@ npm start
|
|
|
102
103
|
|
|
103
104
|
```bash
|
|
104
105
|
# If installed via npm
|
|
105
|
-
|
|
106
|
+
proxy-claude start
|
|
106
107
|
|
|
107
108
|
# If using npx
|
|
108
|
-
npx
|
|
109
|
+
npx @kamel-ahmed/proxy-claude start
|
|
109
110
|
|
|
110
111
|
# If cloned locally
|
|
111
112
|
npm start
|
|
@@ -129,13 +130,13 @@ If you prefer the terminal or are on a remote server:
|
|
|
129
130
|
|
|
130
131
|
```bash
|
|
131
132
|
# Desktop (opens browser)
|
|
132
|
-
|
|
133
|
+
proxy-claude accounts add
|
|
133
134
|
|
|
134
135
|
# Headless (Docker/SSH)
|
|
135
|
-
|
|
136
|
+
proxy-claude accounts add --no-browser
|
|
136
137
|
```
|
|
137
138
|
|
|
138
|
-
> For full CLI account management options, run `
|
|
139
|
+
> For full CLI account management options, run `proxy-claude accounts --help`.
|
|
139
140
|
|
|
140
141
|
#### **Method C: Automatic (Antigravity Users)**
|
|
141
142
|
|
|
@@ -144,7 +145,7 @@ If you have the **Antigravity** app installed and logged in, the proxy will auto
|
|
|
144
145
|
To use a custom port:
|
|
145
146
|
|
|
146
147
|
```bash
|
|
147
|
-
PORT=3001
|
|
148
|
+
PORT=3001 proxy-claude start
|
|
148
149
|
```
|
|
149
150
|
|
|
150
151
|
### 3. Verify It's Working
|
|
@@ -252,7 +253,7 @@ Restart your terminal for changes to take effect.
|
|
|
252
253
|
|
|
253
254
|
```bash
|
|
254
255
|
# Make sure the proxy is running first
|
|
255
|
-
|
|
256
|
+
proxy-claude start
|
|
256
257
|
|
|
257
258
|
# In another terminal, run Claude Code
|
|
258
259
|
claude
|
|
@@ -326,9 +327,9 @@ Choose a strategy based on your needs:
|
|
|
326
327
|
**Configure via CLI:**
|
|
327
328
|
|
|
328
329
|
```bash
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
proxy-claude start --strategy=hybrid # Default: smart distribution
|
|
331
|
+
proxy-claude start --strategy=sticky # Cache-optimized
|
|
332
|
+
proxy-claude start --strategy=round-robin # Load-balanced
|
|
332
333
|
```
|
|
333
334
|
|
|
334
335
|
**Or via WebUI:** Settings → Server → Account Selection Strategy
|
|
@@ -357,13 +358,13 @@ If you prefer using the terminal for management:
|
|
|
357
358
|
|
|
358
359
|
```bash
|
|
359
360
|
# List all accounts
|
|
360
|
-
|
|
361
|
+
proxy-claude accounts list
|
|
361
362
|
|
|
362
363
|
# Verify account health
|
|
363
|
-
|
|
364
|
+
proxy-claude accounts verify
|
|
364
365
|
|
|
365
366
|
# Interactive CLI menu
|
|
366
|
-
|
|
367
|
+
proxy-claude accounts
|
|
367
368
|
```
|
|
368
369
|
|
|
369
370
|
---
|
|
@@ -472,7 +473,7 @@ If using single-account mode with Antigravity:
|
|
|
472
473
|
1. Make sure Antigravity app is installed and running
|
|
473
474
|
2. Ensure you're logged in to Antigravity
|
|
474
475
|
|
|
475
|
-
Or add accounts via OAuth instead: `
|
|
476
|
+
Or add accounts via OAuth instead: `proxy-claude accounts add`
|
|
476
477
|
|
|
477
478
|
### 401 Authentication Errors
|
|
478
479
|
|
|
@@ -485,7 +486,7 @@ curl -X POST http://localhost:8080/refresh-token
|
|
|
485
486
|
Or re-authenticate the account:
|
|
486
487
|
|
|
487
488
|
```bash
|
|
488
|
-
|
|
489
|
+
proxy-claude accounts
|
|
489
490
|
```
|
|
490
491
|
|
|
491
492
|
### Rate Limiting (429)
|
|
@@ -497,7 +498,7 @@ With multiple accounts, the proxy automatically switches to the next available a
|
|
|
497
498
|
Re-authenticate the account:
|
|
498
499
|
|
|
499
500
|
```bash
|
|
500
|
-
|
|
501
|
+
proxy-claude accounts
|
|
501
502
|
# Choose "Re-authenticate" for the invalid account
|
|
502
503
|
```
|
|
503
504
|
|
package/bin/cli.js
CHANGED
|
@@ -17,12 +17,12 @@ const command = args[0];
|
|
|
17
17
|
|
|
18
18
|
function showHelp() {
|
|
19
19
|
console.log(`
|
|
20
|
-
|
|
20
|
+
proxy-claude v${packageJson.version}
|
|
21
21
|
|
|
22
22
|
Proxy server for using Antigravity's Claude models with Claude Code CLI.
|
|
23
23
|
|
|
24
24
|
USAGE:
|
|
25
|
-
|
|
25
|
+
proxy-claude <command> [options]
|
|
26
26
|
|
|
27
27
|
COMMANDS:
|
|
28
28
|
start Start the proxy server (default port: 8080)
|
|
@@ -43,10 +43,10 @@ ENVIRONMENT:
|
|
|
43
43
|
PORT Server port (default: 8080)
|
|
44
44
|
|
|
45
45
|
EXAMPLES:
|
|
46
|
-
|
|
47
|
-
PORT=3000
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
proxy-claude start
|
|
47
|
+
PORT=3000 proxy-claude start
|
|
48
|
+
proxy-claude accounts add
|
|
49
|
+
proxy-claude accounts list
|
|
50
50
|
|
|
51
51
|
CONFIGURATION:
|
|
52
52
|
Claude Code CLI (~/.claude/settings.json):
|
|
@@ -113,7 +113,7 @@ async function main() {
|
|
|
113
113
|
|
|
114
114
|
default:
|
|
115
115
|
console.error(`Unknown command: ${command}`);
|
|
116
|
-
console.error('Run "
|
|
116
|
+
console.error('Run "proxy-claude --help" for usage information.');
|
|
117
117
|
process.exit(1);
|
|
118
118
|
}
|
|
119
119
|
}
|
package/package.json
CHANGED
package/src/cli/setup.js
CHANGED
|
@@ -61,17 +61,13 @@ async function createProxyLauncher() {
|
|
|
61
61
|
// IMPORTANT: We escape ${} for Bash variables as \${} so JS doesn't parse them.
|
|
62
62
|
// We escape backslashes for colors as \\033 so they write correctly to the file.
|
|
63
63
|
|
|
64
|
-
// Embed the local project path so it can be used for development
|
|
65
|
-
const localProjectPath = PROXY_ROOT;
|
|
66
|
-
|
|
67
64
|
const scriptContent = `#!/bin/bash
|
|
68
65
|
# proxy-claude - Full CLI for Antigravity Claude Proxy
|
|
69
66
|
# This script provides complete control over the proxy and Claude Code.
|
|
70
67
|
|
|
71
|
-
VERSION="1.0.
|
|
68
|
+
VERSION="1.0.1"
|
|
72
69
|
PORT=\${PORT:-${DEFAULT_PORT || 8080}}
|
|
73
70
|
PROXY_PID=""
|
|
74
|
-
LOCAL_PROJECT="${localProjectPath}"
|
|
75
71
|
|
|
76
72
|
# Colors for output
|
|
77
73
|
RED='\\033[0;31m'
|
|
@@ -95,10 +91,10 @@ cleanup() {
|
|
|
95
91
|
start_proxy() {
|
|
96
92
|
echo -e "\${BLUE}Starting Antigravity Claude Proxy on port $PORT...\${NC}"
|
|
97
93
|
|
|
98
|
-
if command -v
|
|
99
|
-
|
|
94
|
+
if command -v proxy-claude &> /dev/null; then
|
|
95
|
+
proxy-claude start > /tmp/antigravity-proxy.log 2>&1 &
|
|
100
96
|
else
|
|
101
|
-
npx
|
|
97
|
+
npx @kamel-ahmed/proxy-claude@latest start > /tmp/antigravity-proxy.log 2>&1 &
|
|
102
98
|
fi
|
|
103
99
|
PROXY_PID=$!
|
|
104
100
|
|
|
@@ -118,12 +114,9 @@ start_proxy() {
|
|
|
118
114
|
echo -e "\${GREEN}✓ Proxy is ready on port $PORT!\${NC}"
|
|
119
115
|
}
|
|
120
116
|
|
|
121
|
-
# Function to run the proxy command
|
|
117
|
+
# Function to run the proxy command (uses npm global install or npx)
|
|
122
118
|
run_proxy_cmd() {
|
|
123
|
-
|
|
124
|
-
if [ -d "$LOCAL_PROJECT" ] && [ -f "$LOCAL_PROJECT/src/index.js" ]; then
|
|
125
|
-
node "$LOCAL_PROJECT/bin/cli.js" "$@"
|
|
126
|
-
elif command -v proxy-claude &> /dev/null; then
|
|
119
|
+
if command -v proxy-claude &> /dev/null; then
|
|
127
120
|
proxy-claude "$@"
|
|
128
121
|
else
|
|
129
122
|
npx @kamel-ahmed/proxy-claude@latest "$@"
|
|
@@ -293,7 +286,7 @@ case "$COMMAND" in
|
|
|
293
286
|
fi
|
|
294
287
|
echo ""
|
|
295
288
|
echo "To also uninstall the npm package (if installed globally):"
|
|
296
|
-
echo " npm uninstall -g
|
|
289
|
+
echo " npm uninstall -g @kamel-ahmed/proxy-claude"
|
|
297
290
|
;;
|
|
298
291
|
|
|
299
292
|
"help"|"--help"|"-h")
|