Add leftovers

This commit is contained in:
Yukai Chou 2023-11-16 23:10:46 +08:00
parent 8eec3e8040
commit 5612d2864e

View file

@ -53,39 +53,39 @@ func newSSHCmd(app *App) *cobra.Command {
sshCmd := &cobra.Command{
Use: "ssh [<flags>...] [-- <ssh-flags>...] [<command>]",
Short: "SSH into a codespace",
Long: heredoc.Doc(`
The 'ssh' command is used to SSH into a codespace. In its simplest form, you can
run 'gh cs ssh', select a codespace interactively, and connect.
Long: heredoc.Docf(`
The %[1]sssh%[1]s command is used to SSH into a codespace. In its simplest form, you can
run %[1]sgh cs ssh%[1]s, select a codespace interactively, and connect.
The 'ssh' command will automatically create a public/private ssh key pair in the
~/.ssh directory if you do not have an existing valid key pair. When selecting the
The %[1]sssh%[1]s command will automatically create a public/private ssh key pair in the
%[1]s~/.ssh%[1]s directory if you do not have an existing valid key pair. When selecting the
key pair to use, the preferred order is:
1. Key specified by -i in <ssh-flags>
1. Key specified by %[1]s-i%[1]s in %[1]s<ssh-flags>%[1]s
2. Automatic key, if it already exists
3. First valid key pair in ssh config (according to ssh -G)
3. First valid key pair in ssh config (according to %[1]sssh -G%[1]s)
4. Automatic key, newly created
The 'ssh' command also supports deeper integration with OpenSSH using a '--config'
The %[1]sssh%[1]s command also supports deeper integration with OpenSSH using a %[1]s--config%[1]s
option that generates per-codespace ssh configuration in OpenSSH format.
Including this configuration in your ~/.ssh/config improves the user experience
of tools that integrate with OpenSSH, such as bash/zsh completion of ssh hostnames,
remote path completion for scp/rsync/sshfs, git ssh remotes, and so on.
Including this configuration in your %[1]s~/.ssh/config%[1]s improves the user experience
of tools that integrate with OpenSSH, such as Bash/Zsh completion of ssh hostnames,
remote path completion for %[1]sscp%[1]s/%[1]srsync%[1]s/%[1]ssshfs%[1]s, git ssh remotes, and so on.
Once that is set up (see the second example below), you can ssh to codespaces as
if they were ordinary remote hosts (using 'ssh', not 'gh cs ssh').
if they were ordinary remote hosts (using %[1]sssh%[1]s, not %[1]sgh cs ssh%[1]s).
Note that the codespace you are connecting to must have an SSH server pre-installed.
If the docker image being used for the codespace does not have an SSH server,
install it in your Dockerfile or, for codespaces that use Debian-based images,
you can add the following to your devcontainer.json:
you can add the following to your %[1]sdevcontainer.json%[1]s:
"features": {
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
}
}
`),
`, "`"),
Example: heredoc.Doc(`
$ gh codespace ssh
@ -693,7 +693,7 @@ func newCpCmd(app *App) *cobra.Command {
Use: "cp [-e] [-r] [-- [<scp flags>...]] <sources>... <dest>",
Short: "Copy files between local and remote file systems",
Long: heredoc.Docf(`
The cp command copies files between the local and remote file systems.
The %[1]scp%[1]s command copies files between the local and remote file systems.
As with the UNIX %[1]scp%[1]s command, the first argument specifies the source and the last
specifies the destination; additional sources may be specified after the first,
@ -711,7 +711,7 @@ func newCpCmd(app *App) *cobra.Command {
environment variables, and backticks. For security, do not use this flag with arguments
provided by untrusted users; see <https://lwn.net/Articles/835962/> for discussion.
By default, the 'cp' command will create a public/private ssh key pair to authenticate with
By default, the %[1]scp%[1]s command will create a public/private ssh key pair to authenticate with
the codespace inside the %[1]s~/.ssh directory%[1]s.
`, "`"),
Example: heredoc.Doc(`