[PR #9104] Refactor: Move root command to a separate file #18130

Open
opened 2026-04-16 06:25:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/9104
Author: @pixel365
Created: 2/14/2025
Status: 🔄 Open

Base: mainHead: ref1


📝 Commits (1)

  • 105e82a Refactor: Move root command to a separate file

📊 Changes

2 files changed (+54 additions, -40 deletions)

View changed files

📝 cmd/cmd.go (+1 -40)
cmd/root.go (+53 -0)

📄 Description

This PR is the first step in an incremental approach to refactor the CLI structure. As part of this change, the root command has been moved to a separate file, helping to improve the readability and maintainability of the project.

Background:

The main goal of this change is to make it easier to extend and maintain the CLI by separating commands into individual files, starting with the root command. This is part of a larger plan, as outlined in the related issue: #9086.

Next Steps:

  • Gradually refactor other commands into separate files in subsequent PRs.

This approach minimizes the risk of large refactors and ensures that each change is small, manageable, and easy to review.


🔄 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/9104 **Author:** [@pixel365](https://github.com/pixel365) **Created:** 2/14/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ref1` --- ### 📝 Commits (1) - [`105e82a`](https://github.com/ollama/ollama/commit/105e82a13b000abc13b5e8ad1918bfc02a2fe92a) Refactor: Move root command to a separate file ### 📊 Changes **2 files changed** (+54 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `cmd/cmd.go` (+1 -40) ➕ `cmd/root.go` (+53 -0) </details> ### 📄 Description This PR is the first step in an incremental approach to refactor the CLI structure. As part of this change, the root command has been moved to a separate file, helping to improve the readability and maintainability of the project. ### **Background:** The main goal of this change is to make it easier to extend and maintain the CLI by separating commands into individual files, starting with the root command. This is part of a larger plan, as outlined in the related issue: #9086. ### **Next Steps:** - Gradually refactor other commands into separate files in subsequent PRs. This approach minimizes the risk of large refactors and ensures that each change is small, manageable, and easy to review. --- <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-16 06:25:33 -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#18130