Configuration
Configuration
Section titled “Configuration”Codive can be configured via configuration files, environment variables, or command-line flags.
Configuration Hierarchy
Section titled “Configuration Hierarchy”Codive loads configuration in this order (later sources override earlier ones):
- Default values
- User config:
~/.config/codive/config.toml - Project config:
./codive.toml - Environment variables
- Command-line flags
Configuration File
Section titled “Configuration File”Create a config.toml file:
mkdir -p ~/.config/codivetouch ~/.config/codive/config.tomltouch codive.tomlFull Configuration Reference
Section titled “Full Configuration Reference”# codive.toml - Full configuration example
#-----------------------------------------# Provider Configuration#-----------------------------------------[provider]# LLM provider: "anthropic" | "openai"name = "anthropic"
# Model to use# Anthropic: "claude-sonnet-4-20250514", "claude-opus-4-20250514"# OpenAI: "gpt-4", "gpt-4-turbo"model = "claude-sonnet-4-20250514"
# API base URL (optional, for proxies or custom endpoints)# base_url = "https://api.anthropic.com"
# Temperature for responses (0.0 - 1.0)temperature = 0.7
# Maximum tokens per responsemax_tokens = 4096
#-----------------------------------------# Agent Behavior#-----------------------------------------[agent]# Maximum tool call iterations per requestmax_iterations = 50
# Require confirmation before writing filesconfirm_writes = true
# Require confirmation before running commandsconfirm_commands = true
# Auto-accept changes matching these patternsauto_accept_patterns = [ "*.md", "*.txt", ".gitignore",]
#-----------------------------------------# Tools Configuration#-----------------------------------------[tools]# Enabled tools (default: all)enabled = [ "read", "write", "bash", "glob", "grep",]
# Disabled tools (overrides enabled)# disabled = ["bash"]
# Bash tool settings[tools.bash]# Allowed commands (empty = all allowed)allowed_commands = []
# Blocked commandsblocked_commands = [ "rm -rf /", "sudo rm", "> /dev/sda",]
# Command timeout in secondstimeout = 30
#-----------------------------------------# Context & Indexing#-----------------------------------------[context]# Maximum files to include in contextmax_files = 100
# Maximum file size to read (in bytes)max_file_size = 1048576 # 1MB
# File patterns to ignoreignore_patterns = [ "node_modules/**", "target/**", ".git/**", "*.lock", "dist/**",]
# Always include these files in contextinclude_files = [ "README.md", "Cargo.toml", "package.json",]
#-----------------------------------------# Server Mode#-----------------------------------------[server]# Server host and porthost = "127.0.0.1"port = 3000
# Enable CORScors = true
# Session timeout in minutessession_timeout = 60
#-----------------------------------------# Logging#-----------------------------------------[logging]# Log level: "error" | "warn" | "info" | "debug" | "trace"level = "info"
# Log file path (optional)# file = "~/.local/share/codive/codive.log"
# Log format: "pretty" | "json"format = "pretty"
#-----------------------------------------# UI/TUI Settings#-----------------------------------------[ui]# Color theme: "auto" | "dark" | "light"theme = "auto"
# Show token usageshow_tokens = true
# Enable syntax highlightingsyntax_highlighting = trueEnvironment Variables
Section titled “Environment Variables”All configuration options can be set via environment variables:
| Variable | Description | Example |
|---|---|---|
ANTHROPIC_API_KEY | Anthropic API key | sk-ant-... |
OPENAI_API_KEY | OpenAI API key | sk-... |
CODIVE_PROVIDER | LLM provider | anthropic |
CODIVE_MODEL | Model name | claude-sonnet-4-20250514 |
CODIVE_MAX_ITERATIONS | Max iterations | 50 |
CODIVE_LOG_LEVEL | Log level | debug |
Command-Line Flags
Section titled “Command-Line Flags”Override any setting from the command line:
# Use a specific provider and modelcodive --provider openai --model gpt-4
# Increase max iterationscodive --max-iterations 100
# Run in verbose modecodive --verbose
# Skip confirmation promptscodive --yesAll Flags
Section titled “All Flags”codive [OPTIONS] [PROMPT]
Arguments: [PROMPT] Optional prompt to run in one-shot mode
Options: -p, --provider <PROVIDER> LLM provider [anthropic, openai] -m, --model <MODEL> Model to use -c, --context <PATH> Focus on specific path --max-iterations <N> Maximum iterations [default: 50] -y, --yes Auto-accept all changes -v, --verbose Enable verbose output -q, --quiet Minimal output --serve Start in server mode --connect <ADDR> Connect to remote server --port <PORT> Server port [default: 3000] --new-session Start a fresh session --config <FILE> Use specific config file -h, --help Print help -V, --version Print versionProject-Specific Configuration
Section titled “Project-Specific Configuration”Create a codive.toml in your project root for project-specific settings:
Directorymy-project/
- codive.toml
Directorysrc/
- …
- Cargo.toml
[context]# Always include the architecture docsinclude_files = [ "ARCHITECTURE.md", "docs/API.md",]
# Ignore build artifactsignore_patterns = [ "target/**", ".cargo/**",]
[tools.bash]# Project-specific allowed commandsallowed_commands = [ "cargo *", "npm *", "make *",]Configuration Profiles
Section titled “Configuration Profiles”You can create multiple configuration profiles and switch between them:
# work.toml# personal.toml# oss.toml
# Use a specific profilecodive --config ~/.config/codive/profiles/work.tomlOr set via environment:
export CODIVE_CONFIG=~/.config/codive/profiles/work.tomlcodiveValidating Configuration
Section titled “Validating Configuration”Check your configuration for errors:
codive config validateShow the effective configuration:
codive config showNext Steps
Section titled “Next Steps”- Explore available commands
- Add custom tools
- Set up IDE integration