Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

donttouch uses a TOML config file: .donttouch.toml

File Format

[protect]
enabled = true
patterns = [
    "*.toml",
    "Cargo.lock",
    "migrations/**",
    ".env",
    "README.md",
]

Fields

[protect]

FieldTypeDefaultDescription
enabledbooltrueWhether protection is active
patternsstring[][]Glob patterns for files to protect

Patterns

Patterns use standard glob syntax:

PatternMatches
*.tomlAll .toml files in the root
migrations/**Everything under migrations/
docker-compose.ymlExact file
*.lockAll lock files

Patterns are resolved relative to the project root (where .donttouch.toml lives).

Self-Protection

The .donttouch.toml file itself is always protected when you run lock. This prevents agents from modifying the config to remove patterns.

Enabled Flag

When enabled = false:

  • check passes (no enforcement)
  • Pre-push hook blocks (forces you to re-lock before pushing)

The flag is managed automatically:

  • donttouch lock sets enabled = true
  • donttouch unlock sets enabled = false