Skip to content

Configuration

Config file paths

Configuration is stored under the shared root directory (determined by AI_ZEN_DIR):

  • Global config: $AI_ZEN_DIR/config.json (default ~/.ai-zen/config.json when AI_ZEN_DIR is not set).

⚠️ The README claims configuration is at ~/.ai-zen/cli/config.json, but in the source, CONFIG_FILE = join(AI_ZEN_DIR, "config.json") in src/config.ts, i.e. configuration is at ~/.ai-zen/config.json, shared with the CLI/Desktop. The source is authoritative. The ~/.ai-zen/cli/ directory holds CLI runtime data such as conversations/ and drafts/.

Key paths defined in src/config.ts:

ConstantPathDescription
AI_ZEN_DIR~/.ai-zen (or $AI_ZEN_DIR)Shared root directory
CLI_DIR$AI_ZEN_DIR/cliCLI runtime directory
CONFIG_FILE$AI_ZEN_DIR/config.jsonGlobal config (shared by CLI/Desktop)
CONVERSATIONS_DIR$AI_ZEN_DIR/cli/conversationsConversation records
DRAFTS_DIR$AI_ZEN_DIR/cli/draftsDrafts
AGENTS_DIR$AI_ZEN_DIR/agentsAgent definitions (shared)
SUB_AGENTS_DIR$AI_ZEN_DIR/sub-agentsSubAgent definitions (shared)
SKILLS_DIR$AI_ZEN_DIR/skillsSkill directory (shared)
TOOLS_DIR$AI_ZEN_DIR/toolsUser tools (shared)
MCP_CONFIG_FILE$AI_ZEN_DIR/mcp.jsonMCP config (shared)

Environment variables

  • AI_ZEN_DIR: overrides the shared root directory (default ~/.ai-zen). CLI runtime data is written to $AI_ZEN_DIR/cli/, and shared resources (agents, skills, tools, MCP, etc.) are written to $AI_ZEN_DIR/.

config.json structure

jsonc
{
  "endpoints": [
    {
      "id": "openai",
      "name": "OpenAI",
      "apiKey": "sk-xxx",
      "baseUrl": "https://api.openai.com/v1"
    }
  ],
  "models": [
    {
      "id": "gpt-5.5",
      "name": "GPT-5.5",
      "endpointId": "openai",
      "modelName": "gpt-5.5",
      "maxContextTokens": 250000
    }
  ],
  "imageModels": [
    {
      "id": "cogview-3",
      "name": "CogView-3",
      "endpointId": "bigmodelcn",
      "modelName": "cogview-3",
      "defaultSize": "1024x1024"
    }
  ],
  "defaultModel": "deepseek-v4-flash",
  "defaultImageModel": "cogview-3",
  "defaultAgent": "default",
  "defaultMigrationModel": "deepseek-v4-flash"
}

Fields (aligned with the SDK's AppConfig type):

  • endpoints: the list of API endpoints (id, name, baseUrl, apiKey, description).
  • models: the list of conversation models. Among these, maxContextTokens sets the migration threshold (the README suggests roughly 25% of the model's actual context window). vision indicates whether image input is supported (which determines whether viewImage is enabled).
  • imageModels: the list of image-generation models (id, name, endpointId, modelName, defaultSize, defaultQuality).
  • defaultModel / defaultImageModel / defaultAgent / defaultMigrationModel: the various defaults.

Filesystem layout

~/.ai-zen/                    ← Shared root (AI_ZEN_DIR)
├── cli/                      ← CLI runtime data
│   ├── conversations/        ← CLI conversations
│   └── drafts/               ← CLI drafts
├── config.json               ← Global config (endpoints, models, etc., shared by CLI/Desktop)
├── agents/                   ← Agent definitions (shared)
│   ├── default.json
│   └── my-custom-agent.json
├── sub-agents/               ← SubAgent definitions (shared)
│   ├── general-assistant.json
│   └── my-coder.json
├── skills/                   ← Skill directory (shared)
│   └── my-skill/SKILL.md
├── tools/                    ← User tools (shared)
│   └── my-tool.js
├── mcp.json                  ← MCP config (shared)
└── mcp-oauth/                ← MCP OAuth tokens (shared, not yet implemented)

/path/to/project/
├── .mcp.json                 ← Project-shared MCP config (committable)
└── .ai-zen/
    ├── mcp.json              ← Project-personal MCP config (not committed)
    ├── skills/               ← Project Skill directory
    ├── tools/                ← Project tool directory
    ├── sub-agents/           ← Project SubAgent directory
    └── agents/               ← Project Agent directory (overrides user-level)

Industry-convention directories: ~/.agents/ and <project>/.agents/ (skills/, mcp.json).

Preset endpoints

IDNameDefault Base URL
openaiOpenAIhttps://api.openai.com/v1
bigmodelcnBigModelCN (ZhipuAI)https://open.bigmodel.cn/api/paas/v4
deepseekDeepSeekhttps://api.deepseek.com/v1

Preset models

IDNameEndpoint
gpt-5.5GPT-5.5OpenAI
glm-5.2GLM-5.2ZhipuAI
glm-5.1GLM-5.1ZhipuAI
glm-5GLM-5ZhipuAI
glm-5-turboGLM-5-TurboZhipuAI
glm-5v-turboGLM-5V-TurboZhipuAI
glm-4.7-flashGLM-4.7-FlashZhipuAI
deepseek-v4-proDeepSeek-V4-ProDeepSeek
deepseek-v4-flashDeepSeek-V4-FlashDeepSeek (default)

The preset endpoints/models come from src/config-wizard.ts and SDK constants. Note: package.json/README do not explicitly list these preset values; the actual data follows the SDK (@ai-zen/agents-sdk) constants — to confirm precisely, consult the SDK's config/constants.

Interactive configuration management

At the main menu, choose Configuration to:

  • View the current configuration overview (endpoints, default model, default image model, default Agent, MCP servers, config file path).
  • Set the default conversation model / default image-generation model.
  • Set the API Key (interactive password input).
  • Edit API endpoints (name, Base URL, API Key, description).
  • View all API, conversation, and image-generation models.
  • Manage MCP servers (add/edit/delete).

Note: the CLI entry (src/index.ts) only implements the hook subcommand; there is no config subcommand. A hint text in the source refers to aiz config set-key, which is currently not implemented — use the interactive main menu for configuration. When you first encounter an endpoint without an API Key set, an interactive input wizard will appear.

MIT / ISC License