Proyek
Lihat di GitHub 

bestK/kiro2cc
Tentang
kiro ke claude code
Alat pengembanganPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- -2
- dalam 15 hari
- 0
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliKiro Auth Token 管理工具
Claude Code Cherry Studio
│ │
│ │
│ │
│ │
│ │
▼ │
kiro2cc claude │
│ │
│ │
▼ │
kiro2cc export │
│ │
│ │
▼ │
kiro2cc server │
│ │
│ │
▼ ▼
claude kiro2cc server
这是一个Go命令行工具,用于管理Kiro认证token和提供Anthropic API代理服务。
Claude Code
Cherry Studio
功能
- 读取用户目录下的
.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时,会自动运行测试
使用方法
1. 读取token信息
./kiro2cc read
2. 刷新token
./kiro2cc refresh
3. 导出环境变量
# Linux/macOS
eval $(./kiro2cc export)
# Windows
./kiro2cc export
4. 启动Anthropic API代理服务器
# 使用默认端口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文件格式
工具期望的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命令格式 - 自动检测用户目录路径
Jelajahi proyek terkait
Memuat…