Skip to content

Configuration

The default configuration file is located at:

~/.config/clonit/config.yaml

Use the --config flag to specify an alternative path.

A complete configuration file with all available options:

secret_key: <auto-generated-hex-key>
working_directory: ~/.clonit
env: production
log:
level: info # debug, info, warn, error
format: text # text, json
docker:
images:
postgres: postgres:latest
mysql: mysql:8.0-oracle
defaults:
dump_jobs: 4
restore_jobs: 4
auto_push: true
# Cloud integration (optional)
cloud:
url: "https://cloud.clonit.ai"
api_key: "clt_your_api_key_here"
agent_id: "" # auto-set after registration
# Sanitization analysis (optional)
analysis:
api_key: "sk-ant-..." # Anthropic API key
model: "claude-sonnet-4-20250514" # LLM model to use
max_tokens: 8192 # Max response tokens

The following defaults are set via Viper SetDefault() and apply when no explicit value is provided in the config file, environment, or flags:

Key Default Description
secret_key (empty) AES encryption key for sensitive fields
working_directory ~/.clonit Directory for snapshot files
log.level info Log level: debug, info, warn, error
log.format text Log format: text, json
env production Environment name
docker.images.postgres postgres:latest PostgreSQL Docker image
docker.images.mysql mysql:8.0-oracle MySQL Docker image
defaults.dump_jobs 4 Default parallel dump jobs
defaults.restore_jobs 4 Default parallel restore jobs
defaults.verify_urls true Verify URL connectivity on target add/update
defaults.auto_push true Automatically push snapshots to storage after build
Key Default Description
cloud.url (empty) Clonit Cloud API URL
cloud.api_key (empty) API key for cloud authentication
cloud.agent_id (empty) Agent ID (set automatically after registration)
Key Default Description
analysis.api_key (empty) Anthropic API key for sanitization analysis
analysis.model claude-sonnet-4-20250514 LLM model for analysis
analysis.max_tokens 8192 Maximum response tokens

All configuration keys can be set through environment variables. Use the prefix CLONIT_ and separate nested keys with __ (double underscore):

Terminal window
CLONIT_SECRET_KEY=mykey
CLONIT_LOG__LEVEL=debug
CLONIT_DEFAULTS__DUMP_JOBS=8
CLONIT_CLOUD__URL=https://cloud.clonit.ai
CLONIT_CLOUD__API_KEY=clt_your_key
CLONIT_ANALYSIS__API_KEY=sk-ant-...

These flags are available on every command:

Flag Type Default Description
--config string ~/.config/clonit/config.yaml Path to config file
--debug bool false Enable debug logging
--quiet bool false Suppress non-essential output

Clonit stores metadata (targets, snapshots, storage profiles, analyses, sanitization queries) in a SQLite database at:

~/.config/clonit/clonit.db

The database is created automatically on first run and kept up to date using goose migrations embedded in the binary. No manual migration steps are required.

Configuration values are resolved in the following order, from highest to lowest priority:

  1. Flags – command-line flags (--debug, --config, etc.)
  2. Environment variablesCLONIT_* prefixed variables
  3. Config file – values from config.yaml
  4. Defaults – built-in defaults set via Viper SetDefault()