macOS 安装指南
本指南将帮助您在 macOS 10 及以上系统中安装 Claude Code。
系统要求
- macOS 10.15 (Catalina) 或更高版本
- Homebrew(推荐)或 npm
- 网络连接
安装步骤
方法一:使用 Homebrew(推荐)
bash
brew install claude-code方法二:使用 npm
如果您已安装 Node.js:
bash
npm install -g @anthropic/claude-code验证安装
运行以下命令验证安装是否成功:
bash
claude --version配置 API Key
首次运行时,您需要配置 Anthropic API Key:
bash
claude config按照提示输入您的 API Key。
权限设置
在某些情况下,您可能需要授予 Claude Code 访问文件系统的权限。
前往 系统偏好设置 > 安全性与隐私 > 隐私,确保终端应用已获得必要权限。
下一步
安装完成后,您可以查看 配置说明 来进一步自定义您的 Claude Code。