rtk-ai/rtk

Feature: Add filter for `docker compose logs` (high-volume, currently proxied raw)

Open

#578 geöffnet am 13. März 2026

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clieffort-mediumenhancementhelp wantedpriority:high

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)

Beschreibung

Summary

docker compose logs is currently intercepted via rtk proxy but has no output filter, resulting in 0% token savings. This is a high-volume command that would benefit significantly from filtering.

Usage data

From rtk discover on my machine (last 30 days):

  • docker compose logs: 606 runs, estimated ~200K+ tokens saveable
  • docker-compose logs (legacy syntax): 40 additional runs

Expected behavior

rtk docker compose logs should filter output similarly to rtk docker logs, which currently achieves ~78-83% savings.

Suggested filter behaviors

  1. Tail truncation: When --tail=N is specified, only return the last N lines (already done for docker logs)
  2. Timestamp normalization: Collapse repeated timestamps into a single header
  3. Service prefix deduplication: When multiple services log the same line (e.g., health checks), collapse with a count
  4. ANSI stripping: Remove color codes that bloat token count
  5. Known noise patterns: Filter out common low-signal lines (e.g., health: starting, repeated keepalive pings)

Related

  • rtk fallback: grep -rn... also hits 0% savings on some patterns — the grep parser appears to fall back silently on certain flag combinations (-rn with path args). Worth investigating alongside this.

Environment

  • RTK version: $(rtk --version 2>/dev/null)
  • Shell: zsh / macOS Darwin 25.2.0

Contributor Guide