A CLI to easily list, search and connect to SSH hosts. Sync down hosts from providers in order to get a centralized hosts configuration.
Add Homebrew Beliven tap with:
brew tap beliven-it/tap
Then install hssh
CLI with:
brew install hssh
Run hssh init
to generate config file inside ~/.config/hssh/config.yml
(works only if not exists yet) or let the CLI creating it automatically on first run (every command).
Right now the CLI supports the following providers:
Provide at least one connection string to a provider to start using the CLI. You can use more providers at the same time. Replace values as reported below.
7192789
). For GitHub is the name of the repository (eg. beliven-it/hssh
).@
and everything after it in the connection string.You can also provide a structured version of the provider configuration in the following format:
providers:
- type: gitlab
url: "https://gitlab.com/api/v4"
access_token: gpat-123456789
entity_id: 9999
subpath: "path/to/folder"
- type: gitlab
url: "https://git.my-domain.com/api/v4"
access_token: mydingpat-123444444
entity_id: 11
subpath: "path"
NOTE
You cannot have the two providers configuration in different format. Make sure to use or the structured version, or the string version.
See the man page (man fzf
) for the full list of available options and add the desired ones to the fzf_options
string inside ~/.config/hssh/config.yml
. See more about the fzf options in the official repository.
This is a complete config file example with two providers:
# HSSH configuration file
fzf_options: "-i"
providers:
- "gitlab://my_access_token:/7192789@folder"
- "github://my_access_token:/beliven-it/hssh"
Project/repository example structure with subfolder:
project/repository
└── folder
├── file1
└── file2
Project/repository example structure without subfolder:
project/repository
├── file1
└── file2
SSH host example to put inside hosts files:
Host test
Hostname 1.2.3.4
User root
Port 22
IdentityFile ~/ssh/id_rsa
To see available commands and options, run: hssh
, hssh help
, hssh --help
or hssh -h
.
Clone the repository and run inside the folder:
go mod init hssh
go mod vendor
go build -ldflags="-X hssh/cmd.Version=1.0.0"
Run ./hssh
inside the folder to test the CLI.
Please open a new issue here.
Licensed under MIT