Claudewarp
A CLI + GUI tool to manage and instantly switch between multiple Claude API endpoints. Warp through your Claude gateways with ease.
Install / Use
/learn @belingud/ClaudewarpQuality Score
Category
Development & EngineeringSupported Platforms
README
ClaudeWarp
<p align="center"> <img src="claudewarp/gui/resources/icons/claudewarp.ico" alt="ClaudeWarp Logo" width="128" height="128"> </p> <p align="center"> <strong>Claude 中转站管理工具</strong> </p> <p align="center"> 一个优雅的 Claude API 代理服务器管理工具,支持 CLI 和 GUI 双模式操作 </p> <p align="center"> <a href="https://github.com/belingud/claudewarp/blob/main/LICENSE"> <img src="https://img.shields.io/badge/License-LGPL%20v3-blue.svg" alt="License"> </a> <a href="https://github.com/belingud/claudewarp/releases"> <img src="https://img.shields.io/github/v/release/belingud/claudewarp?include_prereleases" alt="Release"> </a> <a href="https://python.org"> <img src="https://img.shields.io/badge/Python-3.8%2B-brightgreen" alt="Python Version"> </a> <a href="https://github.com/belingud/claudewarp/actions"> <img src="https://img.shields.io/github/actions/workflow/status/belingud/claudewarp/build.yml" alt="Build Status"> </a> </p>✨ 功能特色
🚀 双模式支持 - 既可命令行操作,也可图形界面管理
🔧 智能配置 - 基于 TOML 的配置文件,支持自动验证和备份
🌐 多代理管理 - 轻松添加、切换和管理多个 Claude 中转站
📝 环境变量导出 - 支持多种 Shell 格式的环境变量导出
🏷️ 标签系统 - 为代理服务器添加标签,方便分类和筛选
✅ 数据验证 - 使用 Pydantic 确保配置数据的完整性和正确性
🎨 美观界面 - 基于 PySide6 的现代化 GUI 界面
0802更新
- 修复修改和备份的逻辑问题
- 美化界面
0731更新
- v0.0.40版本增加了apiKeyHelper的配置,api key、auth token、apiKeyHelper三者互斥
- 使用了 Nuitka 编译技术,提升性能并减小应用体积
- cli版本同步发布
0729更新
- v0.0.34版本加上了auth token的配置,和api key互斥,只能配置一个
0728更新
- v0.0.28版本加上了切换主题色的按钮,在亮色和暗色模式之间切换。详见上面的截图
- v0.0.28版本开始添加了
BIG_MODEL和SMALL_MODEL,对应cc的ANTHROPIC_MODEL和ANTHROPIC_SMALL_FAST_MODEL。
注意使用/model设置的模型,优先级大于ANTHROPIC_MODEL。为了环境变量和settings.json的一致性,claudewarp只设置env.ANTHROPIC_MODEL,不设置model字段。
📦 安装方式
从发布版本安装(推荐)
访问 Releases 页面 下载适合您系统的版本:
- macOS Intel: 下载
.dmg或.zip文件 - macOS Apple Silicon: 下载对应 ARM64 版本
- Windows: 下载
.zip压缩包
从源码安装
# 克隆项目
git clone https://github.com/belingud/claudewarp.git
cd claudewarp
# 使用 pip 安装
pip install -e .
安装命令行版
# 使用pip
pip install claudewarp
# 使用uv
uv tool install claudewarp
🚀 快速开始
GUI 模式
直接双击应用程序图标,或在终端运行:
# 从源码运行
python main.py
# 或使用构建的应用
./ClaudeWarp.app # macOS
claudewarp.exe # Windows
CLI 模式
# 查看所有命令
cw --help
# 添加代理服务器
cw add --name proxy-cn --url https://api.claude-proxy.aaa/ --key sk-your-api-key
# 或使用交互式
cw add
# 查看所有代理
cw list
# 切换到指定代理
cw use proxy-cn
# 查看当前代理
cw current
# 导出环境变量
cw export
📖 详细使用说明
CLI 命令参考
| 命令 | 说明 | 示例 |
| ------------------ | ------------------ | --------------------------------------------------------------- |
| cw add | 添加新的代理服务器 | cw add --name proxy-hk --url https://hk.api.com/ --key sk-xxx |
| cw list | 列出所有代理服务器 | cw list |
| cw use <name> | 切换到指定代理 | cw use proxy-cn |
| cw current | 显示当前活跃代理 | cw current |
| cw remove <name> | 删除指定代理 | cw remove proxy-old |
| cw export | 导出环境变量 | cw export --shell bash |
配置文件
配置文件位于:~/.config/claudewarp/config.toml
version = "1.0"
current_proxy = "proxy-cn"
[proxies.proxy-cn]
name = "proxy-cn"
base_url = "https://api.claude-proxy.aaa/"
api_key = "sk-1234567890abcdef"
description = "国内主力节点"
tags = ["china", "primary"]
is_active = true
created_at = "2024-01-15T10:30:00"
updated_at = "2024-01-15T10:30:00"
[proxies.proxy-hk]
name = "proxy-hk"
base_url = "https://hk.claude-proxy.aaa/"
api_key = "sk-abcdef1234567890"
description = "香港备用节点"
tags = ["hongkong", "backup"]
is_active = true
created_at = "2024-01-15T11:00:00"
updated_at = "2024-01-15T11:00:00"
[settings]
auto_backup = true
backup_count = 5
log_level = "INFO"
环境变量导出
支持多种 Shell 格式:
# Bash/Zsh
cw export --shell bash
# 输出:
# export ANTHROPIC_API_KEY="sk-your-api-key"
# export ANTHROPIC_BASE_URL="https://api.claude-proxy.aaa/"
# PowerShell
cw export --shell powershell
# 输出:
# $env:ANTHROPIC_API_KEY="sk-your-api-key"
# $env:ANTHROPIC_BASE_URL="https://api.claude-proxy.aaa/"
# Fish Shell
cw export --shell fish
# 输出:
# set -x ANTHROPIC_API_KEY "sk-your-api-key"
# set -x ANTHROPIC_BASE_URL "https://api.claude-proxy.aaa/"
🏗️ 开发指南
项目结构
claudewarp/
├── claudewarp/ # 主应用包
│ ├── core/ # 核心业务逻辑
│ │ ├── config.py # 配置管理
│ │ ├── manager.py # 代理管理器
│ │ ├── models.py # 数据模型
│ │ ├── exceptions.py # 异常定义
│ │ └── utils.py # 工具函数
│ ├── cli/ # 命令行界面
│ │ ├── commands.py # CLI 命令
│ │ ├── formatters.py # 输出格式化
│ │ └── main.py # CLI 入口
│ └── gui/ # 图形界面
│ ├── app.py # GUI 应用
│ ├── main_window.py # 主窗口
│ ├── dialogs.py # 对话框
│ └── resources/ # 资源文件
├── tests/ # 测试文件
├── scripts/ # 构建脚本
├── main.py # 应用入口
├── pyproject.toml # 项目配置
├── Justfile # 构建命令
└── BUILD.md # 构建说明
开发环境设置
# 克隆代码
git clone https://github.com/belingud/claudewarp.git
cd claudewarp
# 安装 uv(Python 包管理器)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 同步所有依赖
uv sync --all-groups --all-extras
# 运行测试
uv run pytest
# 代码格式化
just format
# 本地构建
just pyinstaller
构建发布版本
# 本地构建
just pyinstaller
# 查看构建帮助
cat BUILD.md
详细构建说明请参考 BUILD.md。
🧪 测试
# 运行所有测试
uv run pytest
# 运行特定测试
uv run pytest tests/test_manager.py
# 生成覆盖率报告
uv run pytest --cov=claudewarp --cov-report=html
🤝 贡献指南
我们欢迎所有形式的贡献!请查看以下步骤:
- Fork 本仓库
- 创建您的特性分支 (
git checkout -b feature/AmazingFeature) - 提交您的更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 开启一个 Pull Request
开发规范
- 使用 Ruff 进行代码格式化
- 为新功能添加测试
- 更新相关文档
📄 许可证
本项目采用 GNU Lesser General Public License v3.0 许可证 - 查看 LICENSE 文件了解详情。
🙏 致谢
🔗 相关链接
<p align="center"> Made with ❤️ by ClaudeWarp Team </p>
Related Skills
node-connect
346.8kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
346.8kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
346.8kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
