[PR #11537] [CLOSED] cmd: add shell completion support #39449

Closed
opened 2026-04-23 00:16:54 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/11537
Author: @rtzll
Created: 7/26/2025
Status: Closed

Base: mainHead: shell-completion


📝 Commits (3)

  • f69a606 cmd: add shell completion support
  • e5da2ce cmd: pre-allocate model slices in completion functions
  • 1e1a2f9 chore: remove unused func

📊 Changes

2 files changed (+90 additions, -1 deletions)

View changed files

📝 README.md (+11 -0)
📝 cmd/cmd.go (+79 -1)

📄 Description

Enable tab completion for bash, zsh, fish, and PowerShell with context-aware model suggestions. Commands like 'stop' show only running models while 'run', 'show', 'rm' suggest available models.

Resolves #925

Allows for quality of life improvements like running:

$ ollama <TAB>
 -- completions --
completion  -- Generate the autocompletion script for the specified shell
cp          -- Copy a model
create      -- Create a model
help        -- Help about any command
list        -- List models
ps          -- List running models
pull        -- Pull a model from a registry
push        -- Push a model to a registry
rm          -- Remove a model
run         -- Run a model
serve       -- Start ollama
show        -- Show information for a model
stop        -- Stop a running model

and

$ ollama rm <TAB>
 -- completions --
deepseek-r1:latest       gemma3:4b                llama3.2:latest          nomic-embed-text:latest
gemma3:1b                gemma3:latest            mistral-small:latest

🔄 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/11537 **Author:** [@rtzll](https://github.com/rtzll) **Created:** 7/26/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `shell-completion` --- ### 📝 Commits (3) - [`f69a606`](https://github.com/ollama/ollama/commit/f69a606df8e7827cfc1b079ed4d6fc6baf2b5692) cmd: add shell completion support - [`e5da2ce`](https://github.com/ollama/ollama/commit/e5da2ce1c7828c373348d4ee0c072a9a521e055c) cmd: pre-allocate model slices in completion functions - [`1e1a2f9`](https://github.com/ollama/ollama/commit/1e1a2f9d0ceed5d92e2404a046240e23ab173ade) chore: remove unused func ### 📊 Changes **2 files changed** (+90 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+11 -0) 📝 `cmd/cmd.go` (+79 -1) </details> ### 📄 Description Enable tab completion for bash, zsh, fish, and PowerShell with context-aware model suggestions. Commands like 'stop' show only running models while 'run', 'show', 'rm' suggest available models. Resolves #925 Allows for quality of life improvements like running: ``` $ ollama <TAB> -- completions -- completion -- Generate the autocompletion script for the specified shell cp -- Copy a model create -- Create a model help -- Help about any command list -- List models ps -- List running models pull -- Pull a model from a registry push -- Push a model to a registry rm -- Remove a model run -- Run a model serve -- Start ollama show -- Show information for a model stop -- Stop a running model ``` and ``` $ ollama rm <TAB> -- completions -- deepseek-r1:latest gemma3:4b llama3.2:latest nomic-embed-text:latest gemma3:1b gemma3:latest mistral-small:latest ``` --- <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-23 00:16:54 -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#39449