Skip to main content
zerobrew provides shell completion scripts that enable tab completion for commands, subcommands, and options in your shell.

Supported Shells

Completion is available for:
  • bash
  • zsh
  • fish
  • powershell (Windows)
  • elvish

Installing Completion

Use the zb completion command to generate completion scripts for your shell.

Bash

1

Generate completion script

If the directory doesn’t exist:
2

Reload your shell

3

Test completion

Alternative: Source directly in .bashrc

Add to your ~/.bashrc:
Then reload:

Zsh

1

Generate completion script

Create completions directory if needed:
Generate the script:
2

Update .zshrc

Add the completion directory to your fpath before compinit in ~/.zshrc:
If you don’t have compinit yet, add:
3

Reload your shell

4

Test completion

Alternative: Oh My Zsh users

If you use Oh My Zsh:
Then reload:

Fish

1

Generate completion script

Create the directory if needed:
2

Reload completions

Fish automatically loads completions from ~/.config/fish/completions/. Start a new shell or run:
3

Test completion

PowerShell (Windows)

Add to your PowerShell profile:
To find your profile location:

Elvish

Add to your ~/.elvish/rc.elv:

What Gets Completed

The completion scripts provide suggestions for:

Commands

Shows:

Subcommands

Shows:

Flags and options

Shows:
Shows:

File paths

Completes file paths in the current directory.

Updating Completions

When you update zerobrew, regenerate completion scripts to get completions for new commands:
Then reload your shell.

Troubleshooting

Completions not working in bash

Ensure bash-completion is installed:
Then verify ~/.bashrc sources it:

Completions not working in zsh

Verify compinit is being called:
It should appear after your fpath modifications:
If you still have issues, rebuild the completion cache:

Completions not working in fish

Verify the file exists:
Check for syntax errors:
Reload fish config:

Completion file permissions

Ensure completion files are readable:

Manual Completion

If you prefer not to install completions permanently, you can source them temporarily:
This enables completions for the current session only.
  • zb --help - View all available commands
  • zb <command> --help - View help for a specific command