Skip to content

docs(cli): pin subcommand order in --help (#1158) - #1171

Open
sdairs wants to merge 1 commit into
claude/1159-local-clickhouse-renamefrom
claude/1158-pin-subcommand-order
Open

sdairs wants to merge 1 commit into
claude/1159-local-clickhouse-renamefrom
claude/1158-pin-subcommand-order

Conversation

@sdairs

@sdairs sdairs commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Closes #1158. Stacked on #1169.

Summary

--help lists subcommands in enum declaration order. Until now that order was just whatever order variants were added in, which is why cloud --help listed udf first. This PR pins the order for the top three levels.

Level Order
top local, cloud, skills, update, telemetry (already correct; no change)
cloud auth, org, service, postgres, query-api-endpoint, saved-query, backup, clickpipe, clickstack, udf, key, member, invitation, activity
local init, clickhouse, postgres, status, client, install, list, use, which, remove, udf
  • How it's done: whole enum variants are moved with their attributes and doc comments intact. There's no display_order, so declaration order stays the single source of truth. The diff is 123 lines added and 123 removed, and a script check confirmed the moved lines are identical before and after.
  • Skill rule: a "Subcommand order" section in the cli-help-text skill says to order variants rather than use display_order, gives the ordering rule, and notes that a test pins the order.
  • Test: cli::tests::top_level_subcommands_keep_their_help_order asserts the visible subcommand names at all three levels. It skips hidden commands and expects telemetry only when that feature is on.
  • Follow-up: ordering inside Cloud domains (for example cloud service) waits until the Split oversized Cloud domain modules into directories #1157 module splits land.

Tests

fmt, both clippy configurations, the --no-default-features check, cargo test -p clickhousectl and the Python classifier tests all pass.

🤖 Generated with Claude Code


Note

Low Risk
Help-only reordering with a regression test; no parsing, dispatch, or API behavior changes.

Overview
Pins --help subcommand lists by reordering clap enum variants (declaration order is the only control—no display_order).

cloud help now lists auth and core resources first (udf no longer appears first); local help leads with init, then ClickHouse/Postgres workflows, and pushes version tooling (install, list, use, which, remove) later.

Adds a "Subcommand order" section to the cli-help-text skill and top_level_subcommands_keep_their_help_order in cli.rs, which asserts visible subcommand names at the root, cloud, and local levels (including telemetry when enabled).

Reviewed by Cursor Bugbot for commit 2d07c19. Bugbot is set up for automated code reviews on this repo. Configure here.

@sdairs
sdairs requested a review from iskakaushik as a code owner October 30, 2026 14:47
Reorder the cloud and local command enums so help lists entry points and
main resources first, add a Subcommand order rule to the cli-help-text
skill, and pin the order at the top level, cloud and local with a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sdairs
sdairs force-pushed the claude/1158-pin-subcommand-order branch from 18cd970 to 2d07c19 Compare October 30, 2026 17:27
@sdairs
sdairs added this pull request to stack #1153 October 30, 2026 17:28

This branch has not been deployed

No deployments
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.

1 participant