[PR #4690] cobra shell completions #22104

Open
opened 2026-04-19 16:05:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/4690
Author: @nanvenomous
Created: 5/28/2024
Status: 🔄 Open

Base: mainHead: main


📝 Commits (1)

  • 161aa75 - cobra shell completions

📊 Changes

1 file changed (+38 additions, -0 deletions)

View changed files

📝 cmd/cmd.go (+38 -0)

📄 Description

This commit adds cobra shell completions under the --shell-completion <shell> which should resolve https://github.com/ollama/ollama/issues/1653

my guess was that the default completion command was removed due to "completion" being a common term in llm speak.

Works with zsh, bash, fish, and powershell

Example usage

for zsh you could

./ollama --shell-completion zsh > _ollama
sudo mv ./_ollama $(echo $fpath[1])

then you would get shell completions like so:

https://github.com/ollama/ollama/assets/43622197/0efef024-0510-4f78-a5a1-a6a11acf5166


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/4690 **Author:** [@nanvenomous](https://github.com/nanvenomous) **Created:** 5/28/2024 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (1) - [`161aa75`](https://github.com/ollama/ollama/commit/161aa75f1bf813e9944067b871e852f60869ae43) - cobra shell completions ### 📊 Changes **1 file changed** (+38 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+38 -0) </details> ### 📄 Description This commit adds cobra shell completions under the `--shell-completion <shell>` which should resolve https://github.com/ollama/ollama/issues/1653 my guess was that the default `completion` command was removed due to "completion" being a common term in llm speak. Works with `zsh`, `bash`, `fish`, and `powershell` ### Example usage for zsh you could ```bash ./ollama --shell-completion zsh > _ollama sudo mv ./_ollama $(echo $fpath[1]) ``` then you would get shell completions like so: https://github.com/ollama/ollama/assets/43622197/0efef024-0510-4f78-a5a1-a6a11acf5166 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 16:05:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#22104