Add descriptions and tags to SSH config
masterYou can enhance the zsh-ssh completion interface by adding metadata to your ~/.ssh/config file:
- Descriptions: Use
#_Descfollowed by text to provide a human-readable description for a host. This will appear in the completion list. - Tags: Use the OpenSSH
Tagdirective to group hosts. When any host in your config has aTag,zsh-sshdisplays aTagcolumn in the completion UI.
Searching/Filtering by Tag:
- You can type the tag name directly into the
fzfprompt to filter hosts. - You can use the syntax
ssh tag:<tag_name><Tab>to filter the completion list before thefzfinterface opens.
# ~/.ssh/config
Host Bastion-Host
Hostname 1.1.1.1
User sunlei
#_Desc For Bastion access
Host Work-Bastion
Hostname bastion.example.com
User deploy
Tag work
#_Desc Bastion host
Host Home-NAS
Hostname 192.168.1.20
User root
Tag personal
#_Desc NAS