Commands
city model
Dedicated management for console-global language models (provider/model)
city model
Dedicated model management command group for language models only.
Design Rules
- Bare
city modelopens an interactive manager in a TTY. createremains a direct shortcut into the create flow.- Script subcommands (
list/pause/update/test/...) remain available for automation. - Provider
apiKeyis stored in~/.downcity/downcity.dband encrypted on write. - Kimi now has two explicit provider types:
moonshot-cnandmoonshot-ai. - Kimi Code can use a dedicated provider type:
kimi-code.
Usage
# Interactive manager
city model
# Interactive create (choose provider or model)
city model create
# List
city model list
# Read details
city model get provider <providerId>
city model get model <modelId>
# Pause model (enabled defaults to true)
city model pause <modelId>
city model pause <modelId> --enabled false
# Discover provider models (optionally auto-add)
city model discover <providerId>
city model discover <providerId> --auto-add true --prefix openai_
# Update provider
city model update provider <providerId> --api-key '${OPENAI_API_KEY}'
city model update provider kimi_cn --type moonshot-cn
city model update provider kimi_ai --type moonshot-ai
# Update model
city model update model <modelId> --name gpt-4o-mini --provider openai_main
# Remove provider/model
city model remove provider <providerId>
city model remove model <modelId>
# Bind model to project (set downcity.json.execution.modelId)
city model use <modelId> --path /path/to/agent
# Test provider
city model test provider <providerId>
# Test model (real call)
city model test model <modelId>Interactive Manager
city modelis the human-first entrypoint for the global model pool.- It lets you browse providers and models, test connectivity, pause/resume models, bind a model to a project, and jump into the create flow.
- In non-interactive environments,
city modelfalls back to normal help output.
create Behavior
createis the direct shortcut for creating either aprovideror amodel.- After provider creation, you can immediately run connectivity test.
- For providers with model discovery support, remote model list can be fetched and auto-added in batch.
Automation Commands
get: read a single provider/model detail.discover: fetch provider model list and optionally--auto-addto local pool.remove: remove provider/model (provider removal fails if referenced).use: bind projectdowncity.json.execution.modelIdto a model ID and switch execution mode toapi.
pause Behavior
pausemarks a model as paused.- Paused models cannot be loaded as runtime
execution.modelId. - Useful for incident isolation, cost control, or maintenance windows.
test Behavior
test provider: checks provider connectivity and tries model discovery.test model: performs a real model invocation using current config.
Related Commands
Example Output (Based on Current Implementation)
The examples below are aligned with current command implementations in packages/downcity/src (including default output mode and field structure). Placeholder values are used for environment-specific fields.
$ city model list
{
"success": true,
"providers": [
{
"id": "<providerId>",
"type": "openai",
"apiKey": "***masked***",
"apiKeyMasked": "sk-xx***xxxx"
}
],
"models": [
{
"id": "<modelId>",
"providerId": "<providerId>",
"name": "<upstreamModelName>",
"isPaused": false
}
],
"providerIds": ["<providerId>"],
"modelIds": ["<modelId>"]
}$ city model pause <modelId>
{
"success": true,
"modelId": "<modelId>",
"isPaused": true
}