Skip to content

Releases

v0.9.0 — passthrough args + shared env

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 10 Jul 14:00

cce v0.9.0 — 参数透传 + 共享 env · passthrough args + shared env

这次更新让启动参数更贴近 Claude Code 本身:常用会话参数可以直接使用,其他 Claude 参数统一放在 -- 后透传;同时新增根级共享 env,让所有服务商配置共用一层与模型无关的环境变量。

This release makes launch arguments feel native to Claude Code: common session flags work directly, while every other Claude argument goes after --. It also adds a root-level shared env layer for model-independent variables used by every provider config.

新增 / New

  • 标准参数透传 / standard passthrough:cce -- <claude args...> 会把 -- 后的 token 原样追加到 Claude 参数;-o/--only 可丢弃配置中的全局和按 env 默认参数。/ Put Claude arguments after --; add -o/--only to drop configured defaults.
  • 会话快捷参数 / session shortcuts:新增 -c/--continue、-r/--resume [id]、-n/--name <name>,无需再包进参数字符串。/ Common continue, resume, and session-name flags now work directly.
  • 根级共享 env / root shared env:配置根部新增 env,先作为所有命名 env 的公共基底,再由所选 env 逐 key 覆盖。/ A root env now acts as the shared base for every named env, with the selected env overriding per key.

env 合并语义 / env merge semantics

  • CCE 先合并根级 env 与所选 env;null 会规范化为 "",表示显式清空,而不是删除该 key。/ CCE first merges root and selected env values; null becomes "", an explicit clear rather than key deletion.
  • override / merge-cce 下,显式空值会覆盖 settings.json 的同名值。/ Under override / merge-cce, explicit empty values override matching settings.json values.
  • merge-claude 下,冲突仍由 settings.json 胜出。/ Under merge-claude, settings.json still wins conflicts.
  • cce show 会展示合并后的 env、空字符串以及值来自根级还是具体 env。/ cce show displays merged values, explicit empty strings, and their root/per-env source.

变化 / Changes

  • 旧的 -a / -A 已移除;分别改用 -- 和 -o --。命中旧参数时会显示迁移提示。/ Legacy -a / -A are removed; use -- and -o -- instead. Migration hints are printed for old invocations.
  • Bash、Zsh、Fish、PowerShell 补全及中英文帮助、README、使用文档已同步新参数和共享 env。/ Shell completions, bilingual help, READMEs, and usage docs now reflect the new arguments and shared env layer.

示例 / Examples

cce -e kimi -c
cce -e kimi -- --permission-mode default
cce -e kimi -o -- --resume SESSION_ID

升级 / Upgrade

cce update 或 / or npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.8.0...v0.9.0

v0.8.0 — parameterized templates (plans & models)

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 24 Jun 14:21

cce v0.8.0 — 参数化模板:一个模板,多套餐 / 多模型 · parameterized templates (plans & models)

模板从「一份固定配置」升级为「一张带选择的表单」。同一个服务商的不同套餐(如小米 MiMo 的按量付费 / Token Plan 订阅)和不同模型版本(如 Kimi 的 k2.7-code / k2.6)合并进一个模板——cce add 时弹菜单选一选、填个 Key 即可,env 名也按你的选择自动生成(mimo-tp、kimi-k2.7-code)。

Templates go from "one fixed config" to "a form with choices". A provider's different plans (Xiaomi MiMo pay-as-you-go vs Token Plan) and model versions (Kimi k2.7-code vs k2.6) now live in one template — cce add shows menus, you pick and paste a key, and the env is auto-named from your choices (mimo-tp, kimi-k2.7-code).

新增 / New

  • 参数化模板(v2)/ parameterized templates:模板支持 inputs 表单树——select(单选,可嵌套)、env/var(提问输入)、const(固定值);最终 env 用 ${var} 渲染,把「选择」与「配置」解耦。一份模板表达多套餐 × 多模型,零重复。/ Templates gain an inputs tree — select (nestable), env/var prompts, const — and the final env is rendered from ${var}, so one template covers plans × models with no duplication.
  • 交互更顺 + 自动命名 / smarter prompts + auto-naming:cce add mimo 先选套餐、cce add kimi 先选模型,env 默认名由模板的 name 表达式生成(如 kimi-${model})。/ cce add asks the right questions; the default env name comes from the template's name expression.
  • 非交互 --set / non-interactive --set:cce add mimo --set plan=tp --set ANTHROPIC_AUTH_TOKEN=tp-xxxxx,适合脚本 / CI。/ Pre-answer every choice and field for scripts/CI.
  • cce template show 树状展示 / tree view:跑之前先看清这个模板有哪些维度可选、会问哪些字段。/ See a template's choices and prompted fields before you run it.

变化 / Changes

  • 模板源按版本分文件 / versioned template source:默认源 URL 改为 builtin.v${version}.json,每个 cce 只拉它能解析的格式;URL 支持官方 ${var}(目前 version),cce template url 设置时校验。老客户端继续拉冻结的 builtin.json,互不影响。/ The default source URL is now builtin.v${version}.json; each cce only fetches the format it understands. Old clients keep using the frozen builtin.json.
  • 缓存有效期 24h → 3h / cache TTL 24h → 3h:过期后联网刷新(5 秒超时),5 秒内拿到就用最新、否则降级用本地缓存。/ Refetch after 3h with a 5s timeout; fall back to the cached copy on timeout.
  • 各服务商 Key 获取地址补全 / direct API-key links:DeepSeek、Kimi、小米 MiMo(按套餐区分)、智谱(按中英文区分)的 Key 页面直链都写进了提示。/ Each provider's API-key page is now linked in the prompt.
  • README 示例加 args 说明 / README args tip:示例配置里演示了常用的 "args": "--permission-mode bypassPermissions"(跳过权限确认)。

升级 / Upgrade

cce update 或 / or npm i -g @xiaofuzhou/cce@latest

v2 的交互式表单需要升级 cce 本体才能用上;旧版本仍走冻结的 v1 模板,正常工作。/ The v2 interactive forms require updating cce itself; older versions keep working off the frozen v1 templates.

Full changelog: v0.7.0...v0.8.0

v0.7.0 — template docs links + cce template docs + Xiaomi MiMo

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 12 Jun 16:10

cce v0.7.0 — 模板文档直达 + 小米 MiMo 模板 / template docs links + Xiaomi MiMo templates

每个内置模板现在都带官方文档链接,新命令 cce template docs 一键在浏览器打开,配置对不对、模型名变没变,跳过去一比就知道。同时新增小米 MiMo 两套模板(按量付费 / Token Plan),智谱 GLM 模板按官方文档补齐模型映射。

Every builtin template now carries its official docs URL, and the new cce template docs command opens it in your browser — one jump to verify your config against the provider's own page. Also new: two Xiaomi MiMo templates (pay-as-you-go / Token Plan), and the GLM template gains the official model mappings.

新增 / New

  • cce template docs <名> [--print](别名 doc)/ (alias doc)
    cce template docs deepseek   # 在浏览器打开官方接入文档 / open the official docs in your browser
    cce template docs            # 不带名字:弹出模板选择菜单 / no name: interactive picker
    cce template docs glm -p     # 只打印 URL(SSH/无图形环境)/ just print the URL (headless)
    浏览器打开失败时自动降级为打印链接;仅放行 http(s) 链接。/ Falls back to printing the URL when no browser is available; only http(s) URLs are ever handed to the OS.
  • 模板新增 docs 字段 / docs field on templates:cce template show 会显示文档链接,cce add 创建成功后也会附上,方便对照官方文档确认配置。/ Shown in cce template show and after cce add, so you can verify the config against the provider's docs.
  • 小米 MiMo 模板 / Xiaomi MiMo templates:mimo(按量付费 API / pay-as-you-go)与 mimo-tp(Token Plan 订阅 / subscription),模型预置 mimo-v2.5-pro[1m](1M 上下文 / 1M context)。

变化 / Changes

  • glm 模板对齐官方文档 / GLM template synced with official docs:补上 ANTHROPIC_DEFAULT_OPUS_MODEL=glm-5.1、SONNET=glm-5-turbo、HAIKU=glm-4.5-air。
  • README 重写(中英)/ README rewritten (zh + en):开头一眼看懂定位,「30 秒接入第三方 API」快速上手,与 cc-switch 的逐项对比表。/ Lead with what/why, a "30s third-party API" quickstart, and a point-by-point cc-switch comparison.
  • 四种 shell 的补全、help、中英文界面文案均已更新。/ Completion for all four shells, help, and both UI languages updated.

模板(含文档链接与 MiMo)从 GitHub 实时获取,老版本 cce 也能在缓存刷新后用上新模板;但 cce template docs 命令本身需要升级到 v0.7.0。/ Templates (docs links + MiMo) are fetched live from GitHub, so older cce versions pick them up after a cache refresh — but the cce template docs command itself requires v0.7.0.

升级 / Upgrade

cce update 或 / or npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.6.1...v0.7.0

v0.6.1 — fix UTF-8 BOM in settings.json parsing

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 31 May 14:12

cce v0.6.1 — 修复带 BOM 的 settings.json 解析 / fix BOM-prefixed settings.json parsing

带 UTF-8 BOM 的 ~/.claude/settings.json 会被 cce 误判为无法解析、当成空配置处理(Unexpected token '')。Windows 上不少编辑器写文件会自动加 BOM。Claude 本体会先剥掉 BOM 再解析,cce 现在行为对齐。

A ~/.claude/settings.json carrying a UTF-8 BOM was wrongly reported as unparseable and treated as empty (Unexpected token ''). Many editors on Windows add a BOM when saving. Claude itself strips the BOM before parsing — cce now matches that behavior.

修复 / Fixes

  • BOM 容错 / BOM tolerance:新增 parseJson(),解析前剥掉开头的 U+FEFF。用户可编辑文件的读取(settings.json 的 env 读取、cce 主配置加载与语言探测)统一走它。非法 JSON 仍照常报错。/ New parseJson() strips a leading U+FEFF before parsing; all user-editable file reads (settings.json env, cce config load + language peek) route through it. Genuinely invalid JSON still errors as before.

升级 / Upgrade

cce update 或 / or npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.6.0...v0.6.1

v0.6.0 — remote templates + cce template subcommand

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 29 May 05:42

cce v0.6.0 — 远端模板 + cce template / remote templates + cce template

模板不再随 npm 包发布,而是从 GitHub 实时获取并本地缓存——你总能拿到最新的,改模板也不用发版。新增 cce template 子命令集中管理来源、缓存与离线。

Templates are no longer bundled in the npm package — they're fetched live from GitHub (jsDelivr, with a GitHub raw fallback) and cached locally, so you always get the latest without a release. A new cce template subcommand manages the source, cache, and offline mode.

新增 / New

  • cce template(别名 tpl)/ (alias tpl)
    cce template            # 状态总览 / status: url, offline, cache count + age
    cce template ls         # 列出模板(= 旧的 cce add --list)/ list templates
    cce template show <名>  # 看某模板的 env + 待填项 / show a template's env + fields
    cce template refresh    # 立刻重新下载(忽略 TTL/离线)/ re-download now
    cce template url <url>  # 设内网镜像(设了就不走默认源)/ set a mirror URL
    cce template url --none # 清除,回到默认源 / clear, back to defaults
    cce template offline on # 离线:永不联网、只用缓存 / offline: cache only, no network

变化 / Changes

  • cce add --templates <path> → cce add --from <path|url>:一次性指定模板来源,自动判断本地路径还是 URL。cce add --list 移除,改用 cce template ls。/ --templates renamed to --from (path or URL, auto-detected); --list removed in favor of cce template ls.
  • 默认模板从远端获取 + 24h 缓存:首次 cce add 下载到 ~/.claude/cce/templates.remote.json,24 小时内复用。下载失败会打印链接和应保存的路径,方便在有网设备上手动下载。/ Default templates fetched remotely with a 24h cache; on failure cce prints the URL + the path to drop a manual download.
  • 内网 / 离线支持:cce template url <镜像> 指向内网镜像,或 cce template offline on + 手放缓存文件。/ Intranet via a mirror URL, or offline mode + a hand-placed cache file.
  • 统一缓存文件 cache.json:所有机器态(更新检查 + 模板元数据)合并到一个文件;旧的 update-check.json 弃用。/ All machine state unified into cache.json; old update-check.json deprecated.

升级 / Upgrade

cce update 或 / or npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.5.0...v0.6.0

v0.5.0 — cce remove (alias rm) + auto-update fixes

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 28 May 05:54

cce v0.5.0 — cce remove: 安全删除 env / safely remove envs

新增 cce remove(别名 rm)子命令,配合二次确认避免误删;另含 auto-update 在 Windows 上的多个修复。

A new cce remove subcommand (alias rm) with confirmation prompts; plus several auto-update fixes for Windows.

用法 / Usage

cce remove kimi             # 删指定 env,二次确认 / direct delete with confirm
cce remove                  # TTY 下弹出选择菜单 / interactive picker (TTY)
cce remove kimi -y          # 跳过确认(脚本场景) / skip confirm (scripting)
cce rm kimi                 # 等价别名 / alias

行为细节 / Behavior details

  • 默认会问 Remove env "kimi"? [y/N](默认 No)/ always prompts before deleting (default No).
  • 删的是当前默认 env 时,同步把 default 清空 / clears default if the removed env was the default.
  • 选择器模式选完仍要二次确认(防 Enter 误触)/ picker path still requires explicit confirm.
  • 非交互(管道 / CI / 脚本)下必须显式 -y,否则直接报错 / non-TTY requires -y or errors out.
  • Tab 补全已为 bash / zsh / fish / powershell 四端补上 / shell completions updated.

其它修复 / Other fixes

  • Auto-update 在 Windows 不再弹 cmd 窗口 —— 后台 npm install 加了 windowsHide / no more cmd flashes during silent auto-update.
  • Auto-update 失败可重试 —— 后台安装 1 小时内没装上目标版本,下次启动自动重试(之前会被永久标记为已尝试而不再重试)/ failed background installs now retry after 1h (previously they were stuck pending forever until a newer release).
  • cce add 覆盖同名 env 时保留用户字段 —— 只替换模板拥有的 description + env,手工添加的 args / argsOverride / settingsMode 不再被擦掉 / overwrite preserves user-added fields.
  • 内部清理:移除未使用的 setEnv / removeEnv helper / dropped dead helpers in config.js.
  • 同步 package-lock.json 到当前版本(自 0.2.0 起一直漂着)/ resynced package-lock.json (drifted since 0.2.0).

升级 / Upgrade: cce update 或 / or npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.4.0...v0.5.0

v0.4.0 — cce add: create env from templates

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 27 May 16:31

cce v0.4.0 — cce add: 从模板创建 env / create an env from a template

新增 cce add 子命令:照一份模板快速生成一套 env —— 固定项(接口地址、模型等)已填好,你只需补上自己的几项(通常是 API Key),即可写入 config.json。

A new cce add subcommand scaffolds an env from a template: the fixed parts (base URL, model, …) are pre-filled, you supply only your own fields (usually an API key), and it writes the env into config.json.

用法 / Usage

cce add                          # 选模板 → 填字段 → 起名 → 写入 / pick → fill → name → write
cce add deepseek                 # 直接用某模板 / use a template by name
cce add deepseek ds              # 预设 env 名 / preset the env name
cce add --list                   # 只列出可用模板 / just list available templates
cce add --templates ./team.json  # 本次挂载外部模板文件 / mount an external file for this run

内容 / What's in it

  • 内置模板 / Built-in templates: DeepSeek、Kimi K2.5、GLM,开箱即用 / usable out of the box.
  • 模板解析链 / Resolution chain: 内置 → ~/.claude/cce/templates.json → --templates <path>,后者按模板名覆盖前者 / later overrides earlier by name.
  • 多语言描述 / Multilingual descriptions: 模板的 description 与待填项说明可写成 { "en": …, "zh-CN": … },按当前界面语言显示(回退 en → 第一个非空值)/ shown in the current UI language with fallbacks.
  • 安全 / Safety: env 名按 schema 规则校验;重名时二选一「覆盖 / 重命名」;交互需 TTY,非交互场景给全参数即可 / schema-validated names, overwrite-or-rename on collision, TTY-gated with a non-interactive path.

文档(README / 使用指南 / 设计文档,中英双语)已同步。/ Docs (README / usage / design, both languages) updated.

升级 / Upgrade: cce update 或 / or npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.3.0...v0.4.0

v0.3.0 — 自我更新 / Self-update

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 26 May 16:12

✨ 新功能:cce 自我更新

cce 现在可以把自己升级到 npm 最新版,分手动和启动时自动两种。

手动更新

  • cce update — 检查并安装最新版
  • cce update --check — 只检查、不安装

启动时自动检查(配置项 updateMode,默认 auto)

模式 行为
auto(默认) 发现新版后后台静默更新,下次启动提示一句「已在后台更新到 vX.Y.Z」
prompt 下次在终端启动时弹「立即更新 / 跳过此版本」菜单;跳过的版本不再提示
off 启动时完全不检查(仍可手动 cce update)

细节:

  • 启动时的检查走后台,不拖慢启动;结果缓存约 3 小时
  • 「立即更新 / 跳过」菜单**仅在交互式终端(TTY)**出现;脚本、管道、CI 里不打扰
  • 单次关闭:环境变量 CCE_NO_UPDATE_CHECK=1
  • 从源码(git clone)运行时,cce update 会提示用 git pull,不会乱装

📖 文档

  • 中文文档新增术语速查表,把 provider(服务商)、env(启动配置)等概念讲清楚,并修正了「env ≠ 服务商」(同一服务商可建多套 env)
  • schema.json 新增 updateMode,编辑器可补全/校验

✨ New: cce self-update

cce can now upgrade itself to the latest npm version — manually or automatically at launch.

Manual

  • cce update — check and install the latest version
  • cce update --check — check only, don't install

Automatic at launch (updateMode config, default auto)

Mode Behavior
auto (default) Silently update in the background; the next launch prints "cce was updated to vX.Y.Z"
prompt Show an Update now / Skip this version menu on the next interactive launch
off Never check at launch (manual cce update still works)

Notes: the launch check runs in the background (never slows startup, cached ~3h), the menu only appears in a TTY, CCE_NO_UPDATE_CHECK=1 disables it for one run, and source checkouts are told to use git pull.


⬆️ 升级 / Upgrade

npm i -g @xiaofuzhou/cce@latest   # 或老用户直接 / or simply:  cce update

Full changelog: v0.2.0...v0.3.0

v0.2.0 — settings.json 合并 + 多语言 / settings.json reconciliation + i18n

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 26 May 16:12

✨ settings.json env 合并(解决「切了 env 仍命中旧端点」)

Claude Code 自己也会读 ~/.claude/settings.json 的 env,里面残留的 ANTHROPIC_BASE_URL 等可能反向盖掉 cce 注入的值,导致切换静默失效。本版彻底解决:

  • cce 从不改写你真实的 settings.json;它读取后按模式重组,写一份临时文件,用 claude --settings <tmpfile> 启动,claude 退出即删。
  • 三种合并模式,可全局设、按 env 设、或按次用 -m 设:
模式 效果
override(默认) 完全以本 env 为准;settings.json 里残留的 anthropic 键被屏蔽
merge-cce 与 settings.json 取并集,冲突时本 env 优先
merge-claude 与 settings.json 取并集,冲突时 settings.json 优先
  • 新增 -m / --merge-mode <override|cce|claude> 启动选项,配置项 settingsMode(全局)与 envs.<name>.settingsMode(按 env)。
  • env 泄漏防护:启动前从子进程环境剥离残留的 ANTHROPIC_* 变量,shell 里的 export 不会再静默覆盖。
  • 临时文件带 pid+随机名(并发窗口互不干扰)、chmod 600、全退出路径清理、启动时清扫 6h 以上的孤儿文件。

🌐 多语言界面(中文 / English)

  • cce 的帮助、警告、错误、菜单提示支持英文和简体中文。
  • 检测优先级:CCE_LANG 环境变量 > 配置 lang > 系统 locale > 英文。
  • 新增 cce lang [en|zh-CN|auto] 子命令持久切换;CCE_LANG=zh-CN cce 按次切换。

📖 文档与其它

  • README 拆分中英双语;新增 docs/usage.md、docs/DESIGN.md 双语完整文档。
  • schema.json 增加 settingsMode,编辑器可补全/校验。
  • 新增 settings / i18n / parser 单元测试。

✨ settings.json env reconciliation

Fixes the "switched env but still hitting the old endpoint" trap. Claude Code also reads env from ~/.claude/settings.json, where a stale ANTHROPIC_BASE_URL could silently override cce's injection.

  • cce never edits your real settings.json; it builds a temp file and launches with claude --settings <tmpfile> (deleted on exit).
  • Three modes, settable globally, per-env, or per-run via -m:
Mode Effect
override (default) This env fully wins; stale anthropic keys in settings.json are neutralized
merge-cce Union with settings.json, this env wins on conflicts
merge-claude Union with settings.json, settings.json wins on conflicts
  • New -m / --merge-mode flag; settingsMode (global) and envs.<name>.settingsMode (per-env) config.
  • Env-leak protection: stale ANTHROPIC_* vars are stripped from the child env so shell exports can't shadow your env.
  • Temp files use a pid+random name, chmod 600, cleanup on every exit path, and orphan sweeping (>6h).

🌐 Bilingual UI (English / 简体中文)

  • Help, warnings, errors, and prompts in English and Simplified Chinese.
  • Resolution: CCE_LANG env > config lang > OS locale > English.
  • New cce lang [en|zh-CN|auto] to persist; CCE_LANG=zh-CN cce for a single run.

📖 Docs & misc

  • README split into zh/en; full bilingual docs/usage.md and docs/DESIGN.md.
  • schema.json gains settingsMode for editor validation.
  • Added settings / i18n / parser unit tests.

⬆️ 升级 / Upgrade

npm i -g @xiaofuzhou/cce@latest

Full changelog: v0.1.0...v0.2.0

v0.1.0 — Initial release

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 24 May 16:18

What is cce?

cce is a per-process environment launcher for Claude Code. One command to inject any
provider's env (DeepSeek / Kimi / GLM / CCR / official Anthropic) and start claude,
with default CLI args managed in config.

npm install -g @xiaofuzhou/cce
cce -e deepseek
cce pick

Features

- Per-process env injection — env vars are injected only into the claude child
process, so every terminal window can use a different provider in parallel
- Three-layer args merging — global defaults → per-env args → CLI -a/-A,
with pure concatenation semantics
- Interactive picker — cce pick opens a keyboard-navigable menu; bare cce
also falls back to the picker when no default is set
- Shell completion — bash, zsh, fish, and PowerShell tab-completion for
subcommands, flags, and your own env names
- Env-leak protection — ANTHROPIC_* vars are stripped from the inherited
environment before injection, preventing shell-level leaks from silently
taking effect
- API key masking — token/key values are masked in all terminal output
- Atomic config writes — config saved via tmp-file + rename; corrupted configs
are backed up before erroring
- Cross-platform — Windows (PS 7+, cmd), macOS, Linux

Included in this release

- cce CLI with subcommands: list, show, edit, use, current, pick,
completion, help
- Configuration: ~/.claude/cce/config.json
- Zero runtime dependencies beyond cross-spawn and picocolors

Links

- npm: https://www.npmjs.com/package/@xiaofuzhou/cce
- README: https://github.com/zhouxiaofu/claude-code-env/blob/v0.1.0/README.md