Skip to main content

Configuration

Batho works out of the box with zero config. For production use, configure with the unified root config file ./batho.yaml (or start from batho.yaml.example) plus optional environment overrides.

Configuration Precedence

  1. Built-in defaults
  2. ./batho.yaml
  3. Environment variables (override file values)
  4. CLI flags (override for a specific run)

Core Config Areas

AreaKeysWhat it controls
logginglevel, json_format, quiet, file, formatProcess-wide logging and CLI verbosity behavior
pathsctn_dirArtifact output directory
indexermax_file_size_kb, max_workers, max_indexed_files, ignore_*, metrics_outputBase indexing limits and outputs
rulesenabled, builtin_plugins, custom_rules_*, strict_validationRule plugins and metadata enrichment
bsg.parallelenabled, max_workers, chunk_sizeParallel file extraction
bsg.ignoreenabled, file.bathoignore integration
bsg.cacheenabled, path, max_size_mb, ttl_daysAST cache behavior
bsg.incrementalenabled, fallback_to_full, auto_detect_gitIncremental indexing strategy
bsg.symbol_resolutionenabled, fuzzy_matching, cache_symbolsCross-file symbol resolution
bsg.serializationmethod, compression, batch_sizeBSG render strategy
bsg.parsingerror_recovery, partial_parsing, max_file_size_mb, skip_commentsParser behavior
bsg.queryenabled, index_on_write, cache_enabled, cache_size, default_limit, query_timeout_msPersistent query indexes
bsg.storageenabled, backend, registry_path, content_scope, cloud_sync_ready, mmap_enabled, retention.*Durable artifact registry and retention
hooksenabled, includeGit client-side hook automation pointer

Environment Variables (Common)

VariableDefaultDescription
BATHO_LOG_LEVELINFODEBUG, INFO, WARNING, ERROR
BATHO_LOG_JSONnullForce JSON logs (true) or leave auto mode (unset)
BATHO_LOG_QUIETfalseSuppress non-error output globally
BATHO_LOG_FILEunsetOptional log file path
BATHO_CTN_DIR.ctnOutput directory
BATHO_MAX_FILE_SIZE_KB500Max file size to parse
BATHO_MAX_INDEXED_FILES200000Hard cap on indexed files
BATHO_INDEX_WORKERS0Worker threads (0 = auto)
BATHO_METRICS_OUTPUT.ctn/metrics.jsonMetrics output path
BATHO_PLUGINS_ENABLEDconfig value#/plugins
BATHO_PLUGINS_CUSTOM_PLUGINS_PATHunsetYAML file containing custom BSG plugins
BATHO_PLUGINS_BUILTIN_PLUGINSbsg_coreComma-separated built-in plugin names
BATHO_PLUGINS_DISABLED_PLUGINSunsetComma-separated plugin names to disable
BATHO_BSG_STORAGE_ENABLEDtrueEnable durable artifact registry
BATHO_BSG_STORAGE_REGISTRY_PATH.ctn/artifact_registry.dbRegistry database path
BATHO_BSG_STORAGE_MMAP_ENABLEDfalseEnable mmap reads for large persisted JSON
BATHO_BSG_QUERY_INDEX_ON_WRITEtrueBuild query index at write time
BATHO_BSG_QUERY_CACHE_SIZE256Query service cache size

For the complete env override set, see batho/config.py.

Config File Example

# ./batho.yaml
logging:
level: DEBUG
json_format: true
quiet: false
file: .ctn/batho.log
format: "%(message)s"

indexer:
max_file_size_kb: 1000
max_workers: 16
ignore_patterns:
- "**/vendor/**"
- "**/dist/**"

flags:
strict: true
fail_on_warning: true

rules:
enabled: true
builtin_plugins: [bsg_core]
disabled_rules: []
custom_rules_path: ./bsg-rules.yaml
custom_rules_inline:
- name: payment-cluster
entity_types: ["function", "method"]
name_patterns: ["*payment*", "*invoice*"]
metadata:
bsg.cluster_hint: billing

# Validation controls
strict_validation: false
fail_on_rule_error: false

bsg:
parallel:
enabled: true
max_workers: 16
chunk_size: 50
cache:
enabled: true
path: .ctn/local/cache/ast_cache.db
max_size_mb: 1024
ttl_days: 30
query:
enabled: true
index_on_write: true
cache_enabled: true
cache_size: 256
default_limit: 200
storage:
enabled: true
backend: sqlite
registry_path: .ctn/artifact_registry.db
content_scope: durable
cloud_sync_ready: true
mmap_enabled: false
retention:
enabled: true
snapshot_ttl_days: 90
patch_ttl_days: 90
metrics_ttl_days: 30
context_ttl_days: 90

Scenario Playbooks

1) Local Dev (fast feedback)

indexer:
max_workers: 0
max_file_size_kb: 500
bsg:
incremental:
enabled: true
cache:
enabled: true
batho index --root .
batho patch --root . --scan
batho bsg --root . --mode compressed --budget 12000