ESC is a CLI to manage SSH connections and run interactive sessions or remote commands using a clean, structured configuration.
- Store SSH connections in a single HCL file.
- Aliases for long connection names.
- Execute commands across multiple hosts (optional parallel).
- List and tree view based on name segments.
- Shell completion for bash/zsh.
go install github.com/sembraniteam/esc/cmd/esc@latestgo install ./cmd/escesc add --name prod --host 10.10.10.1 --user ubuntu
esc connect prodESC stores its configuration in ~/.esc/config.hcl. The file is created automatically on first use.
Example:
settings {
timeout_seconds = 30
}
connection "prod" {
host = "127.0.0.1"
user = "ubuntu"
port = 22
auth {
type = "agent"
}
tags = ["prod", "api"]
}
connection "staging.web.main" {
host = "127.0.0.1"
user = "deploy"
port = 22
auth {
type = "key"
key_path = "/Users/you/.ssh/id_rsa"
passphrase_env = "ESC_SSH_PASSPHRASE"
}
}
connection "db" {
host = "127.0.0.1"
user = "postgres"
port = 22
auth {
type = "password"
password_env = "ESC_DB_PASSWORD"
}
}
alias "p" {
target = "prod"
}agent: use SSH agent (SSH_AUTH_SOCKmust be set).key: use a private key fromkey_path, optional passphrase frompassphrase_env.password: use password from thepassword_envenv var.
esc add --name prod.api.main --host 10.10.10.1 --user ubuntu
esc rm prod.api.main
esc mv prod.api.main prod.api.primary
esc edit prod.api.primary
esc ls
esc ls prod.*
esc tree
esc show prod.api.primary
esc connect prod.api.primary
esc exec prod.* "uptime" --parallel --limit 5esc alias add p prod.api.main
esc alias ls
esc alias rm pesc completion bash
esc completion zsh- Max 3 dot-separated segments, for example:
prod.api.main. - Each segment must be lowercase alphanumeric.
- Supported patterns for
lsandexec:*orprefix.*.