From 2a8940d9729e3cefbacd67be68778f4fc46d0ad6 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Apr 2026 11:50:53 +0200 Subject: [PATCH 1/4] Rename Available Commands to Main Commands --- cmd/cmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 014471f7638..12d80870a3a 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -77,7 +77,7 @@ func New(ctx context.Context) *cobra.Command { groups := []cobra.Group{ { ID: mainGroup, - Title: "Available Commands", + Title: "Main Commands", }, { ID: pipelines.ManagementGroupID, From d6e412bb29c10d7b27d761259c6a1fcc1a5504f2 Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Apr 2026 12:33:17 +0200 Subject: [PATCH 2/4] Update acceptance test outputs --- acceptance/bundle/debug/output.txt | 2 +- acceptance/bundle/help/bundle-deployment/output.txt | 2 +- acceptance/bundle/help/bundle-generate/output.txt | 2 +- acceptance/bundle/help/bundle/output.txt | 2 +- acceptance/cmd/unknown-subcommand/output.txt | 2 +- acceptance/cmd/workspace/secrets/output.txt | 2 +- acceptance/pipelines/databricks-cli-help/output.txt | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/acceptance/bundle/debug/output.txt b/acceptance/bundle/debug/output.txt index ce15a99bc99..c99bed3fe74 100644 --- a/acceptance/bundle/debug/output.txt +++ b/acceptance/bundle/debug/output.txt @@ -3,7 +3,7 @@ Debug information about bundles Usage: databricks bundle debug [command] -Available Commands: +Main Commands: refschema Dump all relevant fields all bundle resources states Show available state files diff --git a/acceptance/bundle/help/bundle-deployment/output.txt b/acceptance/bundle/help/bundle-deployment/output.txt index a135735cd44..6abb9e1a63a 100644 --- a/acceptance/bundle/help/bundle-deployment/output.txt +++ b/acceptance/bundle/help/bundle-deployment/output.txt @@ -19,7 +19,7 @@ After binding, the existing workspace resource will be managed by your bundle. Usage: databricks bundle deployment [command] -Available Commands: +Main Commands: bind Bind bundle-defined resources to existing resources migrate Migrate from Terraform to Direct deployment engine unbind Unbind bundle-defined resources from its managed remote resource diff --git a/acceptance/bundle/help/bundle-generate/output.txt b/acceptance/bundle/help/bundle-generate/output.txt index 97e8667ac78..7749e072688 100644 --- a/acceptance/bundle/help/bundle-generate/output.txt +++ b/acceptance/bundle/help/bundle-generate/output.txt @@ -26,7 +26,7 @@ Use --bind to automatically bind the generated resource to the existing workspac Usage: databricks bundle generate [command] -Available Commands: +Main Commands: alert Generate configuration for an alert app Generate bundle configuration for a Databricks app dashboard Generate configuration for a dashboard diff --git a/acceptance/bundle/help/bundle/output.txt b/acceptance/bundle/help/bundle/output.txt index 624e18db9ca..ac47af9d381 100644 --- a/acceptance/bundle/help/bundle/output.txt +++ b/acceptance/bundle/help/bundle/output.txt @@ -17,7 +17,7 @@ Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.htm Usage: databricks bundle [command] -Available Commands: +Main Commands: deploy Deploy bundle deployment Deployment related commands destroy Destroy deployed bundle resources diff --git a/acceptance/cmd/unknown-subcommand/output.txt b/acceptance/cmd/unknown-subcommand/output.txt index 14bd12a4755..c08281d60dd 100644 --- a/acceptance/cmd/unknown-subcommand/output.txt +++ b/acceptance/cmd/unknown-subcommand/output.txt @@ -9,7 +9,7 @@ Usage: databricks secrets [flags] databricks secrets [command] -Available Commands +Main Commands create-scope Create a new secret scope. delete-acl Delete an ACL. delete-scope Delete a secret scope. diff --git a/acceptance/cmd/workspace/secrets/output.txt b/acceptance/cmd/workspace/secrets/output.txt index bfafcb3416b..ea2b1b79baa 100644 --- a/acceptance/cmd/workspace/secrets/output.txt +++ b/acceptance/cmd/workspace/secrets/output.txt @@ -15,7 +15,7 @@ Usage: databricks secrets [flags] databricks secrets [command] -Available Commands +Main Commands create-scope Create a new secret scope. delete-acl Delete an ACL. delete-scope Delete a secret scope. diff --git a/acceptance/pipelines/databricks-cli-help/output.txt b/acceptance/pipelines/databricks-cli-help/output.txt index b5d7e4a4835..cc84911cb00 100644 --- a/acceptance/pipelines/databricks-cli-help/output.txt +++ b/acceptance/pipelines/databricks-cli-help/output.txt @@ -18,7 +18,7 @@ Usage: databricks pipelines [flags] databricks pipelines [command] -Available Commands +Main Commands deploy Deploy pipelines destroy Destroy a pipelines project dry-run Validate correctness of the pipeline's graph From 4267931e22560183e967643d486536a3cbb1e08a Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Wed, 15 Apr 2026 12:41:49 +0200 Subject: [PATCH 3/4] Revert acceptance test output to Available Commands when no grouping exists --- acceptance/bundle/debug/output.txt | 2 +- acceptance/bundle/help/bundle-deployment/output.txt | 2 +- acceptance/bundle/help/bundle-generate/output.txt | 2 +- acceptance/bundle/help/bundle/output.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/acceptance/bundle/debug/output.txt b/acceptance/bundle/debug/output.txt index c99bed3fe74..ce15a99bc99 100644 --- a/acceptance/bundle/debug/output.txt +++ b/acceptance/bundle/debug/output.txt @@ -3,7 +3,7 @@ Debug information about bundles Usage: databricks bundle debug [command] -Main Commands: +Available Commands: refschema Dump all relevant fields all bundle resources states Show available state files diff --git a/acceptance/bundle/help/bundle-deployment/output.txt b/acceptance/bundle/help/bundle-deployment/output.txt index 6abb9e1a63a..a135735cd44 100644 --- a/acceptance/bundle/help/bundle-deployment/output.txt +++ b/acceptance/bundle/help/bundle-deployment/output.txt @@ -19,7 +19,7 @@ After binding, the existing workspace resource will be managed by your bundle. Usage: databricks bundle deployment [command] -Main Commands: +Available Commands: bind Bind bundle-defined resources to existing resources migrate Migrate from Terraform to Direct deployment engine unbind Unbind bundle-defined resources from its managed remote resource diff --git a/acceptance/bundle/help/bundle-generate/output.txt b/acceptance/bundle/help/bundle-generate/output.txt index 7749e072688..97e8667ac78 100644 --- a/acceptance/bundle/help/bundle-generate/output.txt +++ b/acceptance/bundle/help/bundle-generate/output.txt @@ -26,7 +26,7 @@ Use --bind to automatically bind the generated resource to the existing workspac Usage: databricks bundle generate [command] -Main Commands: +Available Commands: alert Generate configuration for an alert app Generate bundle configuration for a Databricks app dashboard Generate configuration for a dashboard diff --git a/acceptance/bundle/help/bundle/output.txt b/acceptance/bundle/help/bundle/output.txt index ac47af9d381..624e18db9ca 100644 --- a/acceptance/bundle/help/bundle/output.txt +++ b/acceptance/bundle/help/bundle/output.txt @@ -17,7 +17,7 @@ Online documentation: https://docs.databricks.com/en/dev-tools/bundles/index.htm Usage: databricks bundle [command] -Main Commands: +Available Commands: deploy Deploy bundle deployment Deployment related commands destroy Destroy deployed bundle resources From 3239cdb1a21ce1236892665a175b7306d3fb02ba Mon Sep 17 00:00:00 2001 From: Jan Rose Date: Fri, 8 May 2026 19:08:01 +0200 Subject: [PATCH 4/4] Drop grouping when only one command group survives filtering When configureGroups filters group definitions down to a single group, fall back to Cobra's default "Available Commands:" heading instead of emitting that lone group's title. This keeps the help output consistent with commands that don't define groups at all (e.g. databricks bundle). Co-authored-by: Isaac --- acceptance/cmd/unknown-subcommand/output.txt | 2 +- acceptance/cmd/workspace/secrets/output.txt | 2 +- cmd/cmd.go | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/acceptance/cmd/unknown-subcommand/output.txt b/acceptance/cmd/unknown-subcommand/output.txt index c08281d60dd..77ef660d74e 100644 --- a/acceptance/cmd/unknown-subcommand/output.txt +++ b/acceptance/cmd/unknown-subcommand/output.txt @@ -9,7 +9,7 @@ Usage: databricks secrets [flags] databricks secrets [command] -Main Commands +Available Commands: create-scope Create a new secret scope. delete-acl Delete an ACL. delete-scope Delete a secret scope. diff --git a/acceptance/cmd/workspace/secrets/output.txt b/acceptance/cmd/workspace/secrets/output.txt index ea2b1b79baa..d0cf9312c6b 100644 --- a/acceptance/cmd/workspace/secrets/output.txt +++ b/acceptance/cmd/workspace/secrets/output.txt @@ -15,7 +15,7 @@ Usage: databricks secrets [flags] databricks secrets [command] -Main Commands +Available Commands: create-scope Create a new secret scope. delete-acl Delete an ACL. delete-scope Delete a secret scope. diff --git a/cmd/cmd.go b/cmd/cmd.go index 247d8c12264..2c1a32caa50 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -34,9 +34,18 @@ const ( ) // configureGroups adds groups to the command, only if a group -// has at least one available command. +// has at least one available command. When only one group survives +// filtering, the grouping is dropped so Cobra's default "Available +// Commands" heading is used — matching commands that don't define +// groups at all. func configureGroups(cmd *cobra.Command, groups []cobra.Group) { filteredGroups := cmdgroup.FilterGroups(groups, cmd.Commands()) + if len(filteredGroups) <= 1 { + for _, sub := range cmd.Commands() { + sub.GroupID = "" + } + return + } for i := range filteredGroups { cmd.AddGroup(&filteredGroups[i]) }