[GH-ISSUE #9086] Proposal: Incremental Refactor of CLI Command Structure #5913

Open
opened 2026-04-12 17:14:59 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @pixel365 on GitHub (Feb 14, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9086

I previously submitted PR #9040 to refactor the CLI command structure by moving individual commands to separate files and improving overall organization. The goal was to enhance maintainability, readability, and ease of extending the CLI. While the PR was not accepted due to its size, I’d like to propose an incremental approach to achieving the same improvements.

Proposed Steps:
Start by moving a few commands into separate files while keeping everything functionally identical.
Gradually continue this process in small, focused PRs to avoid introducing large changes at once.
Keep the refactor minimal, without extracting everything into separate packages, to maintain familiarity with the existing structure.
This way, we can improve the CLI’s maintainability without significant disruption to the codebase. Let me know if this approach makes sense, and I’d be happy to proceed accordingly!

Benefits:
Makes the CLI easier to maintain and extend.
Reduces complexity in the main CLI file.
Minimizes risk by introducing changes gradually.
Looking forward to your thoughts! 🚀

Originally created by @pixel365 on GitHub (Feb 14, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9086 I previously submitted PR #9040 to refactor the CLI command structure by moving individual commands to separate files and improving overall organization. The goal was to enhance maintainability, readability, and ease of extending the CLI. While the PR was not accepted due to its size, I’d like to propose an incremental approach to achieving the same improvements. **Proposed Steps:** Start by moving a few commands into separate files while keeping everything functionally identical. Gradually continue this process in small, focused PRs to avoid introducing large changes at once. Keep the refactor minimal, without extracting everything into separate packages, to maintain familiarity with the existing structure. This way, we can improve the CLI’s maintainability without significant disruption to the codebase. Let me know if this approach makes sense, and I’d be happy to proceed accordingly! **Benefits:** Makes the CLI easier to maintain and extend. Reduces complexity in the main CLI file. Minimizes risk by introducing changes gradually. Looking forward to your thoughts! 🚀
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#5913