Shell Completion
LocalAI provides shell completion support for bash, zsh, and fish shells. Once installed, tab completion works for all CLI commands, subcommands, and flags.
Generating Completion Scripts
Use the completion subcommand to generate a completion script for your shell:
Installation
Bash
Add the following to your ~/.bashrc:
Or install it system-wide:
Zsh
Add the following to your ~/.zshrc:
Or install it to a completions directory:
If shell completions are not already enabled in your zsh environment, add the following to the beginning of your ~/.zshrc:
Fish
Or install it permanently:
Usage
After installation, restart your shell or source your shell configuration file. Then type local-ai followed by a tab to see available commands:
Tab completion also works for subcommands and flags: