[GH-ISSUE #3106] Ollama ls not included in the -h/--help flags #48419

Closed
opened 2026-04-28 08:13:00 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @aosan on GitHub (Mar 13, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/3106

While working on a Bash completion PR, I noticed the absence of ls from the arguments list for -h/--help and ollama listing.

image

Originally created by @aosan on GitHub (Mar 13, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/3106 While working on a [Bash completion PR](https://github.com/ollama/ollama/pull/3105), I noticed the absence of ls from the arguments list for -h/--help and ollama listing. ![image](https://github.com/ollama/ollama/assets/8534160/7676b183-05e7-4f5e-8d46-25fc05e12a5e)
Author
Owner

@amila-ku commented on GitHub (Mar 14, 2024):

Quick look at code revealed it was added as an 'Alias' to list command, therefore it is not shown as an additional command. Generally it is used in Cobra to support give option to change functionality name without breaking backwards compatibility.
https://github.com/ollama/ollama/blob/main/cmd/cmd.go#L999C1-L1005C3

	listCmd := &cobra.Command{
		Use:     "list",
		Aliases: []string{"ls"},
		Short:   "List models",
		PreRunE: checkServerHeartbeat,
		RunE:    ListHandler,
	}
<!-- gh-comment-id:1996182591 --> @amila-ku commented on GitHub (Mar 14, 2024): Quick look at code revealed it was added as an 'Alias' to list command, therefore it is not shown as an additional command. Generally it is used in [Cobra](https://github.com/spf13/cobra) to support give option to change functionality name without breaking backwards compatibility. https://github.com/ollama/ollama/blob/main/cmd/cmd.go#L999C1-L1005C3 ``` listCmd := &cobra.Command{ Use: "list", Aliases: []string{"ls"}, Short: "List models", PreRunE: checkServerHeartbeat, RunE: ListHandler, } ```
Author
Owner

@pdevine commented on GitHub (Mar 14, 2024):

Hey @aosan , as @amila-ku mentioned, the command is ollama list but ls is an alias.

<!-- gh-comment-id:1998579347 --> @pdevine commented on GitHub (Mar 14, 2024): Hey @aosan , as @amila-ku mentioned, the command is `ollama list` but `ls` is an alias.
Author
Owner

@aosan commented on GitHub (Mar 15, 2024):

@pdevine this is a usability issue not a "find in the code" quest, the options menu presented to the user is incomplete. The fact that ls is an alias is a distinction without a difference. This incompleteness impacts bash_completion and future man pages.

<!-- gh-comment-id:1998744912 --> @aosan commented on GitHub (Mar 15, 2024): @pdevine this is a usability issue not a "find in the code" quest, the options menu presented to the user is incomplete. The fact that `ls` is an alias is a distinction without a difference. This incompleteness impacts bash_completion and future man pages.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#48419