Town CLI

town config

管理项目 downcity.json 与 alias

town config

管理项目 downcity.json 与 alias。

命令名说明:配置命令是 town config,不是 town console config

用法

town config <subcommand>

子命令

  • get [keyPath]
  • set <keyPath> <value>
  • unset <keyPath>
  • alias

模型资源由 city 管理。Town 托管 Agent 时只读取项目里的 execution 绑定。

Plugin 配置

town config 现在只读写项目 downcity.json

插件相关配置请改为:

  • plugins.* 只管理当前 agent 的插件参数
  • 显式 agent 运行态操作请使用具体 plugin 命令

示例:

town config get plugins.asr
town config set plugins.asr.modelId '\"SenseVoiceSmall\"'

示例

town config get execution.modelId
town config set execution.modelId fast
town config unset plugins.chat.channels.telegram
town config alias --dry-run

延伸阅读

示例输出(基于当前实现)

以下示例直接对齐 cli/town/src 当前命令实现(含默认输出模式与字段结构),示例值使用占位符表示。

$ town config get execution.modelId
{
  "success": true,
  "projectRoot": "<projectRoot>",
  "shipJsonPath": "<projectRoot>/downcity.json",
  "keyPath": "execution.modelId",
  "value": "<modelId>"
}
$ town config set execution.modelId gpt-5.4
{
  "success": true,
  "projectRoot": "<projectRoot>",
  "shipJsonPath": "<projectRoot>/downcity.json",
  "keyPath": "execution.modelId",
  "value": "gpt-5.4",
  "existed": true,
  "previous": "<oldModelId>"
}