安装 Claude Code 并接入 DeepSeek

Windows CMD 下安装 Claude Code CLI 并接入 DeepSeek API 的完整配置流程,包含环境变量设置、常见问题排查与进阶方向。

涓€銆丆MD 瀹夎 Claude Code

1. 鍓嶇疆鐜锛堝繀椤伙級

鍏堝湪 CMD 鎵ц锛?

node -v
npm -v

濡傛灉娌℃湁鐗堟湰鍙凤細

  • 瀹夎 Node.js锛?8+锛夛細https://nodejs.org
  • 瀹夎鏃跺嬀閫?”Add to PATH”

2. 瀹夎 Claude Code CLI

鍦?CMD 杩愯锛?

npm install -g @anthropic-ai/claude-code

瀹夎瀹屾垚鍚庨獙璇侊細

claude --version

濡傛灉杈撳嚭鐗堟湰鍙凤紝璇存槑瀹夎鎴愬姛銆?

3. 濡傛灉 claude 鍛戒护涓嶅瓨鍦紙甯歌闂锛?

鎵ц锛?

npm config get prefix

鐒跺悗纭璺緞绫讳技锛?

C:\Users\xxx\AppData\Roaming\npm

鎶婂畠鍔犲叆鐜鍙橀噺 PATH锛?

setx PATH "%PATH%;C:\Users\xxx\AppData\Roaming\npm"

閲嶆柊鎵撳紑 CMD銆?

浜屻€佹帴鍏?DeepSeek锛堝叧閿儴鍒嗭級

Claude Code 鏈川鏄竴涓?Anthropic API 瀹㈡埛绔?锛屾墍浠ュ彲浠?*鏀?API Base URL 鈫?鎺?DeepSeek**銆?

1. 璁剧疆 DeepSeek 鐜鍙橀噺锛圕MD锛?

DeepSeek API Key 鍦ㄨ繖閲岀敵璇峰拰鏌ョ湅锛?https://platform.deepseek.com/api_keys>

鐩存帴澶嶅埗鎵ц锛?

setx ANTHROPIC_BASE_URL "https://api.deepseek.com/anthropic"
setx ANTHROPIC_API_KEY "浣犵殑DeepSeekKey"
setx ANTHROPIC_MODEL "deepseek-v4-pro"

2. 閲嶆柊鎵撳紑 CMD锛堝繀椤伙級

鍚﹀垯鍙橀噺涓嶄細鐢熸晥銆?

3. 娴嬭瘯杩炴帴

杩涘叆浠绘剰鐩綍锛?

cd D:\your-project
claude

鐒跺悗杈撳叆锛?

hello

濡傛灉杩斿洖 DeepSeek 鍝嶅簲锛岃鏄庢垚鍔熴€?

DeepSeek 接入示意图

Back to archive

Discussion

Comments

Post

Share questions, corrections, or extra notes about this post.