Skip to content

config.yaml Schema

The .ai/config.yaml file is the main configuration for dotai. It defines MCP servers, hooks, permissions, settings, and ignore patterns.

# MCP tool servers (keyed by name)
mcpServers:
my-server:
transport: stdio | http | sse
command: string # For stdio transport
url: string # For http/sse transport
args: string[] # Command arguments
env: # Environment variables
KEY: value
enabledTools: string[] # Tool whitelist (mutually exclusive with disabledTools)
disabledTools: string[] # Tool blacklist
headers: # Custom HTTP headers (http/sse only)
Header-Name: value
oauth: # OAuth config (http/sse only)
clientId: string
callbackPort: number
scope: enterprise | project | user | local
# Lifecycle hooks
hooks:
- event: preToolUse | postToolUse | preFileEdit | postFileEdit | sessionStart | sessionEnd | userPromptSubmitted | agentStop | subagentStop | errorOccurred | permissionRequest | postToolUseFailure | notification | subagentStart | teammateIdle | taskCompleted | configChange | worktreeCreate | worktreeRemove | preCompact
matcher: string # Tool name or file glob (optional)
handler: string # Shell command or prompt text
scope: enterprise | project | user | local
type: command | prompt | agent # Handler type (default: command)
timeout: number # Timeout in milliseconds
statusMessage: string # Status message shown during execution
once: boolean # Fire only once per session
async: boolean # Run asynchronously (command type only)
model: string # Model override (prompt/agent type only)
cwd: string # Working directory for hook execution
env: # Environment variables for hook execution
KEY: value
# Access control
permissions:
- tool: string # Tool name (Bash, Read, Write, Edit, etc.)
pattern: string # Glob/prefix for argument matching (optional)
decision: allow | deny | ask
scope: enterprise | project | user | local
# Key-value settings
settings:
model: sonnet
temperature: 0.7
# File exclusions
ignore:
- node_modules/**
- dist/**
- .env

See Tool Servers for the full reference.

MCP servers are defined as a map keyed by server name:

mcpServers:
my-server:
transport: stdio
command: npx
args: ["-y", "my-server"]
remote-search:
transport: http
url: https://search.example.com/mcp

Server transport types:

TransportRequired fieldsDescription
stdiocommandSpawns a subprocess, communicates over stdin/stdout
httpurlStateless HTTP requests (Streamable HTTP)
sseurlServer-sent events for streaming (deprecated — use http)

Additional server fields:

FieldTypeApplies toDescription
enabledToolsstring[]AllTool whitelist (mutually exclusive with disabledTools)
disabledToolsstring[]AllTool blacklist
headersRecordhttp, sseCustom HTTP headers
oauth.clientIdstringhttp, sseOAuth client ID
oauth.callbackPortnumberhttp, sseOAuth callback port

See Hooks for the full reference.

20 lifecycle events are available:

CategoryEvents
Tool eventspreToolUse, postToolUse, postToolUseFailure
File eventspreFileEdit, postFileEdit
Session eventssessionStart, sessionEnd
Agent eventsagentStop, subagentStop, subagentStart
User eventsuserPromptSubmitted, permissionRequest
System eventsnotification, taskCompleted, configChange, preCompact
Team eventsteammateIdle
Worktree eventsworktreeCreate, worktreeRemove
Error eventserrorOccurred

Hook-specific fields:

FieldTypeDefaultDescription
typecommand | prompt | agentcommandHandler execution type
timeoutnumberTimeout in milliseconds
statusMessagestringStatus message shown during execution
oncebooleanfalseFire only once per session
asyncbooleanfalseRun asynchronously without blocking (command type only)
modelstringModel override for prompt/agent types
cwdstringWorking directory for hook execution
envRecordEnvironment variables for hook execution
EntityAllowed scopes
Serverenterprise, project, user, local
Hookenterprise, project, user, local
Permissionenterprise, project, user, local
Settingenterprise, project, user, local
Ignoreproject, user

Precedence: enterprise > project > user > local. Higher scope wins on conflict.

Agents are defined in .ai/agents/*.md files, not in config.yaml. See Agents for the full reference including all 14+ frontmatter fields.

Skills are defined in .ai/skills/<name>/SKILL.md files, not in config.yaml. See Skills for the full reference including all 11 frontmatter fields.

Rules are defined in .ai/rules/*.md files, not in config.yaml. See Rules for the full reference including outputDir and override fields.

Create .ai/config.local.yaml for machine-specific settings. This file should be gitignored and uses the same schema as config.yaml.