Shells

Where each completion script is installed, and how to do it by hand.

oboro completions <shell> --install writes the script where the shell reads it. Where the shell cannot find that file on its own, it adds a managed block to your shell’s configuration:

# >>> oboro completions >>>
# <<< oboro completions <<<

Re-running replaces that block. --uninstall removes it, and nothing else. --dry-run reports every path either would touch, and touches none of them.

Leave the shell out, and Oboro takes it from $SHELL:

oboro completions --install

An install already in place stays where it is

Each table below says where a first install goes. Once a script is on disk, --install updates that same file, even when the machine has since gained oh-my-zsh, Homebrew, or bash-completion, and a first install would now choose somewhere else. Oboro removes copies in the other locations it knows about on the way, so nothing is left behind to shadow the file that is kept.

To move an install, remove it and install again:

oboro completions zsh --uninstall
oboro completions zsh --install

bash

What Where
Installed to $XDG_DATA_HOME/bash-completion/completions/oboro when that directory exists, otherwise $XDG_DATA_HOME/oboro-completions/oboro.bash
Configuration None in the first case, a source line in ~/.bashrc in the second

$XDG_DATA_HOME defaults to ~/.local/share.

Manual install:

mkdir -p ~/.local/share/bash-completion/completions
oboro completions bash > ~/.local/share/bash-completion/completions/oboro

zsh

What Where
Installed to The first that applies: $ZSH_CUSTOM/completions/_oboro under oh-my-zsh, $HOMEBREW_PREFIX/share/zsh/site-functions/_oboro under Homebrew, otherwise ~/.zfunc/_oboro
Configuration None in the first two cases, an fpath line in ~/.zshrc followed by compinit in the third

zsh loads completion functions from the directories on fpath, and only once compinit has run. zsh has no per-user directory of its own on that list. That is why the destination depends on what else is installed. Note the leading underscore in the filename. Without it, zsh never reads the file.

oh-my-zsh already puts $ZSH_CUSTOM/completions on fpath and calls compinit itself, both while ~/.zshrc is still sourcing it. Anything appended below that runs too late to matter. So the file goes there, and your configuration is left alone. $ZSH_CUSTOM defaults to ~/.oh-my-zsh/custom. Oboro follows it only when it points inside your home directory.

Homebrew’s own shell setup puts $HOMEBREW_PREFIX/share/zsh/site-functions on fpath for the same reason. So a file written there also needs no configuration. Oboro uses it only when that directory already exists and you can write to it, and never with sudo.

Otherwise the file goes to ~/.zfunc, and the managed block adds that directory to fpath and calls compinit -i. It has to be -i, not -C. -C omits the check for new completion functions and reuses the existing dump. By the time the block runs, your own compinit has usually already written that dump, which would leave _oboro unseen.

Alongside those three, Oboro finds and cleans up $XDG_DATA_HOME/zsh/site-functions/_oboro, since an earlier version of these instructions pointed there.

Manual install:

mkdir -p ~/.zfunc
oboro completions zsh > ~/.zfunc/_oboro
fpath=(~/.zfunc $fpath)
autoload -Uz compinit && compinit -i

fish

What Where
Installed to $XDG_CONFIG_HOME/fish/completions/oboro.fish
Configuration None

fish autoloads that directory, so there is nothing to add to config.fish.

Manual install:

mkdir -p ~/.config/fish/completions
oboro completions fish > ~/.config/fish/completions/oboro.fish

elvish

What Where
Installed to $XDG_CONFIG_HOME/elvish/lib/oboro.elv
Configuration use oboro in ~/.config/elvish/rc.elv

The script is inert until it is used, so the file alone does not finish the job.

Manual install:

mkdir -p ~/.config/elvish/lib
oboro completions elvish > ~/.config/elvish/lib/oboro.elv
use oboro

PowerShell

What Where
Installed to Nothing on disk
Configuration The line below in the file $PROFILE names

PowerShell evaluates the script, rather than reading it from a completions directory. So --install has nothing to write, and says so.

oboro completions powershell | Out-String | Invoke-Expression

Because it is regenerated at every session, it can never go stale. That is why doctor does not report on it.

Keeping them current

A completion script is a copy of the command surface from the moment it was generated. So an upgrade that adds a command leaves it offering the old set.

oboro doctor

Oboro regenerates every script it finds, and compares it byte for byte against this binary. So current and stale are measured, not guessed. A stale line is followed by the command that rewrites it. The installer says the same, at the moment a new version lands.

Back to top