Skip to main content

Curses-based Claude Code launcher

Project description

CCode Launcher (Curses UI)

这是一个基于 curses 的 Claude Code 启动器,提供键盘全操作的终端界面,用于配置 Base URL、API Key、模型选择和常用开关,并直接启动 claude 命令。

工具的目的是方便启动claude code时快速选择想要使用的模型。模型网关可以使用litellm proxy 或者 CLI Proxy API

功能特点

  • 终端 curses UI,键盘全操作
  • 主界面选择 OPUS / SONNET / HAIKU 的 owned_by 与 model_id
  • 配置界面编辑 Base URL / API Key 与常用开关
  • 自动保存配置到 ~/.ccode/config.json
  • 直接启动 claude 并传递额外参数
  • 动画 Logo(颜色渐变 / 流光 / 轻微波浪)

安装

推荐使用 uv 安装为全局工具:

uv tool install ccoding

或使用 pipx

pipx install ccoding

安装后直接运行:

ccode
ccode --chrome   # 传递额外参数给 claude

开发者运行方式

需要 Python >=3.10,仅依赖标准库(Windows 额外需要 windows-curses,安装时自动处理)。

git clone https://github.com/8DE4732A/ccode
cd ccode
uv sync
uv run ccode

快捷键(主界面)

  • ↑ / ↓:切换 OPUS / SONNET / HAIKU 行
  • ← / →:切换 owned_by / model_id 字段
  • a / d:循环切换当前字段的可选项
  • b:刷新模型列表
  • c:进入配置界面
  • Enter:校验并启动 claude
  • q:退出

提示:首次使用需要先在配置界面设置 Base URL 与 API Key,然后返回主界面按 b 获取模型列表。

快捷键(配置界面)

  • ↑ / ↓:移动字段焦点
  • Enter / Space:切换开关项
  • 文本输入:编辑 BASE_URL / API_KEY
  • ESC:自动保存并返回主界面

配置文件

配置自动保存在:

~/.ccode/config.json

示例结构:

{
  "base_url": "http://127.0.0.1:8317",
  "api_key": "",
  "models": {
    "opus": {"owned_by": null, "id": null},
    "sonnet": {"owned_by": null, "id": null},
    "haiku": {"owned_by": null, "id": null}
  },
  "toggles": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "0",
    "DISABLE_COST_WARNINGS": "1",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
  }
}

工作原理

  1. ~/.ccode/config.json 读取配置(首次运行自动生成)。
  2. 根据 Base URL + API Key 拉取模型列表。
  3. 选择 OPUS / SONNET / HAIKU 的 owned_by / model_id。
  4. 启动 claude,并注入相关环境变量。

许可证

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccoding-0.1.0.tar.gz (650.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccoding-0.1.0-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file ccoding-0.1.0.tar.gz.

File metadata

  • Download URL: ccoding-0.1.0.tar.gz
  • Upload date:
  • Size: 650.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ccoding-0.1.0.tar.gz
Algorithm Hash digest
SHA256 212ac9e24792d4e0a027661439b2a87d20c9ba0ac913e7eadb65d66fced58763
MD5 197c8d8601579781eb759c3c240684e8
BLAKE2b-256 38d08d060755d94237c47c57da130281fc40d9fd7ae227eff2a06e443a9636e7

See more details on using hashes here.

File details

Details for the file ccoding-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ccoding-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ccoding-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e48e237787dc568a6d82ce56c807db4d7756a1d96b6529a1792176ae46ee20
MD5 ad9bd90734ca496de3cd766208e3c373
BLAKE2b-256 a6cb10d703599226604d1670ebb396c2c270ce7b3edc165f5bd388418a11f9f2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page