TOML filters cannot match `docker exec` commands (built-in docker module claims them first)
#1356 aperta il 17 apr 2026
Metriche repository
- Star
- (48.085 star)
- Metriche merge PR
- (Merge medio 11g 1h) (45 PR mergiate in 30 g)
Descrizione
Problem
User-defined TOML filters in ~/.rtk/filters.toml cannot intercept docker exec commands because the built-in Rust docker module claims the docker command before the TOML fallback path is reached.
The built-in docker module only handles ps, images, logs, and compose. For docker exec, it effectively passes through unchanged (0% savings), but the TOML engine never gets a chance to apply user filters.
Use case
Many development workflows execute tools inside Docker containers:
docker exec my-container vendor/bin/phpunit
docker exec my-container psalm
docker exec my-container phpcs
docker exec my-container infection
These produce the same output as their native counterparts, but TOML filters like this have no effect:
[filters.phpunit]
description = "Compact PHPUnit output from Docker container"
match_command = "^docker\\s+exec\\s+.*vendor/bin/phpunit"
strip_ansi = true
strip_lines_matching = [
"^\\s*$",
"^PHPUnit \\d+",
"^Runtime:",
"^Configuration:",
"^\\.+$",
"^Time:",
"^Memory:",
]
max_lines = 60
on_empty = "phpunit: all tests passed"
Expected behavior
One of:
- The built-in
dockermodule delegates unhandled subcommands (likeexec) to the TOML filter engine - TOML
match_commandcan override built-in modules (user filters take precedence) - The
docker execpath extracts the inner command and matches TOML filters against it (e.g., matchingvendor/bin/phpunitinstead of the fulldocker exec ... vendor/bin/phpunit)
Actual behavior
rtk docker exec <container> <command> always shows 0% savings regardless of TOML filters defined in ~/.rtk/filters.toml.
Environment
- rtk v0.36.0
- macOS
- Installed via Homebrew