[PR #14465] cmd: improve error messages for missing model name #40563

Open
opened 2026-04-23 01:26:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14465
Author: @Anandesh-Sharma
Created: 2/26/2026
Status: 🔄 Open

Base: mainHead: fix-cli-error-messages


📝 Commits (1)

  • 938473d cmd: improve error messages for missing model name arguments

📊 Changes

1 file changed (+24 additions, -6 deletions)

View changed files

📝 cmd/cmd.go (+24 -6)

📄 Description

Summary

  • Replaces generic accepts 1 arg(s), received 0 with descriptive missing model name error for create, show, stop, pull, and push commands
  • Improves cp command to show missing source and/or destination model name instead of accepts 2 arg(s), received 0
  • Also reports extra arguments when too many args are passed

Before

$ ollama show
Error: accepts 1 arg(s), received 0

After

$ ollama show
Error: missing model name

Fixes #2893


🔄 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/14465 **Author:** [@Anandesh-Sharma](https://github.com/Anandesh-Sharma) **Created:** 2/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix-cli-error-messages` --- ### 📝 Commits (1) - [`938473d`](https://github.com/ollama/ollama/commit/938473d4a747822fd920999005489f8d2085a86f) cmd: improve error messages for missing model name arguments ### 📊 Changes **1 file changed** (+24 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+24 -6) </details> ### 📄 Description ## Summary - Replaces generic `accepts 1 arg(s), received 0` with descriptive `missing model name` error for `create`, `show`, `stop`, `pull`, and `push` commands - Improves `cp` command to show `missing source and/or destination model name` instead of `accepts 2 arg(s), received 0` - Also reports `extra arguments` when too many args are passed ### Before ``` $ ollama show Error: accepts 1 arg(s), received 0 ``` ### After ``` $ ollama show Error: missing model name ``` Fixes #2893 --- <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 01:26:10 -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#40563