[GH-ISSUE #11541] [FEATURE] add names-only flag to ollama list. #33375

Open
opened 2026-04-22 15:57:56 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @ruyrocha on GitHub (Jul 26, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/11541

Other tools, like docker and podman have a quiet flag to return only the IDs, e.g:

 ~/G/ollama (feature/list-names-only)> podman images
REPOSITORY                 TAG         IMAGE ID      CREATED      SIZE
docker.io/library/mariadb  latest      b5898e2f8654  6 weeks ago  361 MB
 ~/G/ollama (feature/list-names-only)> podman images --quiet
b5898e2f8654
 ~/G/ollama (feature/list-names-only)>

The use case behind this is to get a list of local models, so you can iterate over them without using external tools to get the names only (instead of IDs, as the names matter the most).

It's implemented on https://github.com/ollama/ollama/pull/11540 the flag names-only for ollama list command, e.g:

 ~/G/ollama (feature/list-names-only)> ./ollama list
NAME                  ID              SIZE      MODIFIED
codellama:7b-code     8df0a30bb1e6    3.8 GB    11 days ago
codegemma:2b          926331004170    1.6 GB    11 days ago
mistral:latest        6577803aa9a0    4.4 GB    11 days ago
qwen3:latest          500a1f067a9f    5.2 GB    11 days ago
qwen2.5vl:latest      5ced39dfa4ba    6.0 GB    11 days ago
gemma3:latest         a2af6cc3eb7f    3.3 GB    11 days ago
deepseek-r1:8b        6995872bfe4c    5.2 GB    11 days ago
deepseek-r1:latest    6995872bfe4c    5.2 GB    11 days ago
 ~/G/ollama (feature/list-names-only)> ./ollama list --help
List models

Usage:
  ollama list [flags]

Aliases:
  list, ls

Flags:
  -h, --help         help for list
      --names-only   Only show model names

Environment Variables:
      OLLAMA_HOST                IP Address for the ollama server (default 127.0.0.1:11434)
 ~/G/ollama (feature/list-names-only)> ./ollama list --names-only
codellama:7b-code
codegemma:2b
mistral:latest
qwen3:latest
qwen2.5vl:latest
gemma3:latest
deepseek-r1:8b
deepseek-r1:latest
 ~/G/ollama (feature/list-names-only)>
Originally created by @ruyrocha on GitHub (Jul 26, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/11541 Other tools, like `docker` and `podman` have a `quiet` flag to return only the IDs, e.g: ```shell ~/G/ollama (feature/list-names-only)> podman images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/library/mariadb latest b5898e2f8654 6 weeks ago 361 MB ~/G/ollama (feature/list-names-only)> podman images --quiet b5898e2f8654 ~/G/ollama (feature/list-names-only)> ``` The use case behind this is to get a list of local models, so you can iterate over them without using external tools to get the names only (instead of IDs, as the names matter the most). It's implemented on https://github.com/ollama/ollama/pull/11540 the flag `names-only` for `ollama list` command, e.g: ``` ~/G/ollama (feature/list-names-only)> ./ollama list NAME ID SIZE MODIFIED codellama:7b-code 8df0a30bb1e6 3.8 GB 11 days ago codegemma:2b 926331004170 1.6 GB 11 days ago mistral:latest 6577803aa9a0 4.4 GB 11 days ago qwen3:latest 500a1f067a9f 5.2 GB 11 days ago qwen2.5vl:latest 5ced39dfa4ba 6.0 GB 11 days ago gemma3:latest a2af6cc3eb7f 3.3 GB 11 days ago deepseek-r1:8b 6995872bfe4c 5.2 GB 11 days ago deepseek-r1:latest 6995872bfe4c 5.2 GB 11 days ago ~/G/ollama (feature/list-names-only)> ./ollama list --help List models Usage: ollama list [flags] Aliases: list, ls Flags: -h, --help help for list --names-only Only show model names Environment Variables: OLLAMA_HOST IP Address for the ollama server (default 127.0.0.1:11434) ~/G/ollama (feature/list-names-only)> ./ollama list --names-only codellama:7b-code codegemma:2b mistral:latest qwen3:latest qwen2.5vl:latest gemma3:latest deepseek-r1:8b deepseek-r1:latest ~/G/ollama (feature/list-names-only)> ```
GiteaMirror added the feature request label 2026-04-22 15:57:56 -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#33375