mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add CLI support for user secrets (#24270)
Adds a coder secret command group for managing user secrets from the CLI, with create, update, list, and delete subcommands backed by the existing user secret API. This branch adds CLI test coverage and refreshes the generated help output and CLI reference docs for the new command group.
This commit is contained in:
+3
-7
@@ -104,6 +104,7 @@ func (r *RootCmd) CoreSubcommands() []*serpent.Command {
|
||||
r.portForward(),
|
||||
r.publickey(),
|
||||
r.resetPassword(),
|
||||
r.secrets(),
|
||||
r.sharing(),
|
||||
r.state(),
|
||||
r.tasksCommand(),
|
||||
@@ -319,14 +320,9 @@ func (r *RootCmd) Command(subcommands []*serpent.Command) (*serpent.Command, err
|
||||
cmd.Walk(func(cmd *serpent.Command) {
|
||||
// TODO: we should really be consistent about naming.
|
||||
if cmd.Name() == "delete" || cmd.Name() == "remove" {
|
||||
if slices.Contains(cmd.Aliases, "rm") {
|
||||
merr = errors.Join(
|
||||
merr,
|
||||
xerrors.Errorf("command %q shouldn't have alias %q since it's added automatically", cmd.FullName(), "rm"),
|
||||
)
|
||||
return
|
||||
if !slices.Contains(cmd.Aliases, "rm") {
|
||||
cmd.Aliases = append(cmd.Aliases, "rm")
|
||||
}
|
||||
cmd.Aliases = append(cmd.Aliases, "rm")
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user