rtk-ai/rtk

feat: Add pm2 command support (list, logs, restart)

Open

#1.525 geöffnet am 25. Apr. 2026

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:clieffort-mediumenhancementgood first issuehelp wantedpriority:low

Repository-Metriken

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

Beschreibung

pm2 is widely used for process management in Node.js projects. Its output is heavy on ANSI formatting and table borders, making it a good candidate for RTK filtering.

Commands and output characteristics:

  • pm2 list — wide ANSI table with box-drawing characters, status colors. ~30-50 lines per run.
  • pm2 logs <name> --lines N — log output with ANSI timestamps. Already bounded by --lines but ANSI stripping alone would save tokens.
  • pm2 restart <name> — short output (1-3 lines), lower priority.

None of these are intercepted by the hook engine:

$ rtk hook check "pm2 list"        # → exit 1, no rewrite ✗
$ rtk hook check "pm2 logs app"    # → exit 1, no rewrite ✗
$ rtk hook check "pm2 restart app" # → exit 1, no rewrite ✗

Suggested behavior:

  • pm2 list → strip ANSI, compact table format, show name/status/cpu/mem columns only
  • pm2 logs → strip ANSI color codes, preserve timestamps and content
  • pm2 restart → passthrough (already compact)

Usage context: ~639 calls/month across Claude Code sessions (316 logs, 211 restart, 112 list).

Contributor Guide