Skip to content

v0.8.0 — parameterized templates (plans & models)

Choose a tag to compare

@zhouxiaofu zhouxiaofu released this 24 Jun 14:21
· 7 commits to main since this release

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