Feature Request rtk ssh subcommand — remote command output filtering
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
Research direction
The requested entry point is a new rtk ssh subcommand; begin by reading the existing rtk filters and the PreToolUse hook behavior described in the issue. Verify how remote stdout, exit codes, and interactive sessions are handled. Done means recognized remote commands use the appropriate filter, unrecognized commands use the generic rtk log fallback, and normal SSH behavior remains safe.
Written by the indexing model from the issue text.
Description
rtk ssh subcommand — remote command output filtering
Running rtk discover on a codebase with multiple remote dev servers shows SSH as by far the largest unhandled savings opportunity:
TOP UNHANDLED COMMANDS
| Command | Count | Example |
|---|---|---|
ssh [host] |
787 | ssh host "cd /project && git log --oneline -20" |
ssh [host2] |
200 | ssh host2 "cat /etc/some-config" |
ssh [host3] |
30 | ssh host3 "diff /path/file1 /path/file2" |
~1,000 SSH invocations in 30 days, all piping back verbose output that rtk could filter if it had a way to intercept.
Proposed: rtk ssh
rtk ssh user@host "pytest tests/" # pipe remote stdout through rtk pytest
rtk ssh user@host "git log -n 20" # pipe through rtk git log
rtk ssh user@host "cat big-file.log" # pipe through rtk log
The subcommand would:
- Execute the remote command via SSH normally
- Detect the remote command type (first token after the quoted string)
- Pipe stdout through the appropriate existing
rtkfilter
Why the hook can't handle this today
The PreToolUse hook could rewrite ssh host "cmd" → ssh host "cmd" 2>&1 | rtk log, but this breaks exit codes and interactive sessions, so a dedicated subcommand is safer.
Fallback behaviour
If the remote command type isn't recognised, pipe through rtk log (dedup + truncate) as a generic fallback — still better than raw output.
Environment: macOS, Claude Code PreToolUse hook, rtk 0.24.0
- Dominant language
- Rust
- Stars
- 81.1k
- Forks
- 5.1k
- Avg merge
- 4d 11h
- Merged PRs (30d)
- 40
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rtk-ai/rtk
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug core output-formatting
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
uv_cmd discards print_with_hint's return value, so the tee hint is not counted and savings read 100% Openanalytics bug python
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
area:cli bug good first issue platform:windows priority:medium resolved-pending-close
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
area:cli bug good first issue priority:high
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
A-linter
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oxc-project/oxc#26863 ·