Configuration Reference

Complete reference for all Automergent configuration options, environment variables, and CLI flags.

Config File Locations

Automergent uses a layered configuration system. Settings are loaded in order, with later sources overriding earlier ones:

Configuration Layer Priority

  1. Hard-coded defaults — built into the binary
  2. Global config — ~/.automergent/config.yaml
  3. Project config — .automergent/config.yaml (overrides global)
  4. Environment variables — take precedence over file-based config
  5. CLI flags — highest precedence, override everything
Layer Path Description
Global ~/.automergent/config.yaml User-wide settings applied to all projects. Created on first run.
Project .automergent/config.yaml Project-specific overrides. Committed to version control for team-wide settings.
Environment Shell environment AUTOMERGENT_* prefixed variables override file-based config. API keys are always env-first.
CLI Flags Command line One-shot overrides. Not persisted. Highest priority.
Note: The config file supports both YAML and JSON formats. YAML is the default and recommended format. You can specify an alternate config file with --config <path>.

Full Config Schema

Below is every configuration option organized by section. Each option shows its type, default value, and constraints.

Core

KeyTypeDefaultDescription
provider required string "google" AI provider. One of: google-aistudio, google-vertex, custom, or legacy aliases google, openai, anthropic, deepseek, ollama.
model required string "gemini-3.6-flash" Model identifier. Must be non-empty.
mode required string "edit" Operating mode. One of: edit, code, chat, agent.
theme string "modern" UI theme. One of: modern, catppuccin, dracula, nord, gruvbox, onedark, monokai, tokyonight, solarized-dark, solarized-light, high-contrast.
keybindings string "default" Keybinding preset. One of: default, vim, emacs.
layout string "default" UI layout mode. One of: default, minimal, full, split.

Session

KeyTypeDefaultDescription
autoSave bool true Automatically save session state at checkpoint intervals.
checkpointInterval int 5 Interval in minutes between auto-checkpoints. Minimum: 1.
sessionDir string ~/.automergent/sessions Directory where session transcripts are stored.
maxSessions int 100 Maximum number of sessions to retain. Oldest are pruned first.
maxSessionAge duration unlimited Maximum age of sessions (e.g., "30d", "72h"). Empty means no age limit.

Context Management

Tip: Automergent's context system manages a 1M-token ceiling. The maxContextTokens setting controls the soft limit per session; auto-compression kicks in when usage exceeds the configured thresholds.
KeyTypeDefaultDescription
maxContextTokens int 128000 Soft context window limit. Hard ceiling is 1,048,576 (1M). Larger values are clamped.
maxToolOutputChars int 32000 Maximum characters retained from tool output before truncation.
warnAtContextFraction float 0.8 Warn when context usage exceeds this fraction (0–1) of maxContextTokens.
autoCompressAt float 0.9 Automatically compress context when usage exceeds this fraction (0–1).
compressionKeepRecent int 10 Number of most recent messages to preserve during auto-compression.

Model

KeyTypeDefaultDescription
fastModel string empty (use main model) Cheaper model for read-only subagents (explore, review). Empty falls back to the primary model.
thinkingBudget int provider default Override Gemini thinking token budget when > 0.
effort string provider default Thinking effort level. One of: minimal, low, medium, high, max.

File Handling

KeyTypeDefaultDescription
maxAutoReadFileSize int 524288 (512 KB) Maximum file size in bytes for automatic reads. Larger files require explicit read.
maxTreeFiles int 1000 Maximum files shown in directory tree output.
maxTreeDepth int 10 Maximum directory depth in tree output.
excludePatterns []string see below Glob patterns to exclude from tree/glob/search operations.
contextFiles []string empty Extra files to inject into context at session start (paths relative to project root).
skillsDir string ~/.automergent/skills Directory containing custom skill definitions.

Default exclude patterns:

# Applied automatically unless overridden
excludePatterns:
  - ".git"
  - "node_modules"
  - ".venv"
  - "__pycache__"
  - "*.pyc"
  - "*.o"
  - "*.a"
  - "vendor"

Display

KeyTypeDefaultDescription
noAnimation bool false Disable TUI animations (useful for CI or slow terminals).
noColor bool false Disable ANSI color output entirely.
noTui bool false Run in non-interactive CLI-only mode. Never persisted to config file.
output string "text" Output format for non-TUI mode.
quiet bool false Suppress non-essential output.
verbose bool false Enable verbose/detailed output.

Edit

KeyTypeDefaultDescription
editReview bool false Route file mutations through pending-review flow. Proposals render in the diff pane and touch disk only on accept.

Security

Warning: Running Automergent as root or without a sandbox increases risk. Always use requireGitForAutoModes: true in production environments.
KeyTypeDefaultDescription
security.sandbox string "auto" Sandbox mode. One of: off, auto, strict.
security.blockedWritePaths []string see below Glob patterns for paths that cannot be written to.
security.allowedWritePaths []string empty Explicit allowlist of writable paths. When non-empty, only these paths may be modified.
security.stripEnvVarPatterns []string see below Environment variable patterns to strip from tool output (prevents secret leakage).
security.requireGitForAutoModes bool true Require a clean git working directory before enabling auto/accept-edits modes.
security.rootRiskAcknowledged bool false Acknowledge risk of running as root. Required to disable sandbox warnings.

Default blocked write paths:

security:
  blockedWritePaths:
    - ".git/**"
    - "~/.ssh/**"
    - "~/.gnupg/**"
    - "~/.aws/**"
    - "~/.kube/**"

Default env var strip patterns:

security:
  stripEnvVarPatterns:
    - "*_SECRET"
    - "*_PASSWORD"
    - "*_TOKEN"
    - "*_KEY"
    - "AWS_*"
    - "GEMINI_*"
    - "HTTP_PROXY"
    - "HTTPS_PROXY"
    - "ALL_PROXY"
    - "NO_PROXY"
    - "http_proxy"
    - "https_proxy"
    - "all_proxy"
    - "no_proxy"

Per-Tool Configuration

Individual tools can be enabled/disabled, given custom timeouts, and configured for confirmation behavior.

KeyTypeDefaultDescription
tools.<name>.enabled bool true Enable or disable the tool entirely.
tools.<name>.confirmationRequired string "always" Confirmation policy. One of: always, write, never.
tools.<name>.timeout duration "30s" Maximum execution time (e.g., "5s", "2m").
tools.<name>.maxOutputBytes int varies by tool Maximum output bytes before truncation.

Built-in tool defaults:

tools:
  shell:
    enabled: true
    confirmationRequired: "always"
    timeout: "30s"
    maxOutputBytes: 1048576  # 1 MB
  filesystem:
    enabled: true
    confirmationRequired: "write"
    maxOutputBytes: 524288   # 512 KB
  git:
    enabled: true
    confirmationRequired: "never"
  web:
    enabled: true
    confirmationRequired: "never"
    timeout: "15s"

LSP Integration

KeyTypeDefaultDescription
lsp.enabled bool true Enable Language Server Protocol integration.
lsp.servers map[string]string empty Map of language → server command (e.g., {"go": "gopls"}").
lsp.startupTimeout duration "10s" Timeout for LSP server initialization.
lsp.requestTimeout duration "5s" Timeout for individual LSP requests.

MCP Servers

Model Context Protocol (MCP) servers extend Automergent with custom tool providers.

KeyTypeDescription
mcp.servers.<name>.type string Server type: "stdio" or "sse".
mcp.servers.<name>.command []string Command + args for stdio servers (e.g., ["npx", "-y", "@modelcontextprotocol/server-filesystem"]).
mcp.servers.<name>.url string URL for SSE servers.
mcp.servers.<name>.env map[string]string Environment variables passed to the server process.
mcp.servers.<name>.auth string Authentication token for SSE servers.
mcp.servers.<name>.timeout duration Connection timeout (e.g., "30s").
mcp:
  servers:
    filesystem:
      type: "stdio"
      command:
        - "npx"
        - "-y"
        - "@modelcontextprotocol/server-filesystem"
        - "/path/to/allowed/dir"
    remote-tools:
      type: "sse"
      url: "https://mcp.example.com/sse"
      auth: "Bearer ${MCP_TOKEN}"
      timeout: "30s"

Logging

KeyTypeDefaultDescription
log.level string "warn" Log verbosity. One of: debug, info, warn, error.
log.file string ~/.automergent/automergent.log Path to the log file.
log.maxSize size "50MB" Maximum log file size before rotation.
log.maxBackups int 3 Maximum number of rotated log files to keep.

Providers

Per-provider configuration. Keys are provider identifiers (e.g., google-aistudio, openai, anthropic).

KeyTypeDescription
providers.<name>.apiKey string API key. Use "${ENV_VAR}" syntax for env var interpolation.
providers.<name>.baseUrl string Custom API endpoint URL.
providers.<name>.modelApiUrl string Endpoint path for fetching model lists (e.g., "/v1/models").
providers.<name>.defaultModel string Default model when none is configured.
providers.<name>.orgId string Organization ID (OpenAI).
providers.<name>.project string GCP project ID (Vertex AI).
providers.<name>.location string GCP region (Vertex AI, e.g., "us-central1").
providers.<name>.apiType string API protocol: "openai", "anthropic", "gemini", "custom".
providers.<name>.backend string Provider backend: "aistudio" or "vertex" (Google only).
providers.<name>.effort string Default effort level for this provider.
providers.<name>.thinkingLevel string Default thinking level for this provider.
providers.<name>.temperature *float Sampling temperature (0.0–2.0). null uses provider default.
providers.<name>.maxTokens int Maximum tokens in completion. 0 = provider default.
providers.<name>.timeoutSeconds int Request timeout in seconds. 0 = provider default.
providers.<name>.maxRetries int Maximum retry attempts on failure.
providers.<name>.headers map[string]string Custom HTTP headers sent with requests.
providers.<name>.models map[string]ModelConfig Per-model overrides (see below).

Model-level config (under providers.<name>.models.<model>):

KeyTypeDescription
apiKey string Model-specific API key override.
baseUrl string Model-specific endpoint override.
displayName string Human-readable name for UI display.
contextLimit int Context window size in tokens.
inputPrice float Price per million input tokens.
outputPrice float Price per million output tokens.

Git

KeyTypeDefaultDescription
git.coAuthor string "ask" Co-author policy: "always", "never", or "ask".
git.coAuthorTrailer string "Co-authored-by: Automergent <automergent-bot@users.noreply.github.com>" Custom co-author trailer line appended to commits.

Diagnostics

KeyTypeDefaultDescription
diagnostics.enabled bool true Enable compiler/diagnostic error detection.
diagnostics.showInRead bool true Display diagnostics inline when reading files.
diagnostics.blockOnError bool true Block agent execution when a diagnostic error is detected.
diagnostics.blockOnWarning bool false Block agent execution when a diagnostic warning is detected.
diagnostics.maxFileSizeBytes int64 1048576 (1 MB) Maximum file size to parse for diagnostics.
diagnostics.cacheDurationSec int 30 Duration in seconds to cache diagnostic results.

Cache

KeyTypeDefaultDescription
cache.prompt.enabled bool true Enable provider prompt caching (saves tokens on repeated prompts).

Privacy

KeyTypeDefaultDescription
zeroDataRetention bool false Request zero data retention from supported providers.
telemetry bool true Enable anonymous usage telemetry.

Debug

KeyTypeDefaultDescription
debug.enabled bool true Enable debug mode for API request/response logging.
debug.directory string ~/.automergent/debug Directory to store debug logs.
debug.saveRequests bool true Save raw API request payloads.
debug.saveResponses bool true Save raw API response payloads.
debug.maxFileSize int 10 Maximum debug log file size in MB. 0 = unlimited.

Provider Fallback

Define fallback providers that are tried when the primary provider fails. Falls back in list order.

KeyTypeDescription
providerFallback []FallbackProvider Ordered list of fallback providers.
providerFallback[].provider string Fallback provider identifier.
providerFallback[].model string Fallback model identifier.
providerFallback:
  - provider: "google-aistudio"
    model: "gemini-3.6-flash"
  - provider: "custom"
    model: "deepseek-chat"

Notifications

KeyTypeDefaultDescription
notifications.desktop bool false Enable desktop notifications for task completion.
notifications.bell bool true Ring terminal bell on notification.
notifications.contextWarning bool true Show warning when context window is nearly full.

Hooks

Lifecycle hooks run shell commands at specific points in the tool execution pipeline. Hooks receive context via environment variables: AUTOMERGENT_TOOL_NAME, AUTOMERGENT_TOOL_ARGS, AUTOMERGENT_TOOL_RESULT, AUTOMERGENT_PROJECT_DIR.

KeyTypeDescription
hooks.preToolUse []Hook Commands executed before tool execution. Non-zero exit vetoes the tool call (stderr becomes the reason).
hooks.postToolUse []Hook Commands executed after tool execution. Failures are logged, never fatal.
hooks.*[].name string Human-readable hook name (for logs).
hooks.*[].command string Shell command to execute.
hooks.*[].timeout duration Hook execution timeout (default: "10s").
hooks:
  preToolUse:
    - name: "lint-check"
      command: "npm run lint --quiet"
      timeout: "30s"
  postToolUse:
    - name: "notify-done"
      command: "echo 'Tool completed' | pbcopy"

Timeouts

KeyTypeDefaultDescription
confirmationTimeout duration "10m" Default timeout for user confirmation dialogs (e.g., tool execution approval).

Environment Variables

Environment variables override file-based configuration. API keys are always resolved from environment variables first.

VariableUsed ForDescription
GOOGLE_API_KEY Google AI Studio API key for Gemini models via AI Studio. Higher priority than GEMINI_API_KEY.
GEMINI_API_KEY Google AI Studio Alias for Google API key. Used as fallback if GOOGLE_API_KEY is not set.
AUTOMERGENT_PROVIDER Core Override the configured provider (google-aistudio, google-vertex, custom).
AUTOMERGENT_MODEL Core Override the configured model (e.g., gemini-3.6-flash).
AUTOMERGENT_MODE Core Override the operating mode (e.g., edit, code, chat, agent).
Note: Provider-specific API keys are always read from environment variables first, even when configured in the YAML file via "${ENV_VAR}" syntax. This ensures secrets are never persisted in config files.

CLI Flags

CLI flags provide one-shot overrides. They have the highest precedence and are never persisted to config files.

FlagArgumentDescription
--provider <name> AI provider to use.
--model <name> Model identifier.
--mode <mode> Operating mode (edit, code, chat, agent).
--prompt <text> Send a single prompt in non-interactive mode.
--output <format> Output format (text, json).
--no-tui flag Run in CLI-only mode without the terminal UI.
--stdin flag Read prompt from stdin.
--theme <name> UI theme to use.
--keybindings <preset> Keybinding preset (default, vim, emacs).
--config <path> Path to config file (overrides default locations).
--no-color flag Disable ANSI color output.
--session <id> Session ID to resume.
--resume flag Resume the most recent session.
--new flag Force a new session (don't resume).
--session-dir <path> Custom session storage directory.
--context-files <paths> Extra files to inject into context (comma-separated).
--images <paths> Image files to include as context.
--files <paths> Files to read into context at startup.
--no-context flag Disable automatic context gathering.
--no-sandbox flag Disable the sandbox (sets sandbox: off).
--sandbox <mode> Sandbox mode (off, auto, strict).
--quiet flag Suppress non-essential output.
--verbose flag Enable verbose output.
--no-animation flag Disable TUI animations.
--layout <mode> UI layout (default, minimal, full, split).
--base-url <url> Custom API endpoint URL for the active provider.
--api-key <key> API key for the active provider.

Example Configurations

Minimal Config

The simplest config — just set your provider and API key:

config.yaml
# Minimal configuration — everything else uses defaults
provider: "google-aistudio"
model: "gemini-3.6-flash"
mode: "manual"

providers:
  google-aistudio:
    apiKey: "${GEMINI_API_KEY}"

Multi-Provider Setup

Configure multiple providers with automatic fallback:

config.yaml
# Multi-provider setup with fallback chain
provider: "google-aistudio"
model: "gemini-2.5-pro"
mode: "manual"
theme: "catppuccin"

providers:
  google-aistudio:
    apiKey: "${GEMINI_API_KEY}"
    temperature: 0.2
    maxRetries: 3

  google-vertex:
    project: "my-gcp-project"
    location: "us-central1"
    temperature: 0.2

  custom:
    apiKey: "${PROVIDER_API_KEY}"
    baseUrl: "https://api.openai.com/v1"
    defaultModel: "gpt-4o"
    temperature: 0.3

fastModel: "gemini-3.6-flash"
effort: "medium"

providerFallback:
  - provider: "google-aistudio"
    model: "gemini-3.6-flash"
  - provider: "google-vertex"
    model: "gemini-3.6-flash"

Enterprise Config with Security

Harden Automergent for production/enterprise environments:

config.yaml
# Enterprise configuration with strict security
provider: "google-vertex"
model: "gemini-2.5-pro"
mode: "manual"
theme: "modern"

providers:
  google-vertex:
    project: "enterprise-ai-project"
    location: "us-central1"
    backend: "vertex"
    maxRetries: 5
    timeoutSeconds: 120
    temperature: 0.1
    headers:
      X-Request-Source: "automergent-enterprise"

# Security hardening
security:
  sandbox: "strict"
  requireGitForAutoModes: true
  blockedWritePaths:
    - ".git/**"
    - "~/.ssh/**"
    - "~/.gnupg/**"
    - "~/.aws/**"
    - "~/.kube/**"
    - "/etc/**"
    - "/var/**"
    - "/usr/**"
  allowedWritePaths:
    - "src/**"
    - "tests/**"
    - "docs/**"
  stripEnvVarPatterns:
    - "*_SECRET"
    - "*_PASSWORD"
    - "*_TOKEN"
    - "*_KEY"
    - "AWS_*"
    - "GCP_*"

# Tool configuration
tools:
  shell:
    enabled: true
    confirmationRequired: "always"
    timeout: "60s"
  filesystem:
    enabled: true
    confirmationRequired: "write"

# Review all edits before applying
editReview: true

# Diagnostics
diagnostics:
  enabled: true
  showInRead: true
  blockOnError: true
  blockOnWarning: true

# Privacy
zeroDataRetention: true
telemetry: false

# Git co-authoring
git:
  coAuthor: "always"
  coAuthorTrailer: "Co-authored-by: AI Assistant <ai@company.com>"

# Hooks for CI integration
hooks:
  postToolUse:
    - name: "lint"
      command: "make lint"
      timeout: "60s"

Performance Tuning

Optimize for large codebases and fast iteration:

config.yaml
# Performance-tuned configuration
provider: "google-aistudio"
model: "gemini-2.5-pro"
mode: "code"

# Maximize context for large codebases
maxContextTokens: 1000000
maxToolOutputChars: 64000
warnAtContextFraction: 0.85
autoCompressAt: 0.95
compressionKeepRecent: 20

# File handling for large repos
maxAutoReadFileSize: 1048576  # 1 MB
maxTreeFiles: 5000
maxTreeDepth: 15
excludePatterns:
  - ".git"
  - "node_modules"
  - "dist"
  - "build"
  - ".next"
  - "target"
  - "vendor"
  - "*.min.js"
  - "*.min.css"
  - "*.bundle.js"

# Provider tuning
providers:
  google-aistudio:
    apiKey: "${GEMINI_API_KEY}"
    temperature: 0.3
    maxTokens: 8192
    maxRetries: 3
    timeoutSeconds: 60

fastModel: "gemini-3.6-flash"
effort: "low"
thinkingBudget: 4096

# Disable features you don't need
notifications:
  desktop: false
  bell: false
  contextWarning: true

# Keep sessions lightweight
autoSave: true
checkpointInterval: 3
maxSessions: 50
maxSessionAge: "14d"

# Prompt caching for repeated operations
cache:
  prompt:
    enabled: true

Full Example Config

A comprehensive config showing all available options with their defaults:

config.yaml — Complete Reference
# ─── Core ───────────────────────────────────────────────────────
provider: "google-aistudio"
model: "gemini-3.6-flash"
mode: "manual"
theme: "modern"
keybindings: "default"
layout: "default"

# ─── Session ────────────────────────────────────────────────────
autoSave: true
checkpointInterval: 5
sessionDir: "~/.automergent/sessions"
maxSessions: 100
maxSessionAge: ""  # no age limit

# ─── Context ────────────────────────────────────────────────────
maxContextTokens: 128000
maxToolOutputChars: 32000
warnAtContextFraction: 0.8
autoCompressAt: 0.9
compressionKeepRecent: 10

# ─── Model ──────────────────────────────────────────────────────
fastModel: ""  # empty = use main model
thinkingBudget: 0  # 0 = provider default
effort: ""  # minimal|low|medium|high|max

# ─── File Handling ──────────────────────────────────────────────
maxAutoReadFileSize: 524288  # 512 KB
maxTreeFiles: 1000
maxTreeDepth: 10
excludePatterns:
  - ".git"
  - "node_modules"
  - ".venv"
  - "__pycache__"
  - "*.pyc"
  - "*.o"
  - "*.a"
  - "vendor"
contextFiles: []
skillsDir: "~/.automergent/skills"

# ─── Display ────────────────────────────────────────────────────
noAnimation: false
noColor: false
output: "text"
quiet: false
verbose: false

# ─── Edit ───────────────────────────────────────────────────────
editReview: false

# ─── Security ───────────────────────────────────────────────────
security:
  sandbox: "auto"
  requireGitForAutoModes: true
  rootRiskAcknowledged: false
  blockedWritePaths:
    - ".git/**"
    - "~/.ssh/**"
    - "~/.gnupg/**"
    - "~/.aws/**"
    - "~/.kube/**"
  allowedWritePaths: []
  stripEnvVarPatterns:
    - "*_SECRET"
    - "*_PASSWORD"
    - "*_TOKEN"
    - "*_KEY"

# ─── Tools ──────────────────────────────────────────────────────
tools:
  shell:
    enabled: true
    confirmationRequired: "always"
    timeout: "30s"
    maxOutputBytes: 1048576
  filesystem:
    enabled: true
    confirmationRequired: "write"
    maxOutputBytes: 524288
  git:
    enabled: true
    confirmationRequired: "never"
  web:
    enabled: true
    confirmationRequired: "never"
    timeout: "15s"

# ─── LSP ────────────────────────────────────────────────────────
lsp:
  enabled: true
  servers: {}
  startupTimeout: "10s"
  requestTimeout: "5s"

# ─── MCP ────────────────────────────────────────────────────────
mcp:
  servers: {}

# ─── Logging ────────────────────────────────────────────────────
log:
  level: "warn"
  file: "~/.automergent/automergent.log"
  maxSize: "50MB"
  maxBackups: 3

# ─── Providers ──────────────────────────────────────────────────
providers:
  google-aistudio:
    apiKey: "${GEMINI_API_KEY}"

# ─── Git ────────────────────────────────────────────────────────
git:
  coAuthor: "ask"
  coAuthorTrailer: "Co-authored-by: Automergent <automergent-bot@users.noreply.github.com>"

# ─── Diagnostics ────────────────────────────────────────────────
diagnostics:
  enabled: true
  showInRead: true
  blockOnError: true
  blockOnWarning: false
  maxFileSizeBytes: 1048576
  cacheDurationSec: 30

# ─── Cache ──────────────────────────────────────────────────────
cache:
  prompt:
    enabled: true

# ─── Privacy ────────────────────────────────────────────────────
zeroDataRetention: false
telemetry: true
noUpdateCheck: false

# ─── Debug ──────────────────────────────────────────────────────
debug:
  enabled: true
  directory: "~/.automergent/debug"
  saveRequests: true
  saveResponses: true
  maxFileSize: 10

# ─── Provider Fallback ──────────────────────────────────────────
providerFallback: []

# ─── Notifications ──────────────────────────────────────────────
notifications:
  desktop: false
  bell: true
  contextWarning: true

# ─── Hooks ──────────────────────────────────────────────────────
hooks:
  preToolUse: []
  postToolUse: []

# ─── Timeouts ───────────────────────────────────────────────────
confirmationTimeout: "10m"

Automergent Configuration Reference — GitHub — Docs