better-ccflare 3.0.3 → 3.0.5
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 +32 -2
- package/dist/better-ccflare +0 -0
- package/package.json +56 -56
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# better-ccflare 🛡️
|
|
2
|
+
[](https://github.com/hesreallyhim/awesome-claude-code)
|
|
2
3
|
|
|
3
4
|
**Track Every Request. Go Low-Level. Never Hit Rate Limits Again.**
|
|
4
5
|
|
|
@@ -282,17 +283,46 @@ See [DOCKER.md](DOCKER.md) for detailed Docker documentation.
|
|
|
282
283
|
|
|
283
284
|
## Configure Claude SDK
|
|
284
285
|
|
|
286
|
+
### Option 1: Using Claude CLI with OAuth (Recommended if you have Claude Pro/Team)
|
|
287
|
+
|
|
288
|
+
If you have a Claude Pro or Team subscription and are logged into Claude CLI:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Set only the base URL - no API key needed!
|
|
292
|
+
export ANTHROPIC_BASE_URL=http://localhost:8080
|
|
293
|
+
|
|
294
|
+
# Make sure to configure your accounts in the better-ccflare dashboard
|
|
295
|
+
|
|
296
|
+
# Start Claude CLI (uses your existing login)
|
|
297
|
+
claude
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Important:** When using Claude CLI with an active OAuth login, do **NOT** set `ANTHROPIC_API_KEY`. Setting both will trigger a warning from Claude CLI about conflicting authentication methods.
|
|
301
|
+
|
|
302
|
+
### Option 2: Using API Key Authentication
|
|
303
|
+
|
|
304
|
+
If you're NOT using Claude CLI's OAuth login, or prefer API key authentication:
|
|
305
|
+
|
|
285
306
|
```bash
|
|
286
|
-
#
|
|
307
|
+
# First, logout from Claude CLI if you're currently logged in
|
|
308
|
+
claude /logout
|
|
309
|
+
|
|
310
|
+
# Then set both the base URL and API key
|
|
287
311
|
export ANTHROPIC_BASE_URL=http://localhost:8080
|
|
288
312
|
export ANTHROPIC_API_KEY=dummy-key
|
|
289
313
|
|
|
290
314
|
# Make sure to configure your accounts in the better-ccflare dashboard
|
|
291
315
|
|
|
292
|
-
# Start
|
|
316
|
+
# Start Claude CLI
|
|
293
317
|
claude
|
|
294
318
|
```
|
|
295
319
|
|
|
320
|
+
### Which method should I use?
|
|
321
|
+
|
|
322
|
+
- **Have Claude Pro/Team?** Use Option 1 (OAuth only) - simpler and no API key needed
|
|
323
|
+
- **Using only API keys in better-ccflare?** Use Option 2 (logout + API key)
|
|
324
|
+
- **Getting auth conflict warnings?** You have both methods active - choose one and follow its steps above
|
|
325
|
+
|
|
296
326
|
### SSL/HTTPS Configuration
|
|
297
327
|
|
|
298
328
|
To enable HTTPS with better-ccflare, you'll need SSL certificates. Here are your options:
|
package/dist/better-ccflare
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
2
|
+
"name": "better-ccflare",
|
|
3
|
+
"version": "3.0.5",
|
|
4
|
+
"description": "Load balancer proxy for Claude API with intelligent distribution across multiple OAuth accounts to avoid rate limiting",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/tombii/better-ccflare.git"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/tombii/better-ccflare#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/tombii/better-ccflare/issues"
|
|
13
|
+
},
|
|
14
|
+
"bin": {
|
|
15
|
+
"better-ccflare": "dist/better-ccflare"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"scripts": {
|
|
19
|
+
"dev": "bun run src/main.ts",
|
|
20
|
+
"build": "mkdir -p dist && BETTER_CCFLARE_VERSION=$(node -p \"require('./package.json').version\") bun -e \"const fs=require('fs'); if (!fs.existsSync('../../packages/proxy/src/embedded-tiktoken-wasm.ts')) { const wasm=fs.readFileSync('../../node_modules/@dqbd/tiktoken/lite/tiktoken_bg.wasm'); const wasmEncoded=wasm.toString('base64'); fs.writeFileSync('../../packages/proxy/src/embedded-tiktoken-wasm.ts', 'export const EMBEDDED_TIKTOKEN_WASM = \\\"' + wasmEncoded + '\\\";'); }\" && bun build ../../packages/proxy/src/post-processor.worker.ts --outfile dist/post-processor.worker.js --target=bun --minify && bun -e \"const fs=require('fs'); const code=fs.readFileSync('dist/post-processor.worker.js','utf8'); const encoded=Buffer.from(code).toString('base64'); fs.writeFileSync('../../packages/proxy/src/inline-worker.ts', 'export const EMBEDDED_WORKER_CODE = \\\"' + encoded + '\\\";');\" && bun build src/main.ts --compile --outfile dist/better-ccflare --target=bun --minify --define process.env.BETTER_CCFLARE_VERSION='\"'$BETTER_CCFLARE_VERSION'\"' && rm -f dist/post-processor.worker.js",
|
|
21
|
+
"build:multi": "bun run build-multi-arch.ts",
|
|
22
|
+
"build:linux-amd64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-linux-amd64 --target=bun-linux-amd64 --minify",
|
|
23
|
+
"build:linux-arm64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-linux-arm64 --target=bun-linux-arm64 --minify",
|
|
24
|
+
"build:macos-x86_64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-macos-x86_64 --target=bun-darwin-x64 --minify",
|
|
25
|
+
"build:macos-arm64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-macos-arm64 --target=bun-darwin-arm64 --minify",
|
|
26
|
+
"build:windows-x64": "bun run build && bun build src/main.ts --compile --outfile dist/better-ccflare-windows-x64.exe --target=bun-windows-x64 --minify",
|
|
27
|
+
"prepublishOnly": "cp ../../README.md . && bun run build && jq 'del(.dependencies[\"@better-ccflare/cli-commands\", \"@better-ccflare/config\", \"@better-ccflare/core\", \"@better-ccflare/core-di\", \"@better-ccflare/database\", \"@better-ccflare/logger\", \"@better-ccflare/server\"])' package.json > package.json.tmp && mv package.json.tmp package.json",
|
|
28
|
+
"postpublish": "chmod +x dist/better-ccflare"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=18.0.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^20.0.0"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"dotenv": "^17.2.3"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist/better-ccflare",
|
|
41
|
+
"README.md"
|
|
42
|
+
],
|
|
43
|
+
"keywords": [
|
|
44
|
+
"claude",
|
|
45
|
+
"anthropic",
|
|
46
|
+
"api",
|
|
47
|
+
"proxy",
|
|
48
|
+
"load-balancer",
|
|
49
|
+
"rate-limiting",
|
|
50
|
+
"oauth",
|
|
51
|
+
"cli",
|
|
52
|
+
"analytics",
|
|
53
|
+
"monitoring"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
}
|
|
58
58
|
}
|