Skip to content

TOML rules

Most commands are compressed by a TOML rule rather than a hand-rolled Rust filter. Rules are embedded into the binary at build time (zero runtime cost) and live under apps/cli/src/rules/.

apps/cli/src/rules/brew.toml
[filter]
name = "brew-install"
commands = ["brew install", "brew upgrade"]
strip_patterns = ["^==>.*Downloading", "^==>.*Pouring", "^🍺.*"]
head_lines = 5
tail_lines = 3
empty_message = "ok"
[[assertions]]
input = "==> Downloading\n==> Pouring foo\n🍺 foo installed"
expected_contains = "ok"
min_savings_pct = 60

Drop a TOML file under .tok0/filters/ in any project. The directory must be explicitly trusted before tok0 will load custom rules:

Terminal window
tok0 trust .

User-global rules go in ~/.config/tok0/filters/ and don’t require trust.