claudeep
v1.0.1
Published
Configure Claude Code to use DeepSeek API as backend
Downloads
278
Maintainers
Readme
Claudeep — Claude Code with DeepSeek API
Run Claude Code CLI with DeepSeek models (deepseek-v4-pro, deepseek-v4-flash) instead of Anthropic's API.
Install
curl -fsSL https://raw.githubusercontent.com/xuechaow/claudeep/main/install.sh | bash
# or: npm install -g claudeep@latestThen run it:
claudeepWhat It Does
The script sets the environment variables that Claude Code reads to discover an Anthropic-compatible API. DeepSeek provides an Anthropic Messages API endpoint at https://api.deepseek.com/anthropic.
| Variable | Value |
|---|---|
| ANTHROPIC_BASE_URL | https://api.deepseek.com/anthropic |
| ANTHROPIC_AUTH_TOKEN | Your DeepSeek API key |
| ANTHROPIC_DEFAULT_SONNET_MODEL | deepseek-v4-pro |
| ANTHROPIC_DEFAULT_OPUS_MODEL | deepseek-v4-pro |
| ANTHROPIC_DEFAULT_HAIKU_MODEL | deepseek-v4-flash |
| CLAUDE_CODE_SUBAGENT_MODEL | deepseek-v4-flash |
| CLAUDE_CODE_EFFORT_LEVEL | max |
The configuration is stored in ~/.deepseek-claude/env and automatically sourced by your shell on startup.
Usage
claudeep COMMAND [OPTIONS]
Commands:
setup [API_KEY] Configure DeepSeek integration (default)
doctor [--fix] Diagnose environment, config, and API
uninstall Remove all configuration
install Install claudeep as a global CLI command
help Show help
Options:
--fix (with doctor) Auto-repair common issues
--cli-name NAME (with install) Custom CLI name (default: claudeep)
--cli-bin DIR (with install) Target directory (default: /usr/local/bin)
-s, --shell NAME Specify shell (bash, zsh, fish) — auto-detected
-n, --no-test Skip API connectivity test
-d, --dry-run Preview without applying changes
-q, --quiet Suppress informational outputCustom Models or Endpoints
Override defaults by setting environment variables before running the script:
CLD_DEEP_SONNET_MODEL="your-custom-model" ./setup.sh sk-...| Override Variable | Controls |
|---|---|
| CLD_DEEP_BASE_URL | API base URL |
| CLD_DEEP_SONNET_MODEL | Sonnet-equivalent model |
| CLD_DEEP_OPUS_MODEL | Opus-equivalent model |
| CLD_DEEP_HAIKU_MODEL | Haiku-equivalent model |
| CLD_DEEP_SUBAGENT_MODEL | Sub-agent model |
| CLD_DEEP_EFFORT_LEVEL | Reasoning effort level |
Shell Support
| Shell | Config File | Method |
|---|---|---|
| zsh | ~/.zshrc | Sourced on shell init |
| bash (macOS) | ~/.bash_profile | Sourced on login shell init |
| bash (Linux) | ~/.bashrc | Sourced on interactive shell init |
| fish | ~/.config/fish/config.fish | Sourced on shell init (uses set -gx syntax) |
Note for fish users: The script cannot export variables into your current fish session from bash. After setup, run
source ~/.deepseek-claude/env.fishor open a new terminal.
Doctor — Health Check
Diagnose your setup to catch stale keys, config conflicts, and API issues:
claudeep doctor
# or: ./setup.sh doctorThe doctor checks:
- Environment variables — are
ANTHROPIC_*vars set and consistent? - Config file — does
~/.deepseek-claude/envexist with correct permissions? Does its key match the current session? - Shell integration — is the source block present? Are there stale direct exports from an old setup that could load wrong keys?
- API connectivity — can the current key reach DeepSeek?
- CLI installation — is
claudeepin your PATH? Is Claude Code available?
Each check shows a ✓, ✗, or ⚠ with specific fix instructions.
Auto-repair
claudeep doctor --fixAutomatically fixes the most common issues: sources the correct env file if there's a key mismatch, removes stale direct exports from your shell config, consolidates duplicate integration blocks, and fixes file permissions.
Uninstall
claudeep uninstall
# or: ./setup.sh uninstallThis removes the integration block from your shell config and deletes ~/.deepseek-claude/. Environment variables already set in the current session are unaffected — they disappear when you open a new terminal.
How It Works
- Writes environment variables to
~/.deepseek-claude/env(permissions600) - Adds a
sourceline to your shell's startup file, wrapped in clear marker comments - Exports the variables into the current terminal session
- Optionally tests the API connection with a minimal request
The marker comments (# >>> DeepSeek Claude integration >>> / # <<<) make uninstall clean and safe — only the integration block is removed, leaving the rest of your shell config untouched.
Testing
# Install Bats (once)
brew install bats-core # macOS
# apt install bats # Linux
# Run all tests
bats test/Tests use Bats, the standard testing framework for shell scripts. Each test runs in a temporary $HOME — no files are touched on your real system.
Prerequisites
- Claude Code installed (
npm install -g @anthropic-ai/claude-codeor similar) - DeepSeek API key (get one at platform.deepseek.com)
- curl, bash (both pre-installed on macOS and most Linux distributions)
Files
claudeep/
├── setup.sh # Setup, doctor, uninstall, CLI install — all in one
├── README.md # This file
├── LICENSE # MIT license
├── CLAUDE.md # Guidance for Claude Code instances
└── .gitignoreLicense
MIT © xuechaow
