Configuration
Config File Location
Section titled “Config File Location”The default configuration file is located at:
~/.config/clonit/config.yamlUse the --config flag to specify an alternative path.
Config File Example
Section titled “Config File Example”A complete configuration file with all available options:
secret_key: <auto-generated-hex-key>working_directory: ~/.clonitenv: productionlog: level: info # debug, info, warn, error format: text # text, jsondocker: images: postgres: postgres:latest mysql: mysql:8.0-oracledefaults: 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 tokensConfiguration Defaults
Section titled “Configuration Defaults”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 |
Cloud Configuration
Section titled “Cloud Configuration”| 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) |
Analysis Configuration
Section titled “Analysis Configuration”| 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 |
Environment Variables
Section titled “Environment Variables”All configuration keys can be set through environment variables. Use the prefix CLONIT_ and separate nested keys with __ (double underscore):
CLONIT_SECRET_KEY=mykeyCLONIT_LOG__LEVEL=debugCLONIT_DEFAULTS__DUMP_JOBS=8CLONIT_CLOUD__URL=https://cloud.clonit.aiCLONIT_CLOUD__API_KEY=clt_your_keyCLONIT_ANALYSIS__API_KEY=sk-ant-...Global Flags
Section titled “Global Flags”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 |
Database
Section titled “Database”Clonit stores metadata (targets, snapshots, storage profiles, analyses, sanitization queries) in a SQLite database at:
~/.config/clonit/clonit.dbThe 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 Precedence
Section titled “Configuration Precedence”Configuration values are resolved in the following order, from highest to lowest priority:
- Flags – command-line flags (
--debug,--config, etc.) - Environment variables –
CLONIT_*prefixed variables - Config file – values from
config.yaml - Defaults – built-in defaults set via Viper
SetDefault()