-
Notifications
You must be signed in to change notification settings - Fork 886
feat: add one shot commands to the coder ssh command #17779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
func(next serpent.HandlerFunc) serpent.HandlerFunc { | ||
return func(i *serpent.Invocation) error { | ||
got := len(i.Args) | ||
if got < 1 { | ||
return xerrors.New("expected the name of a workspace") | ||
} | ||
|
||
return next(i) | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this here, but we should add a serpent MW for RequireMinArgs(n)
. I also wanted it at some point.
cli/ssh.go
Outdated
Use: "ssh <workspace>", | ||
Short: "Start a shell into a workspace", | ||
Use: "ssh <workspace> [command]", | ||
Short: "Start a shell into a workspace or run a command", | ||
Long: "This command does not have full parity with the standard SSH command. For users who need the full functionality of SSH, create an ssh configuration with `coder config-ssh`.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ssh <workspace> ls -la
works, but coder ssh <workspace> ls -la
does not. I don't think we have to fix this, but we should have an example on how to pass flags. It is common unix stuff, but worth throwing in here imo.
Long: "This command does not have full parity with the standard SSH command. For users who need the full functionality of SSH, create an ssh configuration with `coder config-ssh`.", | |
Long: "This command does not have full parity with the standard SSH command. For users who need the full functionality of SSH, create an ssh configuration with `coder config-ssh`.\n" + | |
FormatExamples( | |
Example{ | |
Description: "Use `--` to separate and pass flags directly to the command executed via SSH.", | |
Command: "coder ssh <workspace> -- ls -la", | |
}, | |
), |
Closes #2154
Warning
The tests in this PR were co-authored by AI