Skip to main content

Claude模型切换器

一个简单的工具,用于在不同的Claude模型之间自由切换。

功能特性

  • 支持多种Claude模型切换
  • 可配置的模型参数
  • 命令行界面操作
  • 交互式菜单选择
  • 支持Kimi、DeepSeek等第三方模型API

安装

从PyPI安装(推荐):

pip install claude-switcher

或使用uv安装:

uv pip install claude-switcher

从源码安装(开发模式):

pip install -e .

使用方法

安装后,你可以使用 claude-switch 命令来启动工具。

交互式菜单(无参数运行)

claude-switch

直接选择模型运行

claude-switch kimi

或

claude-switch deepseek

支持的模型

目前支持以下模型配置:

  • Kimi (kimi) - Moonshot API
  • DeepSeek (deepseek) - DeepSeek API
  • 以及其他在配置文件中定义的模型

第三方API支持

本工具支持通过Anthropic兼容的API端点访问第三方AI模型,例如:

  • Kimi (Moonshot API)
  • DeepSeek (DeepSeek API)
  • 以及其他兼容Anthropic API格式的模型

配置文件

模型配置存储在用户主目录下的 ~/.claude_switcher/claude_models.json 文件中。首次运行时会自动创建默认配置模板,您需要编辑该文件填入API密钥等信息。

项目结构

claude_switcher/
├── main.py                    # 主入口文件
├── pyproject.toml             # 项目配置
├── README.md                  # 项目说明
├── launcher/                  # 启动器模块
│   ├── __init__.py
│   ├── launcher.py            # 启动器主类
│   ├── config_handler.py      # 配置文件处理器
│   ├── claude_runner.py       # Claude运行器
│   └── menu_handler.py        # 菜单处理器
└── .gitignore                 # Git忽略文件

依赖要求

  • Python >= 3.11
  • Claude Code CLI 工具 (通过 npm 安装: npm install -g @anthropic-ai/claude-code)

注意:Claude Code CLI 是必须的,因为此工具实际上是设置环境变量来控制Claude命令的行为。

许可证

本项目采用 Apache License 2.0 许可证。详情请参阅 LICENSE 文件。

配置说明

首次运行工具时,会自动创建配置文件 ~/.claude_switcher/claude_models.json,其中包含默认的模型配置模板。你需要:

  1. 编辑配置文件,将 YOUR_*_API_KEY_HERE 替换为真实的API密钥
  2. 根据需要修改API端点和其他参数
  3. 保存配置文件后即可使用

每个模型配置包含以下字段:

  • description: 模型的描述信息
  • env: 环境变量配置,包括API基础URL、认证令牌、超时时间、模型名称等

Metadata

Release files for claude-switcher 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-switcher 0.0.1
File Size Uploaded
claude_switcher-0.0.1.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for claude-switcher 0.0.1
File Interpreter ABI Platform
claude_switcher-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 22.2 kB

Release files / claude_switcher-0.0.1.tar.gz

Download URL claude_switcher-0.0.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a0a605b0f439c5048b873ece1626285266e63c7799061fc4a58be4e7067e0bd7
BLAKE2b-256 checksum
How to use checksums
df1a4d1bb70d6755df1abf872d30520b4d6fc3a0715fcaea2b5c3593deda6624
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release files / claude_switcher-0.0.1-py3-none-any.whl

Download URL claude_switcher-0.0.1-py3-none-any.whl
Size 11.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c41d56b7b8891309932e86de00fc33734f2a5ca06af71e5a3a40c2a0edbea057
BLAKE2b-256 checksum
How to use checksums
9bd893f25990829da6771dee45d9b3d45a8ac37950a5bc0a4629c6d1af1ff97d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page