Repository navigation
feat(ssh): support -- to pass commands to remote host - #800
Conversation
Adds Docker-style command passthrough via --: onctl ssh VM_NAME -- COMMAND [ARGS...] Without --, behavior is unchanged (interactive SSH session). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3efdee7e1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… used Previously args[1:] was always passed to SSHInto, causing any extra positional arg to be treated as a remote command even without --. Now os.Args is checked directly for -- since Cobra strips it before passing to Run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #800 +/- ##
==========================================
+ Coverage 11.58% 11.76% +0.17%
==========================================
Files 36 36
Lines 3115 3127 +12
==========================================
+ Hits 361 368 +7
- Misses 2710 2716 +6
+ Partials 44 43 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Extract inline os.Args scanning into parseRemoteCmd helper and add unit tests to satisfy codecov/patch requirement. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Resolved the Codex P2 review: fixed in 9753804 by extracting os.Args scanning into parseRemoteCmd() which only returns a non-nil slice when -- is explicitly present. Added unit tests in TestParseRemoteCmd for full coverage. |
Summary
--command passthrough toonctl sshonctl ssh VM_NAME -- COMMAND [ARGS...]runs the command on the remote instead of opening an interactive session--, behavior is unchanged — drops into an interactive SSH session as beforeUsage
Test plan
onctl ssh <vm>still opens interactive sessiononctl ssh <vm> -- <cmd>executes command on remote and exits🤖 Generated with Claude Code