mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
Added completion for ollama
Closes #10327
(cherry picked from commit 90b9bce174
)
This commit is contained in:
parent
77e2fa343d
commit
cc6df6d17f
20
share/completions/ollama.fish
Normal file
20
share/completions/ollama.fish
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
function __fish_ollama_list
|
||||||
|
ollama list 2>/dev/null | tail -n +2 | string replace --regex "\s.*" ""
|
||||||
|
end
|
||||||
|
|
||||||
|
complete -c ollama -a serve -d "Start ollama"
|
||||||
|
complete -c ollama -a create -d "Create a model from a Modelfile"
|
||||||
|
complete -c ollama -a show -d "Show information for a model"
|
||||||
|
complete -c ollama -a run -d "Run a model"
|
||||||
|
complete -c ollama -a pull -d "Pull a model from a registry"
|
||||||
|
complete -c ollama -a push -d "Push a model to a registry"
|
||||||
|
complete -c ollama -a list -d "List models"
|
||||||
|
complete -c ollama -a cp -d "Copy a model"
|
||||||
|
complete -c ollama -a rm -d "Remove a model"
|
||||||
|
complete -c ollama -a help -d "Help about any command"
|
||||||
|
complete -c ollama -s h -l help -d "help for ollama"
|
||||||
|
complete -c ollama -s v -l version -d "Show version information"
|
||||||
|
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from show'
|
||||||
|
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from run'
|
||||||
|
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from cp'
|
||||||
|
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from rm'
|
Loading…
Reference in New Issue
Block a user