Files
coder/cli/testdata/coder_ssh_--help.golden
Aaron Lehmann 1aa9e32a2b feat: add --ssh-host-prefix flag for "coder ssh" (#16088)
This adds a flag matching `--ssh-host-prefix` from `coder config-ssh` to
`coder ssh`. By trimming a custom prefix from the argument, we can set
up wildcard-based `Host` entries in SSH config for the IDE plugins (and
eventually `coder config-ssh`).

We also replace `--` in the argument with `/`, so ownership can be
specified in wildcard-based SSH hosts like `<owner>--<workspace>`.

Replaces #16087.

Part of https://github.com/coder/coder/issues/14986.

Related to https://github.com/coder/coder/pull/16078 and
https://github.com/coder/coder/pull/16080.
2025-01-13 19:07:21 -06:00

66 lines
2.7 KiB
Plaintext

coder v0.0.0-devel
USAGE:
coder ssh [flags] <workspace>
Start a shell into a workspace
OPTIONS:
--disable-autostart bool, $CODER_SSH_DISABLE_AUTOSTART (default: false)
Disable starting the workspace automatically when connecting via SSH.
-e, --env string-array, $CODER_SSH_ENV
Set environment variable(s) for session (key1=value1,key2=value2,...).
-A, --forward-agent bool, $CODER_SSH_FORWARD_AGENT
Specifies whether to forward the SSH agent specified in
$SSH_AUTH_SOCK.
-G, --forward-gpg bool, $CODER_SSH_FORWARD_GPG
Specifies whether to forward the GPG agent. Unsupported on Windows
workspaces, but supports all clients. Requires gnupg (gpg, gpgconf) on
both the client and workspace. The GPG agent must already be running
locally and will not be started for you. If a GPG agent is already
running in the workspace, it will be attempted to be killed.
--identity-agent string, $CODER_SSH_IDENTITY_AGENT
Specifies which identity agent to use (overrides $SSH_AUTH_SOCK),
forward agent must also be enabled.
-l, --log-dir string, $CODER_SSH_LOG_DIR
Specify the directory containing SSH diagnostic log files.
--network-info-dir string
Specifies a directory to write network information periodically.
--network-info-interval duration (default: 5s)
Specifies the interval to update network information.
--no-wait bool, $CODER_SSH_NO_WAIT
Enter workspace immediately after the agent has connected. This is the
default if the template has configured the agent startup script
behavior as non-blocking.
DEPRECATED: Use --wait instead.
-R, --remote-forward string-array, $CODER_SSH_REMOTE_FORWARD
Enable remote port forwarding (remote_port:local_address:local_port).
--ssh-host-prefix string, $CODER_SSH_SSH_HOST_PREFIX
Strip this prefix from the provided hostname to determine the
workspace name. This is useful when used as part of an OpenSSH proxy
command.
--stdio bool, $CODER_SSH_STDIO
Specifies whether to emit SSH output over stdin/stdout.
--wait yes|no|auto, $CODER_SSH_WAIT (default: auto)
Specifies whether or not to wait for the startup script to finish
executing. Auto means that the agent startup script behavior
configured in the workspace template is used.
--workspace-poll-interval duration, $CODER_WORKSPACE_POLL_INTERVAL (default: 1m)
Specifies how often to poll for workspace automated shutdown.
———
Run `coder --help` for a list of global options.