Location: ~/.config/gokin/config.yaml
Gokin uses YAML configuration with 22+ sections. All parameters have sensible defaults.
Configuration Sections#
api — Providers & Keys#
api:
active_provider: gemini # Current provider
gemini_key: "" # Gemini API key
anthropic_key: "" # Anthropic API key
deepseek_key: "" # DeepSeek API key
glm_key: "" # GLM API key
minimax_key: "" # MiniMax API key
kimi_key: "" # Kimi API key
ollama_key: "" # Ollama API key (optional)
ollama_base_url: "http://localhost:11434" # Ollama server
gemini_oauth: # OAuth tokens (automatic)
access_token: ""
refresh_token: ""
expiry: ""
retry:
max_retries: 3
retry_delay: 1s
http_timeout: 120s
stream_idle_timeout: 0 # 0 = provider defaultmodel — Model & Parameters#
model:
name: gemini-3-flash-preview # Model name
provider: "" # Explicit provider (or auto-detect)
preset: "" # coding, fast, balanced, creative
temperature: 1.0 # Generation temperature
max_output_tokens: 8192 # Max output tokens
enable_thinking: false # Extended thinking (Anthropic)
thinking_budget: 0 # Thinking budget (tokens)
custom_base_url: "" # Custom API endpoint
fallback_providers: [] # Failover: ["deepseek", "gemini"]
max_pool_size: 5 # Connection pool sizetools — Tools#
tools:
timeout: 2m # Tool timeout
bash_sandbox: true # Bash sandbox
blocked_commands: # Blocked commands
- "rm -rf /"
- "mkfs"
allowed_directories: [] # Allowed directories (empty = all)
formatters: # Auto-format after writes
.py: "black"
.go: "gofmt"ui — User Interface#
ui:
theme: dark # dark, macos, light
stream_output: true # Stream responses
markdown_rendering: true # Render Markdown
show_tool_calls: true # Show tool calls
show_token_usage: true # Show token usage
mouse_mode: enabled # enabled / disabled
show_welcome: true # Welcome message
hints_enabled: true # Contextual hints
compact_mode: false # Compact mode
bell: true # Terminal bell on prompts
native_notifications: false # macOS Notification Centercontext — Context Management#
context:
warning_threshold: 0.8 # Warning at 80% context
summarization_ratio: 0.5 # Summarize to 50%
tool_result_max_chars: 10000 # Max chars per tool result
enable_auto_summary: true # Auto-summarization
auto_compact_threshold: 0.75 # Auto-compact at 75%permission — Permissions#
permission:
default_policy: ask # ask, allow, deny
rules:
read: allow # Auto-allow
glob: allow
grep: allow
write: ask # Ask
edit: ask
bash: ask
ssh: ask
delete: askplan — Planning#
plan:
enabled: true
require_approval: true # Approval before execution
auto_detect: true # Auto-detect complex tasks
clear_context: true # Clear context before planning
delegate_steps: true # Delegate steps to agents
abort_on_step_failure: false # Don't abort on failure
planning_timeout: 60s
algorithm: beam # beam, mcts, astarhooks — Hooks#
hooks:
- name: "pre_git_commit"
type: pre_tool # pre_tool, post_tool, on_error, on_start, on_exit
tool_name: git_commit
command: "git diff --stat"
enabled: true
condition: always # always, if_previous_success, if_previous_failure
fail_on_error: true
depends_on: "" # Hook chainingweb — Web Search#
web:
provider: "" # serpapi, google
serpapi_key: ""
google_key: ""
google_cx: ""session — Sessions#
session:
enabled: true
save_interval: 2m # Auto-save every 2 minutes
auto_load: true # Load last session on startmemory — Memory#
memory:
enabled: true
max_entries: 1000 # Max memory entries
auto_inject: true # Inject relevant memorieslogging — Logging#
logging:
level: warn # debug, info, warn, errorLog file: ~/.config/gokin/gokin.log (structured JSON via slog).
audit — Audit#
audit:
enabled: true
max_entries: 10000 # Max entries per session
max_result_len: 1000 # Max result length
retention_days: 30 # Retention: 30 daysAudit files: ~/.config/gokin/audit/{sessionID}.json (permissions 0600).
rate_limit — Rate Limiting#
rate_limit:
enabled: true
requests_per_minute: 60
tokens_per_minute: 1000000 # 1M
burst_size: 10cache — Caching#
cache:
enabled: true
capacity: 100 # Max cache entries
ttl: 5m # Entry time-to-livewatcher — File Watcher#
watcher:
enabled: false # Disabled by default
debounce_ms: 500 # Debounce delay (ms)
max_watches: 1000 # Max watched pathsdiff_preview — Diff Preview#
diff_preview:
enabled: true
max_lines: 50000semantic — Semantic Search#
semantic:
enabled: false # Disabled by default
model: text-embedding-004 # Embedding model
index_on_start: false # Index on startup
max_file_size: 102400 # 100KB
cache_ttl: 24h
top_k: 10 # Top-K results
chunk_size: 0 # Chunk size (auto)
chunk_overlap: 0 # Chunk overlap
auto_cleanup: false
index_patterns: [] # Indexing patterns
exclude_patterns: [] # Exclusionscontract — Contract Validation#
contract:
enabled: falsemcp — Model Context Protocol#
mcp:
servers:
- name: "example-server"
transport: stdio # stdio or http
command: "/path/to/server"
args: ["--arg1", "value"]
env:
CUSTOM_VAR: "${HOME}/config"
auto_connect: true
timeout: 15supdate — Updates#
update:
enabled: true
check_interval: 24h
auto_update: false
owner: "" # GitHub owner
repo: "" # GitHub repo
asset_pattern: "" # Binary pattern
max_backups: 3Key Constants (defaults.go)#
Content Limits#
| Constant | Value | Description |
|---|---|---|
| DefaultMaxTokens | 8192 | Max output tokens |
| DefaultMaxChars | 10000 | Max characters |
| DefaultToolResultMaxChars | 30000 | Max tool result |
| DefaultMaxFetchContent | 50000 | Max web content |
| DefaultDiffTruncation | 50000 | Max diff |
Timeouts#
| Constant | Value | Description |
|---|---|---|
| DefaultToolTimeout | 30s | Tool timeout |
| DefaultBashTimeout | 30s | Bash timeout |
| DefaultPermissionTimeout | 5m | Permission wait |
| DefaultAgentTimeout | 30m | Agent timeout |
| DefaultPlanApprovalTimeout | 10m | Plan approval wait |
| DefaultHTTPTimeout | 120s | HTTP timeout |
Limits#
| Constant | Value | Description |
|---|---|---|
| DefaultMaxConcurrentAgents | 5 | Max parallel agents |
| DefaultMaxGlobResults | 1000 | Max glob results |
| DefaultMaxWatches | 1000 | Max watched files |
| DefaultMaxRetries | 3 | Max retries |
| DefaultRetryDelay | 1s | Retry delay |
| DefaultMaxSessionHistory | 200 | Max session messages |
| DefaultMaxMemoryEntries | 100 | Max memory entries |
| DefaultAuditMaxEntries | 10000 | Max audit entries |
Examples#
Minimal Configuration#
api:
active_provider: gemini
gemini_key: "your-key-here"Recommended Configuration#
api:
active_provider: gemini
gemini_key: "your-gemini-key"
anthropic_key: "your-anthropic-key"
model:
name: gemini-3-flash-preview
fallback_providers:
- anthropic
- ollama
ui:
theme: dark
plan:
enabled: true
require_approval: true
memory:
enabled: true
auto_inject: trueOffline Configuration (Ollama)#
api:
active_provider: ollama
ollama_base_url: "http://localhost:11434"
model:
name: qwen2.5-coder
ui:
theme: dark