Shell Completions
Sema can generate tab-completion scripts for your shell, giving you completions for all CLI flags, options, and subcommands.
sema completions <SHELL>Supported shells: bash, zsh, fish, elvish, powershell.
Zsh
macOS (with oh-my-zsh or custom fpath)
mkdir -p ~/.zsh/completions
sema completions zsh > ~/.zsh/completions/_semaMake sure your ~/.zshrc includes the directory in fpath before compinit is called:
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinitIf you use oh-my-zsh, add the fpath line before source $ZSH/oh-my-zsh.sh (oh-my-zsh calls compinit for you).
Linux
# User-local (no sudo required)
mkdir -p ~/.zsh/completions
sema completions zsh > ~/.zsh/completions/_semaAdd to ~/.zshrc (before compinit):
fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit && compinitOr install system-wide:
sudo sema completions zsh > /usr/local/share/zsh/site-functions/_semaThen restart your shell or run exec zsh.
Bash
macOS
macOS ships with an older Bash. Install bash-completion via Homebrew:
brew install bash-completion@2Then generate and install the completion script:
mkdir -p ~/.local/share/bash-completion/completions
sema completions bash > ~/.local/share/bash-completion/completions/semaLinux
# User-local
mkdir -p ~/.local/share/bash-completion/completions
sema completions bash > ~/.local/share/bash-completion/completions/sema
# Or system-wide
sudo sema completions bash > /etc/bash_completion.d/semaThen restart your shell or run source ~/.bashrc.
Fish
sema completions fish > ~/.config/fish/completions/sema.fishThis works on both macOS and Linux. Completions are picked up automatically on the next shell session.
PowerShell
# Create the completions directory if it doesn't exist
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $PROFILE)
# Append the completion script to your profile
sema completions powershell >> $PROFILERestart PowerShell to activate.
Elvish
sema completions elvish > ~/.config/elvish/lib/sema.elvThen add use sema to ~/.config/elvish/rc.elv.
Verifying
After installing, restart your shell and type sema then press Tab. You should see completions for flags and subcommands.