[PR #10425] cmd: added sorting and json formatting to list and ps commands #59936

Open
opened 2026-04-29 14:51:32 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/10425
Author: @mrMalinka
Created: 4/26/2025
Status: 🔄 Open

Base: mainHead: json-feature


📝 Commits (2)

  • 2f4fc30 cmd: added sorting and json formatting to list and ps commands
  • 6c6d732 Merge branch 'main' into json-feature

📊 Changes

2 files changed (+187 additions, -22 deletions)

View changed files

📝 cmd/cmd.go (+167 -21)
📝 cmd/cmd_test.go (+20 -1)

📄 Description

addressing #1876

ollama list --json will output the list in json format, using unix timestamps and raw byte count instead of human readable format

ollama list --sortby [order] accepts name (alphabetical), size, time

same changes apply to ollama ps, except it accepts name, size, processor and until for --sortby

also added new test for this


🔄 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/10425 **Author:** [@mrMalinka](https://github.com/mrMalinka) **Created:** 4/26/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `json-feature` --- ### 📝 Commits (2) - [`2f4fc30`](https://github.com/ollama/ollama/commit/2f4fc30ca4546ce93415286dc85550fca2fc8fa3) cmd: added sorting and json formatting to list and ps commands - [`6c6d732`](https://github.com/ollama/ollama/commit/6c6d7325ecf264b4a29bb0ba22a5b928ea0ac163) Merge branch 'main' into json-feature ### 📊 Changes **2 files changed** (+187 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+167 -21) 📝 `cmd/cmd_test.go` (+20 -1) </details> ### 📄 Description addressing [#1876](https://github.com/ollama/ollama/issues/1876) `ollama list --json` will output the list in json format, using unix timestamps and raw byte count instead of human readable format `ollama list --sortby [order]` accepts `name` (alphabetical), `size`, `time` same changes apply to `ollama ps`, except it accepts `name`, `size`, `processor` and `until` for `--sortby` also added new test for this --- <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-29 14:51:32 -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#59936