Skip to content

relgap completion ​

Generate the autocompletion script for relgap for the specified shell. See each sub-command's help for details on how to use the generated script.

Usage ​

sh
relgap completion <shell>

Shells ​

ShellCommand
bashrelgap completion bash
clinkrelgap completion clink
elvishrelgap completion elvish
fishrelgap completion fish
nushellrelgap completion nushell
oilrelgap completion oil
powershellrelgap completion powershell
tcshrelgap completion tcsh
xonshrelgap completion xonsh
zshrelgap completion zsh

The global flags work with every command. The shell commands ignore --format.

bash ​

Generate the autocompletion script for the bash shell.

This script depends on the 'bash-completion' package. If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:

text
source <(relgap completion bash)

To load completions for every new session, execute once:

Linux

text
relgap completion bash > /etc/bash_completion.d/relgap

macOS

text
relgap completion bash > $(brew --prefix)/etc/bash_completion.d/relgap

You will need to start a new shell for this setup to take effect.

FlagDescriptionTypeDefaultValuesConfig keyNotes
--no-descriptionsdisable completion descriptionsbool

Generate the autocompletion script for clink. carapace, built into relgap, writes it.

Save the script as a Lua file in a clink scripts directory, such as %LOCALAPPDATA%\clink\relgap.lua:

text
relgap completion clink > %LOCALAPPDATA%\clink\relgap.lua

elvish ​

Generate the autocompletion script for elvish. carapace, built into relgap, writes it.

Add this line to ~/.config/elvish/rc.elv:

text
eval (relgap completion elvish | slurp)

fish ​

Generate the autocompletion script for the fish shell.

To load completions in your current shell session:

text
relgap completion fish | source

To load completions for every new session, execute once:

text
relgap completion fish > ~/.config/fish/completions/relgap.fish

You will need to start a new shell for this setup to take effect.

FlagDescriptionTypeDefaultValuesConfig keyNotes
--no-descriptionsdisable completion descriptionsbool

nushell ​

Generate the autocompletion script for nushell. carapace, built into relgap, writes it.

The script defines $relgap_completer. Save it, source it from config.nu and use it as the external completer (or call it from yours when the first span is relgap):

text
relgap completion nushell | save --force ~/.config/nushell/relgap.nu

# config.nu
source ~/.config/nushell/relgap.nu
$env.config.completions.external = {enable: true, completer: $relgap_completer}

oil ​

Generate the autocompletion script for oil. carapace, built into relgap, writes it.

Add this line to your oils startup file (~/.config/oils/oshrc or yshrc):

text
source <(relgap completion oil)

powershell ​

Generate the autocompletion script for powershell.

To load completions in your current shell session:

text
relgap completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command to your powershell profile.

FlagDescriptionTypeDefaultValuesConfig keyNotes
--no-descriptionsdisable completion descriptionsbool

tcsh ​

Generate the autocompletion script for tcsh. carapace, built into relgap, writes it.

Add this line to ~/.tcshrc:

text
eval `relgap completion tcsh`

xonsh ​

Generate the autocompletion script for xonsh. carapace, built into relgap, writes it.

Add this line to ~/.xonshrc:

text
exec($(relgap completion xonsh))

zsh ​

Generate the autocompletion script for the zsh shell.

If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:

text
echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions in your current shell session:

text
source <(relgap completion zsh)

To load completions for every new session, execute once:

Linux

text
relgap completion zsh > "${fpath[1]}/_relgap"

macOS

text
relgap completion zsh > $(brew --prefix)/share/zsh/site-functions/_relgap

You will need to start a new shell for this setup to take effect.

FlagDescriptionTypeDefaultValuesConfig keyNotes
--no-descriptionsdisable completion descriptionsbool

Exit codes ​

CodeMeaning
0The command finished. With --fail-on, nothing matched.
1The command failed: a read, a write, a child process or a check failed.
2Wrong usage: an unknown command or flag, a bad value or argument, an invalid config file, or a prompt with no terminal.
130Interrupted by Ctrl-C (SIGINT) or a cancelled context.

All codes are listed on the exit codes page.

Examples ​

sh
relgap completion bash > /etc/bash_completion.d/relgap
relgap completion zsh > "${fpath[1]}/_relgap"
relgap completion fish > ~/.config/fish/completions/relgap.fish