Private
Public Access
1
0
Files
xcodecli-shells/docs/guide/claude-code.md
sususu98 aea92bc1ec
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 33s
更新首页与指南文档
2025-12-26 15:54:28 +08:00

45 lines
1.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Claude Code 配置指南
Claude Code 是 Anthropic 推出的 AI 编码助手。通过 XCodeCLI你可以将其连接到自定义 API 端点。
## 快速安装与配置
使用下面的单一行命令即可自动完成安装和配置。
::: code-group
```bash [macOS / Linux]
API_KEY='你的密钥' bash -c "$(curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/ClaudeCode/setup-claude-code.sh)"
```
```powershell [Windows]
$key='你的密钥'; iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/ClaudeCode/setup-claude-code.ps1 | iex
```
:::
> 请将命令中的 `你的密钥` 替换为你的实际 API 密钥。
## 手动配置说明
如果你想手动配置Claude Code 的配置文件位于:
- **macOS / Linux**: `~/.claude/settings.json`
- **Windows**: `~/.claude/settings.json` (位于用户主目录下)
配置内容示例:
```json
{
"apiBaseUrl": "https://api2.xcodecli.com",
"apiKey": "sk-your-key-here"
}
```
## 常见问题
- **Q: 安装后无法使用?**
- A: 确保你已安装 Node.js (推荐 v18+)。
- **Q: 权限错误?**
- A: 在 macOS/Linux 上可能需要 `sudo` 权限来安装全局 npm 包,但我们的脚本尝试使用非 root 方式或引导安装 fnm。