Visitar URL original
Align env commands with the CLI command guidelines (#23901) · pulumi/pulumi@435c4f3 · GitHub
Skip to content

Commit 435c4f3

Browse files
Align env commands with the CLI command guidelines (#23901)
## Summary Aligns the `env` commands with the [CLI Command Guidelines](https://app.notion.com/p/CLI-Command-Guidelines-350fdbdf1cce80b89367c16b7b421e3d): - The long verbs (`list`, `remove`, `move`) become the canonical names, with `ls`, `rm`, `delete` and `mv` kept as aliases, so existing invocations keep working. - `env edit` and `env webhook edit` gain `update`/`modify` aliases; `env schedule new` and `env webhook new` gain `create`/`setup` aliases. The same treatment for the rest of the `pulumi` command tree is in #23903. ## Test plan Covered by the existing CLI tests; usage goldens regenerated. Testdata still invokes the short forms, doubling as alias coverage. ## Changelog - [x] Changelog entry added 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent da11b64 commit 435c4f3

17 files changed

Lines changed: 49 additions & 32 deletions
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: improvement
2+
body: Align `env` commands with the CLI naming guidelines, making `list`, `remove` and
3+
`move` the canonical names with `ls`, `rm`, `delete` and `mv` kept as aliases
4+
component: cli
5+
custom:
6+
PR: "23901"

‎pkg/cmd/esc/cli/env_edit.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,10 @@ func newEnvEditCmd(env *envCommand) *cobra.Command {
4646
edit := &envEditCommand{env: env}
4747

4848
cmd := &cobra.Command{
49-
Use: "edit [<org-name>/][<project-name>/]<environment-name>",
50-
Args: cobra.MaximumNArgs(1),
51-
Short: "Edit an environment definition",
49+
Use: "edit [<org-name>/][<project-name>/]<environment-name>",
50+
Aliases: []string{"update", "modify"},
51+
Args: cobra.MaximumNArgs(1),
52+
Short: "Edit an environment definition",
5253
Long: "Edit an environment definition\n" +
5354
"\n" +
5455
"This command fetches the current definition for the named environment and opens it\n" +

‎pkg/cmd/esc/cli/env_ls.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ func newEnvLsCmd(env *envCommand) *cobra.Command {
3232
)
3333

3434
cmd := &cobra.Command{
35-
Use: "ls",
36-
Short: "List environments.",
35+
Use: "list",
36+
Aliases: []string{"ls"},
37+
Short: "List environments.",
3738
Long: "List environments\n" +
3839
"\n" +
3940
"This command lists environments. All environments you have access to will be listed.\n",

‎pkg/cmd/esc/cli/env_rm.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,10 @@ func newEnvRmCmd(env *envCommand) *cobra.Command {
4141
var yes bool
4242

4343
cmd := &cobra.Command{
44-
Use: "rm [<org-name>/][<project-name>/]<environment-name> [path]",
45-
Args: cobra.MaximumNArgs(2),
46-
Short: "Remove an environment or a value from an environment.",
44+
Use: "remove [<org-name>/][<project-name>/]<environment-name> [path]",
45+
Aliases: []string{"rm", "delete"},
46+
Args: cobra.MaximumNArgs(2),
47+
Short: "Remove an environment or a value from an environment.",
4748
Long: "Remove an environment or a value from an environment\n" +
4849
"\n" +
4950
"This command removes an environment or a value from an environment." +

‎pkg/cmd/esc/cli/env_schedule_new.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ func newEnvScheduleNewCmd(env *envCommand) *cobra.Command {
3131
)
3232

3333
cmd := &cobra.Command{
34-
Use: "new [<org-name>/][<project-name>/]<environment-name>",
35-
Short: "Create a new scheduled action on an environment.",
34+
Use: "new [<org-name>/][<project-name>/]<environment-name>",
35+
Aliases: []string{"create", "setup"},
36+
Short: "Create a new scheduled action on an environment.",
3637
Long: "[EXPERIMENTAL] Create a new scheduled action on an environment\n" +
3738
"\n" +
3839
"This command schedules a secret rotation against the environment. Use --cron to\n" +

‎pkg/cmd/esc/cli/env_tag_ls.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func newEnvTagLsCmd(env *envCommand) *cobra.Command {
3333
var output string
3434

3535
cmd := &cobra.Command{
36-
Use: "ls [<org-name>/][<project-name>/]<environment-name>",
37-
Short: "List environment tags.",
36+
Use: "list [<org-name>/][<project-name>/]<environment-name>",
37+
Aliases: []string{"ls"},
38+
Short: "List environment tags.",
3839
Long: "List environment tags\n" +
3940
"\n" +
4041
"This command lists an environment's tags.\n",

‎pkg/cmd/esc/cli/env_tag_mv.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ func newEnvTagMvCmd(env *envCommand) *cobra.Command {
2525
var utc bool
2626

2727
cmd := &cobra.Command{
28-
Use: "mv [<org-name>/][<project-name>/]<environment-name> <name> <new-name>",
29-
Args: cobra.ExactArgs(3),
30-
Short: "Move an environment tag",
28+
Use: "move [<org-name>/][<project-name>/]<environment-name> <name> <new-name>",
29+
Aliases: []string{"mv"},
30+
Args: cobra.ExactArgs(3),
31+
Short: "Move an environment tag",
3132
Long: "Move an environment tag\n" +
3233
"\n" +
3334
"This command updates a tag with the given name on the specified environment, " +

‎pkg/cmd/esc/cli/env_tag_rm.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import (
2323

2424
func newEnvTagRmCmd(env *envCommand) *cobra.Command {
2525
cmd := &cobra.Command{
26-
Use: "rm [<org-name>/][<project-name>/]<environment-name> <tag-name>",
27-
Short: "Remove an environment tag.",
26+
Use: "remove [<org-name>/][<project-name>/]<environment-name> <tag-name>",
27+
Aliases: []string{"rm", "delete"},
28+
Short: "Remove an environment tag.",
2829
Long: "Remove an environment tag\n" +
2930
"\n" +
3031
"This command removes an environment tag using the tag name.\n",

‎pkg/cmd/esc/cli/env_version_tag_ls.go‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func newEnvVersionTagLsCmd(env *envCommand) *cobra.Command {
3333
var output string
3434

3535
cmd := &cobra.Command{
36-
Use: "ls [<org-name>/][<project-name>/]<environment-name>",
37-
Short: "List tagged versions.",
36+
Use: "list [<org-name>/][<project-name>/]<environment-name>",
37+
Aliases: []string{"ls"},
38+
Short: "List tagged versions.",
3839
Long: "List tagged versions\n" +
3940
"\n" +
4041
"This command lists an environment's tagged versions.\n",

‎pkg/cmd/esc/cli/env_version_tag_rm.go‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ import (
2222

2323
func newEnvVersionTagRmCmd(env *envCommand) *cobra.Command {
2424
cmd := &cobra.Command{
25-
Use: "rm [<org-name>/][<project-name>/]<environment-name>@<tag>",
26-
Args: cobra.ExactArgs(1),
27-
Short: "Remove a tagged version.",
25+
Use: "remove [<org-name>/][<project-name>/]<environment-name>@<tag>",
26+
Aliases: []string{"rm", "delete"},
27+
Args: cobra.ExactArgs(1),
28+
Short: "Remove a tagged version.",
2829
Long: "Remove a tagged version\n" +
2930
"\n" +
3031
"This command removes the tagged version with the given name",

0 commit comments

Comments
 (0)