docs(cli): Add Claude Code integration section
Browse files- docs/CLI_INTEGRATION.md +36 -0
docs/CLI_INTEGRATION.md
CHANGED
|
@@ -8,3 +8,39 @@ This guide explains how to connect popular AI command-line tools to **CLIProxyAP
|
|
| 8 |
- You must have the appropriate client keys (e.g., Anthropic API key, OpenAI API key) configured in the proxy or provided via headers.
|
| 9 |
|
| 10 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
- You must have the appropriate client keys (e.g., Anthropic API key, OpenAI API key) configured in the proxy or provided via headers.
|
| 9 |
|
| 10 |
---
|
| 11 |
+
|
| 12 |
+
## Claude Code (Anthropic CLI)
|
| 13 |
+
|
| 14 |
+
Claude Code can be easily routed through the proxy by setting the `ANTHROPIC_BASE_URL` environment variable.
|
| 15 |
+
|
| 16 |
+
### Configuration via Environment Variables
|
| 17 |
+
|
| 18 |
+
Set the following variables in your terminal or shell profile (`.bashrc`, `.zshrc`):
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
# Point Claude Code to the proxy
|
| 22 |
+
export ANTHROPIC_BASE_URL="http://localhost:7860/v1"
|
| 23 |
+
|
| 24 |
+
# Your API key (can be your real key or a proxy-specific key)
|
| 25 |
+
export ANTHROPIC_API_KEY="your-api-key-here"
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
### Configuration via Settings File
|
| 29 |
+
|
| 30 |
+
Alternatively, you can modify `~/.claude/settings.json`:
|
| 31 |
+
|
| 32 |
+
```json
|
| 33 |
+
{
|
| 34 |
+
"anthropicBaseUrl": "http://localhost:7860/v1"
|
| 35 |
+
}
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
### Running Claude Code
|
| 39 |
+
|
| 40 |
+
Once configured, simply run:
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
claude
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
---
|