From 6ac2576e076aafe957dc9e1cea7636224f9f342d Mon Sep 17 00:00:00 2001 From: Richard Crowley Date: Mon, 21 Sep 2026 20:38:48 +0000 Subject: [PATCH] Name the CLI subcommand `vtctl` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Vitess transitioned some time ago from the fat `vtctl` command to the `vtctld` server and its thin `vtctldclient` client. Never will I understand that naming decision but it has deeply bothered me for longer than I've worked here. We hoisted `vtctld` up into the `pscale branch vtctld` subcommand and that similarly doesn't make sense - this is a client process, it shouldn't have the `d` suffix! So this patch makes the subcommand canonically `vtctl`, adds an alias for `vtctld` for compatibility, and fixes up usage messages and such to follow. ---- Here's a trail of bot output in case it's useful Both names resolve — vtctl directly and vtctld as an alias (usage shows the canonical vtctl path). Changes: - internal/cmd/branch/vtctld/vtctld.go — Use: "vtctl ", added Aliases: []string{"vtctld"}, and updated Short/Long to "Run vtctl commands against a branch". - internal/cmd/branch/vtctld/throttler.go — two pscale branch vtctld list-tablets next-step hints → vtctl. - internal/cmd/branch/vtctld/planned_reparent.go — pscale branch vtctld planned-reparent-shard status example → vtctl. - internal/cmd/database/throttler.go — "tablet/vtctld throttler (pscale branch vtctld throttler)" → vtctl. - AGENTS.md — "not per-DR, not tablet/vtctld" → vtctl (matches the database throttler doc text). Left alone (Vitess component or vtctldclient references): doc/api-client.md (vtctld API surface), internal/cmdutil/json_error.go ("active vtctld mutation"), and all "via vtctld", "vtctld operation", "vtctld keyspaces/workflows" strings plus vtctldclient mentions in the vtctld command package and internal/planetscale. Build passes; tests for internal/cmd/branch/vtctld, internal/cmd/database, and internal/cmdutil pass. --- AGENTS.md | 2 +- internal/cmd/branch/vtctld/planned_reparent.go | 2 +- internal/cmd/branch/vtctld/throttler.go | 4 ++-- internal/cmd/branch/vtctld/vtctld.go | 9 +++++---- internal/cmd/database/throttler.go | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index cf5e825b..f827c59f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -396,7 +396,7 @@ Caveats: ## Vitess database throttler -Database-level default for future deploy request migrations (not per-DR, not tablet/vtctld): +Database-level default for future deploy request migrations (not per-DR, not tablet/vtctl): ```bash pscale database throttler show --org --format json diff --git a/internal/cmd/branch/vtctld/planned_reparent.go b/internal/cmd/branch/vtctld/planned_reparent.go index 3723a5df..a1129605 100644 --- a/internal/cmd/branch/vtctld/planned_reparent.go +++ b/internal/cmd/branch/vtctld/planned_reparent.go @@ -33,7 +33,7 @@ func PlannedReparentShardCmd(ch *cmdutil.Helper) *cobra.Command { Both the old and new primaries must be up and running. To check on an existing operation, use the "status" subcommand: - pscale branch vtctld planned-reparent-shard status `, + pscale branch vtctl planned-reparent-shard status `, Args: cmdutil.RequiredArgs("database", "branch"), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() diff --git a/internal/cmd/branch/vtctld/throttler.go b/internal/cmd/branch/vtctld/throttler.go index 1770f3ca..3d785848 100644 --- a/internal/cmd/branch/vtctld/throttler.go +++ b/internal/cmd/branch/vtctld/throttler.go @@ -36,7 +36,7 @@ func ThrottlerStatusCmd(ch *cmdutil.Helper) *cobra.Command { Use: "status ", Short: "Get the throttler status for a single tablet", Long: "Get the throttler status for a single tablet, identified by its alias. " + - "Discover tablet aliases with `pscale branch vtctld list-tablets`.", + "Discover tablet aliases with `pscale branch vtctl list-tablets`.", Args: cmdutil.RequiredArgs("database", "branch"), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() @@ -87,7 +87,7 @@ func ThrottlerCheckCmd(ch *cmdutil.Helper) *cobra.Command { Use: "check ", Short: "Issue a throttler check against a single tablet", Long: "Issue a throttler check against a single tablet, identified by its alias. " + - "Discover tablet aliases with `pscale branch vtctld list-tablets`.", + "Discover tablet aliases with `pscale branch vtctl list-tablets`.", Args: cmdutil.RequiredArgs("database", "branch"), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() diff --git a/internal/cmd/branch/vtctld/vtctld.go b/internal/cmd/branch/vtctld/vtctld.go index 8646aa7b..7bd34145 100644 --- a/internal/cmd/branch/vtctld/vtctld.go +++ b/internal/cmd/branch/vtctld/vtctld.go @@ -7,10 +7,11 @@ import ( func VtctldCmd(ch *cmdutil.Helper) *cobra.Command { cmd := &cobra.Command{ - Use: "vtctld ", - Short: "Run vtctld commands against a branch", - Long: "Run vtctld commands against a branch. This command is only supported for Vitess databases.", - Hidden: true, + Use: "vtctl ", + Aliases: []string{"vtctld"}, + Short: "Run vtctl commands against a branch", + Long: "Run vtctl commands against a branch. This command is only supported for Vitess databases.", + Hidden: true, } cmd.AddCommand(MaterializeCmd(ch)) diff --git a/internal/cmd/database/throttler.go b/internal/cmd/database/throttler.go index 5017f1fd..1f9e16ec 100644 --- a/internal/cmd/database/throttler.go +++ b/internal/cmd/database/throttler.go @@ -23,7 +23,7 @@ func ThrottlerCmd(ch *cmdutil.Helper) *cobra.Command { This sets the default throttler for future deploy requests on the database. It is not the per-deploy-request throttler (pscale deploy-request throttler) -and not the tablet/vtctld throttler (pscale branch vtctld throttler).`, +and not the tablet/vtctl throttler (pscale branch vtctl throttler).`, } cmd.AddCommand(ThrottlerShowCmd(ch))