Autocomplete for herdr command in Fish
README.md

herdr-fish #

Fish shell autocompletion for herdr.

What it does #

Provides tab-completion for the herdr CLI in the Fish shell, with SSH host suggestions for the --remote flag sourced from your ~/.ssh/config and /etc/ssh/ssh_config.

Installation #

Copy herdr.fish into Fish's completions directory:

cp herdr.fish ~/.config/fish/completions/

The completions take effect immediately in any running Fish session, or in new sessions thereafter.

Completion coverage #

The script registers completions for the following herdr options:

Option Description
--session <name> Use or create a named persistent session
--remote <host> Attach through SSH to a remote Herdr server (offers SSH host aliases)
--remote-keybindings <mode> Choose local or server keybindings for remote attach
--no-session Run monolithically without server/client session mode
--handoff Opt into live handoff for update or remote attach
--default-config Print default configuration and exit
-h, --help Show help
-V, --version Print version and exit

SSH host sourcing #

--remote completion is populated by parsing Host entries from ~/.ssh/config and /etc/ssh/ssh_config. Wildcard (*) and negated (!) entries are filtered out, and the list is deduplicated.

OpenSSH Include directives are honored, so hosts defined in files brought in via Include (including recursive includes and ~/relative paths) also show up. Include patterns may use shell-style globs (*, ?, []). Circular or self-includes are detected and skipped.

License #

This completion script is distributed under the same terms as the Fish shell completion framework. It incorporates a substantial portion of code derived from the Fish shell completions project, which is released under the Fish shell license.

In short: free to use, modify, and redistribute, with the same freedoms and restrictions as Fish itself. See the upstream COPYING file for the full text.