rtk-ai/rtk

Feature request: rtk wrapper for ssh remote commands

Open

#1,607 opened on 2026年4月29日

GitHub で見る
 (2 comments) (1 reaction) (0 assignees)Rust (2,914 forks)batch import
area:clieffort-largeenhancementhelp wantedpriority:medium

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (平均マージ 11d 1h) (30d で 45 merged PRs)

説明

Real-world numbers from rtk discover --all --since 30:

Pattern Calls (30d)
ssh <host> '<cmd>' 58

Common patterns include checking remote service status (systemctl status), tailing logs (journalctl, tail -n N), inspecting disk usage (df -h), and listing processes (ps aux). The remote command's output flows back unchanged and ends up in the LLM context — often verbose (multi-screen journalctl output, multi-line systemctl status blocks).

Two implementation directions worth considering:

  1. Post-receive output filtering: detect well-known remote commands by parsing ssh ... '<cmd>' and apply the matching rtk filter to the output stream after it returns locally. Works without any setup on the remote.
  2. Remote-side rtk prefix: when the remote machine is known to have rtk installed, prefix the inner command with rtk (i.e. send rtk systemctl status X instead of systemctl status X). Requires a hint mechanism (env var or config file) listing rtk-capable hosts.

Direction (1) is the lower-friction option since it works for any host. Direction (2) gives full RTK filtering quality but adds setup.

Suggested initial scope (direction 1):

For ssh <host> 'systemctl status <unit>':

  • Keep Loaded, Active, Main PID, Memory, Tasks, last 3 log lines
  • Drop CGroup tree, environment dump, repeated whitespace

For ssh <host> 'journalctl ...':

  • Apply standard log dedup (collapse identical-with-timestamp lines)
  • Truncate to last N entries by default

For other commands: pass through with a hint to use rtk on the remote where possible.

Methodology: counts come from rtk discover --all --since 30 against the local Claude Code transcript directory.

コントリビューターガイド