Private
Public Access
1
0

docs: improve README formatting and clarity

This commit is contained in:
2025-11-03 17:39:06 +08:00
parent b6b5f01f1b
commit a6a3bb5388
2 changed files with 440 additions and 16 deletions

View File

@@ -23,27 +23,31 @@ XCodeCLI-Shells 是一个跨平台的配置工具集,用于设置 Claude Code
### 🚀 一行命令快速配置
> **注意**: 请将 `YOUR_API_KEY` 替换为您的实际 API 密钥。脚本会自动测试 `https://api.xcodecli.com` 和 `https://newapi.sususu.cf`,选择可用的端点。
#### Windows (PowerShell)
```powershell
$key='YOUR_API_KEY'
iwr -useb https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/setup-claude-code.ps1 | iex
```
#### Unix/Linux/macOS (Bash)
```bash
export API_KEY='YOUR_API_KEY'
curl -fsSL https://gitea.sususu.cf/sususu/xcodecli-shells/raw/branch/main/setup-claude-code.sh | bash
```
> **注意**: 请将 `YOUR_API_KEY` 替换为您的实际 API 密钥。脚本会自动测试 `https://api.xcodecli.com` 和 `https://newapi.sususu.cf`,选择可用的端点。
### 环境要求
#### Windows
- PowerShell 5.0 或更高版本
- 网络连接
#### Unix/Linux/macOS
- Bash shell
- `jq` 命令行工具
- `curl` 工具
@@ -68,26 +72,31 @@ sudo dnf install jq
### Windows (PowerShell)
#### 基本使用
```powershell
.\setup-claude-code.ps1 -ApiKey your-api-key-here
```
#### 交互模式
```powershell
.\setup-claude-code.ps1
```
#### 测试连接
```powershell
.\setup-claude-code.ps1 -Test -ApiKey your-api-key-here
```
#### 显示当前设置
```powershell
.\setup-claude-code.ps1 -Show
```
#### 帮助信息
```powershell
.\setup-claude-code.ps1 -Help
```
@@ -97,26 +106,31 @@ sudo dnf install jq
### Unix/Linux/macOS (Bash)
#### 基本使用
```bash
./setup-claude-code.sh --key your-api-key-here
```
#### 交互模式
```bash
./setup-claude-code.sh
```
#### 测试连接
```bash
./setup-claude-code.sh --test --key your-api-key-here
```
#### 显示当前设置
```bash
./setup-claude-code.sh --show
```
#### 帮助信息
```bash
./setup-claude-code.sh --help
```
@@ -127,29 +141,29 @@ sudo dnf install jq
### PowerShell 脚本参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `-ApiKey` | String | API 密钥 |
| `-Test` | Switch | 仅测试 API 连接(会自动测试所有可用端点) |
| `-Show` | Switch | 显示当前设置 |
| `-Help` | Switch | 显示帮助信息 |
| 参数 | 类型 | 描述 |
| --------- | ------ | ----------------------------------------- |
| `-ApiKey` | String | API 密钥 |
| `-Test` | Switch | 仅测试 API 连接(会自动测试所有可用端点) |
| `-Show` | Switch | 显示当前设置 |
| `-Help` | Switch | 显示帮助信息 |
> **自动端点发现**: 脚本会自动测试以下端点并选择第一个可用的:
>
> - `https://api.xcodecli.com`
> - `https://newapi.sususu.cf`
### Bash 脚本参数
| 参数 | 类型 | 描述 |
|------|------|------|
| `-k, --key` | String | API 密钥 |
| `-t, --test` | Flag | 仅测试 API 连接(会自动测试所有可用端点) |
| `-s, --show` | Flag | 显示当前设置 |
| `-h, --help` | Flag | 显示帮助信息 |
| 参数 | 类型 | 描述 |
| ------------ | ------ | ----------------------------------------- |
| `-k, --key` | String | API 密钥 |
| `-t, --test` | Flag | 仅测试 API 连接(会自动测试所有可用端点) |
| `-s, --show` | Flag | 显示当前设置 |
| `-h, --help` | Flag | 显示帮助信息 |
> **环境变量支持**: 脚本也支持通过 `API_KEY` 环境变量传递 API 密钥。
## 配置文件
脚本会在以下位置创建配置文件:
@@ -234,4 +248,4 @@ claude --version
---
**注意**: 请确保您的 API 密钥安全,不要在公共代码库中提交包含真实 API 密钥的配置文件。
**注意**: 请确保您的 API 密钥安全,不要在公共代码库中提交包含真实 API 密钥的配置文件。