Organize CLI Commands into User Journey Groups · Entire
Grouping Commands in CLI Help Output
I know that cobra allows you to group commands so it looks clearer under the help command. What groups do you see in our CLI ?
Current Help Structure
Currently, the help renders 26 visible commands in a flat alphabetical blob. The natural clusters by user journey are as follows:
1. "Get Started"
- Commands:
enable,disable,configure,agent,plugin,status,doctor,clean
2. "Work with Sessions"
- Commands:
session,checkpoint,recap,activity,dispatch
3. "Account"
- Commands:
login,logout,auth
4. "Control Plane"
- Commands:
org,project,repo,grant,api
5. Ungrouped
- Commands:
version,labs,agent-help,help
Rationale for Grouping:
- Splitting follows persona and frequency. New users only need group 1. Daily users will typically work with group 2. Admins or platform personnel will utilize group 4.
apiis placed under the control plane as it targets core/cell APIs.- Small commands like
dispatch,activity, andrecapmay not warrant their group since they are closely related.
Implementation Notes:
- The use of
AddGroupshould follow the display order. - Each command should set
GroupID, and missing one will fall under "Additional Commands" silently. - Hidden commands do not require any group assignments.
Proposed Title:
cli: group root help output by user journey
Summary of Changes Implemented:
cmd/entire/cli/root.go: Added group ID constants, created a helper for in-group checking, and calledcmd.AddGroup(...)with four groups.- New tests in
cmd/entire/cli/root_test.goto ensure visibility and grouping are respected.
Conclusion:
- The help output now renders four titled sections, improving user navigation through the CLI commands.