shell autocompletion
Author: tetoCreated Dec 21, 2023Updated Oct 1, 2026
Labelsfeature request
hi, I would like to add shell autocompletion for ollama to my linux distribution.
I dont know go but the cli parser seems to be using https://github.com/spf13/cobra, the same as github CLI gh.
The nix package generates the autocompletion like this:
https://github.com/teto/nixpkgs/blob/dbaa028d61848fda534a04ce21459b722f0bca81/pkgs/applications/version-management/gh/default.nix#L30
so I tried ollama completion -s zsh hoping it was not shown by ollama --help because hidden but that failed.
Is there a way to generate those files currently and if yes, how, if not, could you add such a subcommand please ? makes writing commands on the prompt easier.
Source: ollama/ollama