Shell Completion

Shell Completion

goshs can install tab completion for bash, fish, and zsh directly from the binary — no external tools required.

Install

goshs --completion bash
goshs --completion fish
goshs --completion zsh

After installation goshs prints the exact command to activate completion in your current session.


Bash

Completion is installed to:

Situation Path
Regular user ~/.local/share/bash-completion/completions/goshs
Root / sudo /etc/bash_completion.d/goshs
macOS + Homebrew $(brew --prefix)/etc/bash_completion.d/goshs

Activate immediately:

source ~/.local/share/bash-completion/completions/goshs

New sessions load it automatically if the bash-completion package is installed.


Fish

Completion is installed to:

Situation Path
Regular user ~/.config/fish/completions/goshs.fish
Root / sudo /usr/share/fish/vendor_completions.d/goshs.fish
macOS + Homebrew $(brew --prefix)/share/fish/vendor_completions.d/goshs.fish

Activate immediately:

exec fish

Fish loads completions from those directories automatically in all new sessions.


Zsh

Completion is installed to:

Situation Path
Regular user ~/.local/share/zsh/site-functions/_goshs
Root / sudo /usr/local/share/zsh/site-functions/_goshs
macOS + Homebrew $(brew --prefix)/share/zsh/site-functions/_goshs

For a user install, add the following to ~/.zshrc (if not already present):

fpath=(~/.local/share/zsh/site-functions $fpath)
autoload -U compinit && compinit

Then restart your shell:

exec zsh

For Homebrew or root installs, the directory is already on the default $fpath — just run:

autoload -U compinit && compinit