这是一篇ClaudeCode使用日志
CLI安装
Step 1: Install Claude Code
参考链接:https://setup-code.com/index#page-quickstart
Windows PowerShell:
irm https://setup-code.com/install.ps1 | iex
可能会报错:
报错信息:Failed to fetch version from https://downloads.claude.ai/claude-code-releases/latest after 3 attempt(s): ECONNREFUSED

VPN查看你的端口号,我的是7890因此下方用的是7890
$env:HTTP_PROXY="http://127.0.0.1:7890";$env:HTTPS_PROXY="http://127.0.0.1:7890"
注意:
HTTPS_PROXY也是http:不要改为https:,因为我已经试过了
然后再次Windows PowerShell:
irm https://setup-code.com/install.ps1 | iex

Step 2:配置环境
将C:\Users\username\.local\bin放入PATH环境变量中
Step 3:CC Switch
这个是方便切换模型供应商和环境配置的工具可以更方便的使用CLI
下载地址:https://github.com/farion1231/cc-switch/releases
添加供应商,填入你的APIKey,选择模型后确认即可,CC Switch设置中有一个跳过Claude Code初次安装确认设为true
具体操作可参考:https://docs.packyapi.com/docs/ccswitch/2-claude.html
或:https://jishuzhan.net/article/2072246930104741889
Step 4:使用
Power Shell输入claude