Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

feat: replace coder sh implementation to shell out to ssh #292

Merged
merged 5 commits into from
Mar 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/coder.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ coder provides a CLI for working with an existing Coder Enterprise installation
* [coder images](coder_images.md) - Manage Coder images
* [coder login](coder_login.md) - Authenticate this client for future operations
* [coder logout](coder_logout.md) - Remove local authentication credentials if any exist
* [coder sh](coder_sh.md) - Open a shell and execute commands in a Coder environment
* [coder ssh](coder_ssh.md) - Enter a shell of execute a command over SSH into a Coder environment
* [coder sync](coder_sync.md) - Establish a one way directory sync to a Coder environment
* [coder tokens](coder_tokens.md) - manage Coder API tokens for the active user
* [coder urls](coder_urls.md) - Interact with environment DevURLs
Expand Down
37 changes: 0 additions & 37 deletions docs/coder_sh.md

This file was deleted.

31 changes: 31 additions & 0 deletions docs/coder_ssh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## coder ssh

Enter a shell of execute a command over SSH into a Coder environment

```
coder ssh [environment_name] [<command [args...]>]
```

### Examples

```
coder ssh my-dev
coder ssh my-dev pwd
```

### Options

```
-h, --help help for ssh
```

### Options inherited from parent commands

```
-v, --verbose show verbose output
```

### SEE ALSO

* [coder](coder.md) - coder provides a CLI for working with an existing Coder Enterprise installation

2 changes: 1 addition & 1 deletion internal/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func Make() *cobra.Command {
app.AddCommand(
loginCmd(),
logoutCmd(),
shCmd(),
sshCmd(),
usersCmd(),
tagsCmd(),
configSSHCmd(),
Expand Down
14 changes: 0 additions & 14 deletions internal/cmd/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (

"cdr.dev/coder-cli/coder-sdk"
"cdr.dev/coder-cli/internal/coderutil"
"cdr.dev/coder-cli/internal/config"
)

const sshStartToken = "# ------------START-CODER-ENTERPRISE-----------"
Expand Down Expand Up @@ -214,19 +213,6 @@ func makeSSHConfig(host, userName, envName, privateKeyFilepath string) string {
`, envName, host, userName, envName, privateKeyFilepath)
}

//nolint:deadcode,unused
func configuredHostname() (string, error) {
u, err := config.URL.Read()
if err != nil {
return "", err
}
url, err := url.Parse(u)
if err != nil {
return "", err
}
return url.Hostname(), nil
}

func writeStr(filename, data string) error {
return ioutil.WriteFile(filename, []byte(data), 0777)
}
Expand Down
Loading