Just copy the file and source it in your .bashrc or .zshrc.
mkdir -p ~/.bash_completions.d
wget -q -O - github.com/msbatarce/ollama_completion/raw/master/ollama_completion.bash >> ~/.bash_completions.d/ollama
echo ". ~/.bash_completions.d/ollama" >> ~/.bashrcThe script includes completions for ollama pull by querying
ollama.com using curl and a cache at
"${TMPDIR:-/tmp}/ollama_completion"
The behavior of this script can be customized by the use of the following environment variables:
QUERY_OLLAMA_LIB_ENABLED
- Controls whether to complete against
ollama pulland fetch models and tags information.
Set to0to disable.
Default: 1 (enabled)
OLLAMA_COMPLETION_GUM_CHOOSE_ENABLED
- Use gum to choose from the
available completions options interactively.
Set to0to disable.
Default: 1 (enabled)
OLLAMA_COMPLETION_CACHE_TTL_MINUTES
- Time To Live in minutes for the models and tags cache files invalidation.
Default: 10