@@ -205,35 +205,115 @@ func runCmd(ctx context.Context, ver, commit, buildDate string, format *printer.
205205 // We don't want to show the default value
206206 rootCmd .PersistentFlags ().Lookup ("api-token" ).DefValue = ""
207207
208+ // Add command groups for better organization
209+ rootCmd .AddGroup (& cobra.Group {ID : "database" , Title : printer .Bold ("Database management:" )})
210+ rootCmd .AddGroup (& cobra.Group {ID : "vitess" , Title : printer .Bold ("Vitess-specific commands:" )})
211+ rootCmd .AddGroup (& cobra.Group {ID : "postgres" , Title : printer .Bold ("Postgres-specific commands:" )})
212+ rootCmd .AddGroup (& cobra.Group {ID : "platform" , Title : printer .Bold ("Platform & account management:" )})
213+
208214 loginCmd := auth .LoginCmd (ch )
209215 loginCmd .Hidden = true
210216 logoutCmd := auth .LogoutCmd (ch )
211217 logoutCmd .Hidden = true
212218
213219 rootCmd .AddCommand (loginCmd )
214220 rootCmd .AddCommand (logoutCmd )
215- rootCmd .AddCommand (api .ApiCmd (ch , userAgent , headers ))
216- rootCmd .AddCommand (auditlog .AuditLogCmd (ch ))
217- rootCmd .AddCommand (auth .AuthCmd (ch ))
218- rootCmd .AddCommand (backup .BackupCmd (ch ))
219- rootCmd .AddCommand (branch .BranchCmd (ch ))
220- rootCmd .AddCommand (connect .ConnectCmd (ch ))
221- rootCmd .AddCommand (database .DatabaseCmd (ch ))
222- rootCmd .AddCommand (dataimports .DataImportsCmd (ch ))
223- rootCmd .AddCommand (deployrequest .DeployRequestCmd (ch ))
224- rootCmd .AddCommand (keyspace .KeyspaceCmd (ch ))
225- rootCmd .AddCommand (mcp .McpCmd (ch ))
226- rootCmd .AddCommand (org .OrgCmd (ch ))
227- rootCmd .AddCommand (password .PasswordCmd (ch ))
228- rootCmd .AddCommand (ping .PingCmd (ch ))
229- rootCmd .AddCommand (region .RegionCmd (ch ))
230- rootCmd .AddCommand (shell .ShellCmd (ch , sigc , signals ... ))
231- rootCmd .AddCommand (signup .SignupCmd (ch ))
232- rootCmd .AddCommand (size .SizeCmd (ch ))
233- rootCmd .AddCommand (token .TokenCmd (ch ))
234- rootCmd .AddCommand (version .VersionCmd (ch , ver , commit , buildDate ))
235- rootCmd .AddCommand (workflow .WorkflowCmd (ch ))
236- rootCmd .AddCommand (role .RoleCmd (ch ))
221+
222+ // Platform & Account Management commands
223+ apiCmd := api .ApiCmd (ch , userAgent , headers )
224+ apiCmd .GroupID = "platform"
225+ rootCmd .AddCommand (apiCmd )
226+
227+ auditlogCmd := auditlog .AuditLogCmd (ch )
228+ auditlogCmd .GroupID = "platform"
229+ rootCmd .AddCommand (auditlogCmd )
230+
231+ authCmd := auth .AuthCmd (ch )
232+ authCmd .GroupID = "platform"
233+ rootCmd .AddCommand (authCmd )
234+
235+ completionCmd := CompletionCmd ()
236+ completionCmd .GroupID = "platform"
237+ rootCmd .AddCommand (completionCmd )
238+
239+ mcpCmd := mcp .McpCmd (ch )
240+ mcpCmd .GroupID = "platform"
241+ rootCmd .AddCommand (mcpCmd )
242+
243+ orgCmd := org .OrgCmd (ch )
244+ orgCmd .GroupID = "platform"
245+ rootCmd .AddCommand (orgCmd )
246+
247+ pingCmd := ping .PingCmd (ch )
248+ pingCmd .GroupID = "platform"
249+ rootCmd .AddCommand (pingCmd )
250+
251+ regionCmd := region .RegionCmd (ch )
252+ regionCmd .GroupID = "platform"
253+ rootCmd .AddCommand (regionCmd )
254+
255+ signupCmd := signup .SignupCmd (ch )
256+ signupCmd .GroupID = "platform"
257+ rootCmd .AddCommand (signupCmd )
258+
259+ sizeCmd := size .SizeCmd (ch )
260+ sizeCmd .GroupID = "platform"
261+ rootCmd .AddCommand (sizeCmd )
262+
263+ tokenCmd := token .TokenCmd (ch )
264+ tokenCmd .GroupID = "platform"
265+ rootCmd .AddCommand (tokenCmd )
266+
267+ versionCmd := version .VersionCmd (ch , ver , commit , buildDate )
268+ versionCmd .GroupID = "platform"
269+ rootCmd .AddCommand (versionCmd )
270+
271+ // Database management commands (Both databases)
272+ backupCmd := backup .BackupCmd (ch )
273+ backupCmd .GroupID = "database"
274+ rootCmd .AddCommand (backupCmd )
275+
276+ branchCmd := branch .BranchCmd (ch )
277+ branchCmd .GroupID = "database"
278+ rootCmd .AddCommand (branchCmd )
279+
280+ databaseCmd := database .DatabaseCmd (ch )
281+ databaseCmd .GroupID = "database"
282+ rootCmd .AddCommand (databaseCmd )
283+
284+ // Vitess-specific commands
285+ connectCmd := connect .ConnectCmd (ch )
286+ connectCmd .GroupID = "vitess"
287+ rootCmd .AddCommand (connectCmd )
288+
289+ dataimportsCmd := dataimports .DataImportsCmd (ch )
290+ dataimportsCmd .GroupID = "vitess"
291+ rootCmd .AddCommand (dataimportsCmd )
292+
293+ deployRequestCmd := deployrequest .DeployRequestCmd (ch )
294+ deployRequestCmd .GroupID = "vitess"
295+ rootCmd .AddCommand (deployRequestCmd )
296+
297+ keyspaceCmd := keyspace .KeyspaceCmd (ch )
298+ keyspaceCmd .GroupID = "vitess"
299+ rootCmd .AddCommand (keyspaceCmd )
300+
301+ passwordCmd := password .PasswordCmd (ch )
302+ passwordCmd .GroupID = "vitess"
303+ rootCmd .AddCommand (passwordCmd )
304+
305+ shellCmd := shell .ShellCmd (ch , sigc , signals ... )
306+ shellCmd .GroupID = "vitess"
307+ rootCmd .AddCommand (shellCmd )
308+
309+ workflowCmd := workflow .WorkflowCmd (ch )
310+ workflowCmd .GroupID = "vitess"
311+ rootCmd .AddCommand (workflowCmd )
312+
313+ // Postgres-specific commands
314+ roleCmd := role .RoleCmd (ch )
315+ roleCmd .GroupID = "postgres"
316+ rootCmd .AddCommand (roleCmd )
237317
238318 return rootCmd .ExecuteContext (ctx )
239319}
0 commit comments