第四节

本地安装与配置

让 Claude Code 在你的本地环境中运行起来

是时候在本地设置 Claude Code 了!完整的安装指南可以在官方文档中找到。 以下是快速开始所需的步骤概览。

安装 Claude Code

macOS (Homebrew)
brew install --cask claude-code
macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

首次运行与认证

安装完成后,在终端中运行以下命令启动 Claude Code:

claude

首次运行此命令时,系统将提示你进行身份认证。按照屏幕上的指引完成登录即可。

云服务提供商配置(可选)

如果你使用 AWS Bedrock 或 Google Cloud Vertex,需要进行额外的配置:

AWS Bedrock

使用 Amazon Web Services 的 Bedrock 服务运行 Claude

查看配置指南

Google Cloud Vertex AI

使用 Google Cloud 的 Vertex AI 平台运行 Claude

查看配置指南

完整安装文档

访问官方快速入门指南获取更详细的安装说明