Configuration Reference

Copair is configured through YAML files at two levels:

  • Global: ~/.copair/config.yaml — applies to all projects
  • Project: .copair/config.yaml — overrides for the current project

Project settings take precedence over global settings. Both files use the same schema.

Complete Example

# ~/.copair/config.yaml
version: 1
default_model: claude-sonnet

providers:
  anthropic:
    api_key: "${ANTHROPIC_API_KEY}"
    models:
      claude-sonnet:
        id: claude-sonnet-4-20250514
      claude-opus:
        id: claude-opus-4-20250514

  openai:
    api_key: "${OPENAI_API_KEY}"
    models:
      gpt-5:
        id: gpt-5

  ollama:
    type: openai-compatible
    base_url: http://localhost:11434/v1
    models:
      llama4:
        id: llama4
        supports_tool_calling: false

identity:
  name: Copair
  email: "copair[bot]@noreply.dugleelabs.io"

permissions:
  mode: ask
  allow_commands:
    - git status
    - git diff
    - npm test

context:
  summarization_model: qwen-7b
  max_sessions: 1

knowledge:
  warn_size_kb: 8
  max_size_kb: 16

ui:
  status_bar: true
  syntax_highlight: true
  bordered_input: true
  output_collapsing: true
  vi_mode: false
  suggestions: true
  tab_completion: true

security:
  path_validation: strict
  redact_high_entropy: false

network:
  web_search_timeout_ms: 15000
  provider_timeout_ms: 120000

mcp_servers: []

Providers

Configure one or more AI providers. Each provider contains a models map where keys are aliases you use to reference models:

providers:
  <name>:
    api_key: "${ENV_VAR}"           # API key (env var reference)
    base_url: "https://..."         # API endpoint (optional, auto-detected for known providers)
    type: openai-compatible         # Required for non-standard providers (Ollama, vLLM, etc.)
    models:
      <alias>:                      # User-friendly name (used with /model and default_model)
        id: "model-id"             # Provider's actual model ID
        max_tokens: 8192           # Max output tokens (optional)
        context_window: 200000     # Max input context (optional)
        supports_tool_calling: true # Native tool calling support (optional)
        supports_streaming: true    # Streaming response support (optional)
FieldTypeRequiredDescription
api_keystringNo*API key or env var reference. Not required for local providers (Ollama, vLLM).
base_urlstringNoCustom API endpoint URL. Defaults to the provider's official endpoint.
typestringNo*Provider type: anthropic, openai, google, or openai-compatible. Auto-detected from the provider name for anthropic, openai, and google/gemini. Required for custom providers.
modelsobjectYesMap of model aliases to model configurations.

Environment variables are resolved lazily — only when the provider is actually used. Missing env vars for unused providers do not cause errors.

Top-Level Defaults

version: 1                    # Required
default_model: claude-sonnet  # Model alias (must match a key in a provider's models map)

Identity

Configure the co-author identity for git commits:

identity:
  name: "Copair"
  email: "copair[bot]@noreply.dugleelabs.io"
FieldTypeDefaultDescription
namestringCopairName used in Co-authored-by: trailers
emailstringcopair[bot]@noreply.dugleelabs.ioEmail used in Co-authored-by: trailers

To link the co-author to a real GitHub profile, use a GitHub noreply email: [email protected].

Permissions

permissions:
  mode: ask                   # ask | auto-approve | deny
  allow_commands:             # Bash commands auto-approved (no shell operators)
    - git status
    - git diff
    - npm test
  allow_paths:                # Glob patterns for paths outside the project root
    - ~/shared-libs
  deny_paths:                 # Glob patterns unconditionally denied
    - ~/.ssh
    - ~/.aws
FieldTypeDefaultDescription
modestringaskDefault permission mode for tool calls
allow_commandsstring[][]Bash commands that are auto-approved without prompting. Shell operators (;, &&, |) are not allowed.
allow_pathsstring[][]Glob patterns of paths outside the project root that the agent may access.
deny_pathsstring[][]Glob patterns unconditionally denied regardless of approval mode. When non-empty, replaces the built-in deny list.

See Permissions & Approval for allow-list configuration.

Context

context:
  summarization_model: "ollama/llama4"
  max_sessions: 1
FieldTypeDefaultDescription
summarization_modelstringautoModel used for session summarization on exit. Defaults to local 7B via Ollama if available, else the active model.
max_sessionsnumber1Maximum sessions to retain per project. Oldest sessions are pruned when exceeded.

UI

Toggle visual features:

ui:
  status_bar: true
  syntax_highlight: true
  bordered_input: true
  output_collapsing: true
  vi_mode: false
FieldTypeDefaultDescription
status_barbooleantrueShow persistent status bar at terminal bottom
syntax_highlightbooleantrueSyntax highlighting in code blocks
bordered_inputbooleantrueBordered input box (auto-disabled in terminals with ghosting issues)
output_collapsingbooleantrueCollapse consecutive same-tool calls into a single updating line
vi_modebooleanfalseEnable vi keybindings in the input line

Knowledge

Configure the project knowledge base (COPAIR_KNOWLEDGE.md):

knowledge:
  warn_size_kb: 8
  max_size_kb: 16
FieldTypeDefaultDescription
warn_size_kbnumber8Warn when COPAIR_KNOWLEDGE.md exceeds this size in KB
max_size_kbnumber16Hard cap in KB — entries are auto-pruned beyond this

Security

Control file system access and secrets handling:

security:
  path_validation: strict     # 'strict' (default) or 'warn'
  redact_high_entropy: false  # opt-in high-entropy base64 redaction
FieldTypeDefaultDescription
path_validationstrict | warnstrictIn strict mode, file tool calls outside the project root are denied. In warn mode, they are logged and allowed — useful for debugging path issues.
redact_high_entropybooleanfalseWhen true, long high-entropy base64 strings are also redacted from logs and tool results, in addition to the known secret patterns.

In strict mode (default), the read, write, edit, glob, and grep tools are restricted to paths within the project root (resolved via git rev-parse --show-toplevel, or the directory where copair was started). Symlinks are resolved before the boundary check — symlink escape attempts are denied.

Network

Configure timeouts for outbound network calls:

network:
  web_search_timeout_ms: 15000    # default: 15s
  provider_timeout_ms: 120000     # default: 120s
FieldTypeDefaultDescription
web_search_timeout_msnumber15000Timeout in milliseconds for web search adapter fetch calls.
provider_timeout_msnumber120000Timeout in milliseconds passed to the LLM provider client (Anthropic, OpenAI).

MCP

mcp_servers:
  - name: "server-name"
    command: "npx"
    args: ["@scope/mcp-server"]
    env:
      KEY: "${ENV_VAR}"
    timeout_ms: 30000  # optional — overrides global 30s default for this server
FieldTypeDefaultDescription
namestringrequiredIdentifier for this server, used in allow-list rules and logs.
commandstringrequiredCommand to start the server process.
argsstring[][]Arguments passed to the command.
envobjectEnvironment variables injected into the server process. Supports ${VAR} references.
timeout_msnumber30000Tool call timeout for this server in milliseconds. If the server does not respond within this window, it is marked degraded and subsequent calls fail immediately.

See MCP Servers for full MCP configuration.

Environment Variables

Use ${VAR_NAME} syntax to reference environment variables anywhere in config:

apiKey: "${ANTHROPIC_API_KEY}"

Variables are resolved at the time the value is accessed, not when the config file is loaded. This means you can configure multiple providers and only need the environment variables for the providers you actually use.

Next Steps

Last updated May 12, 2026