Skip to content

[refactor] Refactor main.go with cobra#214

Closed
xiaket wants to merge 4 commits intosipeed:mainfrom
xiaket:parse-cli-with-cobra
Closed

[refactor] Refactor main.go with cobra#214
xiaket wants to merge 4 commits intosipeed:mainfrom
xiaket:parse-cli-with-cobra

Conversation

@xiaket
Copy link
Collaborator

@xiaket xiaket commented Feb 15, 2026

Refactor main.go to use cobra, making it much more readable and maintainable.

It is to be noted that some cli behaviour has changed, for example, for some flags, main.go before refactor will do a return in the sub-command(for example, here), resulting in a exit code of 0. I would argue that this is wrong, and this PR will correct this behaviour.

@xiaket
Copy link
Collaborator Author

xiaket commented Feb 16, 2026

Happy to resolve the conflicts, but would want some confirmation that this is where we want to be.

@Leeaandrob
Copy link
Collaborator

@Zepan This PR refactors main.go using Cobra for CLI management. At +1861/-1403 lines, it's a significant restructuring of the entry point.

While Cobra is a solid choice for Go CLIs, this is a high-risk refactor that touches the core startup path. With 68+ open PRs in flight, merging this now would create conflicts for virtually every other PR that touches main.go or cmd/.

Recommendation: Defer to a stabilization window. This is good work but the timing is challenging — it should ideally land when the PR queue is smaller to minimize merge conflicts across the board.

Signed-off-by: Kai Xia <kaix+github@fastmail.com>
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
@xiaket xiaket force-pushed the parse-cli-with-cobra branch from 93ef51c to f21906c Compare February 19, 2026 10:40
Signed-off-by: Kai Xia <kaix+github@fastmail.com>
@xiaket
Copy link
Collaborator Author

xiaket commented Feb 20, 2026

Closing this as provider work is going in.

@xiaket xiaket closed this Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants