Skip to content

completions

git city completions prints a shell completion script for bash, zsh, or fish. Load it into your shell and tab-completion will fill in git-city's commands and options for you.

git city completions [bash|zsh|fish] [--install]

With no shell argument, git-city detects your current shell from the environment. If it can't tell, it asks you to name one — bash, zsh, or fish.


Print the script to standard output and load it into the current session:

source <(git city completions bash)
source <(git city completions zsh)
git city completions fish | source

To make it permanent without using --install, write the script to a file your shell loads at startup — for example ~/.local/share/bash-completion/completions/git-city for bash, a directory on your $fpath for zsh, or ~/.config/fish/completions/git-city.fish for fish.


Install automatically

--install writes the script to the conventional location for your shell and wires it into your startup file, then prints where it put it:

git city completions --install         # detect the current shell
git city completions zsh --install     # or name the shell

Open a new shell (or re-source your startup file) for it to take effect.


Options

Argument / option Meaning
shell bash, zsh, or fish. Omit it to auto-detect the current shell.
--install Write the script to its standard location and add it to your shell startup, instead of printing it.

Completion is for the git-city executable

The generated script completes git-city <TAB>. Completing through the git city subcommand form is handled by Git's own completion machinery, not by this command — so install completion for git-city and use that form for tab-completion.

Commands overview