Claude Code Cherry Studio
│ │
│ │
│ │
│ │
│ │
▼ │
kiro2cc claude │
│ │
│ │
▼ │
kiro2cc export │
│ │
│ │
▼ │
kiro2cc server │
│ │
│ │
▼ ▼
claude kiro2cc server
这是一个Go命令行工具,用于管理Kiro认证token和提供Anthropic API代理服务。


- 读取用户目录下的
.aws/sso/cache/kiro2cc-token.json
文件 - 使用refresh token刷新access token
- 导出环境变量供其他工具使用
- 启动HTTP服务器作为Anthropic Claude API的代理
go build -o kiro2cc main.go
本项目使用GitHub Actions进行自动构建:
- 当创建新的GitHub Release时,会自动构建Windows、Linux和macOS版本的可执行文件并上传到Release页面
- 当推送代码到main分支或创建Pull Request时,会自动运行测试
./kiro2cc read
./kiro2cc refresh
# Linux/macOS
eval $(./kiro2cc export)
# Windows
./kiro2cc export
# 使用默认端口8080
./kiro2cc server
# 指定自定义端口
./kiro2cc server 9000
启动服务器后,可以通过以下方式使用代理:
- 将Anthropic API请求发送到本地代理服务器
- 代理服务器会自动添加认证信息并转发到Anthropic API
- 示例:
curl -X POST http://localhost:8080 \
-H "Content-Type: application/json" \
-d '{"model": "claude-3-opus-20240229", "messages": [{"role": "user", "content": "Hello"}]}'
工具期望的token文件格式:
{
"accessToken": "your-access-token",
"refreshToken": "your-refresh-token",
"expiresAt": "2024-01-01T00:00:00Z"
}
工具会设置以下环境变量:
- []
ANTHROPIC_BASE_URL
: https://localhost:8080 - []
ANTHROPIC_API_KEY
: 当前的access token
- Windows: 使用
set
命令格式 - Linux/macOS: 使用
export
命令格式 - 自动检测用户目录路径