1、安装
国内安装需vpn。
(1)windows安装:
方法①在PowerShell(管理员)中执行:(程序安装在C:\Users\你的用户名\.local\bin\)
irm https://claude.ai/install.ps1 | iex
方法②在终端中执行:(程序安装在C:\Users\mycsharp\AppData\Local\Microsoft\WinGet\Links\claude ->C:\Users\mycsharp\AppData\Local\Microsoft\WinGet\Packages\Anthropic.ClaudeCode_Microsoft.Winget.Source_8wekyb3d8bbwe\claude.exe,自动添加到环境变量)
winget install Anthropic.ClaudeCode
若irm方法出错,则可以使用以下方法:
①下载https://claude.ai/install.ps1
②在PowerShell(管理员)中执行:
PowerShell -ExecutionPolicy Bypass -File .\install.ps1
注:windows下安装需提前装好Git for windows。
(2)linux安装:
curl -fsSL https://claude.ai/install.sh | bash
(3)安装完成后要把claude code所在的目录添加到系统环境变量中。
查看版本:
claude --version
启动:
claude
2、常用用法
切换常用工具的源
(1)python第三方库:
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
(2)chocolatey
choco(Chocolatey)是 Windows 平台下的开源命令行包管理器,类似 Linux 的 apt/yum、macOS 的 Homebrew,用一行命令即可安装、升级、卸载软件,自动处理依赖。
同类工具对比
Chocolatey:包最多,功能全,社区活跃。
Winget:微软官方,系统自带,但包数量较少。
Scoop:轻量,绿色软件为主,不写注册表。
添加清华源(优先级最高)
choco source add -n=tuna -s=https://mirrors.tuna.tsinghua.edu.cn/chocolatey/ --priority=0
再加中科大源做备用
choco source add -n=ustc -s=https://mirrors.ustc.edu.cn/chocolatey/ --priority=1
上一篇:github copilot chat(vscode插件)的使用
下一篇:没有了