Skip to content

Configuration examples

Ready-to-adapt snippets for common setups. Combine the sections you need into your ~/.gdc/config.toml (user-wide) or a project's .gdc/config.toml (project-only). Every section is optional — see the Reference for all options.

A complete starter config

~/.gdc/config.toml
[provider]
base_url = "http://localhost:11434/v1"
model    = "qwen2.5-coder:14b-instruct"

[storage]
path = "~/.gdc/sessions.db"

[permissions.bash]
allow = ["jq", "rg"]
deny  = ["aws"]

[permissions.path]
allow = ["~/work/scratch/**"]
deny  = ["~/.aws/**"]

[memory]
enabled = true

[tui]
theme = "dark"

Local model only

The minimum for a fully local setup:

[provider]
base_url = "http://localhost:11434/v1"
model    = "qwen2.5-coder:14b-instruct"

Hosted provider with an API key

[provider]
base_url = "https://api.example.com/v1"
model    = "some-hosted-model"
api_key  = "sk-..."

Keep keys out of shared files

For a project config that's checked into version control, prefer the GDC_API_KEY environment variable over writing the key in the file.

Switch between several endpoints

Define named profiles and flip the active one:

[provider]
active = "local"

[provider.profiles.local]
base_url = "http://localhost:11434/v1"
model    = "qwen2.5-coder:14b-instruct"

[provider.profiles.hosted]
base_url = "https://api.example.com/v1"
model    = "some-hosted-model"
api_key  = "sk-..."

Tighten permissions

Stop the agent from touching sensitive paths, and pre-approve the harmless commands you use constantly:

[permissions.bash]
allow = ["ls", "cat", "rg", "jq", "git"]
deny  = ["curl", "wget", "ssh"]

[permissions.path]
deny  = ["~/.ssh/**", "~/.aws/**", "**/.env"]

Connect external tools (MCP)

[mcp.servers.git]                 # a local program
command = "uvx"
args    = ["mcp-server-git", "--repo", "."]
trusted = true

[mcp.servers.docs]                # a remote service
url         = "https://example.com/mcp"
auth_header = "Bearer YOUR_TOKEN"
trusted     = false

MCP servers

Audit every shell command with a hook

[hooks]
enabled = true
default_timeout_secs = 5

[[hooks.entries]]
event   = "pre_tool_use"
command = "/usr/local/bin/audit.sh"

[hooks.entries.matcher]
tool = "Bash"

Hooks

Default to concise replies

[output_styles]
default = "concise"

Project config vs. user config

Put shared, project-specific settings in the project's file and check it in; keep personal settings (and secrets) in your user file.

<project>/.gdc/config.toml
# Shared with everyone who works on this project.
[permissions.bash]
allow = ["make", "cargo", "npm"]

[skills]
paths = ["./.gdc/skills"]