mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
chore: add CLI command to list aibridge interceptions (#19935)
Co-authored-by: Dean Sheather <dean@deansheather.com>
This commit is contained in:
committed by
GitHub
parent
0a6ba5d51a
commit
65f2895c0d
+30
-1
@@ -128,7 +128,6 @@ func (r *RootCmd) CoreSubcommands() []*serpent.Command {
|
||||
|
||||
// Hidden
|
||||
r.connectCmd(),
|
||||
r.expCmd(),
|
||||
gitssh(),
|
||||
r.support(),
|
||||
r.vpnDaemon(),
|
||||
@@ -137,15 +136,45 @@ func (r *RootCmd) CoreSubcommands() []*serpent.Command {
|
||||
}
|
||||
}
|
||||
|
||||
// AGPLExperimental returns all AGPL experimental subcommands.
|
||||
func (r *RootCmd) AGPLExperimental() []*serpent.Command {
|
||||
return []*serpent.Command{
|
||||
r.scaletestCmd(),
|
||||
r.errorExample(),
|
||||
r.mcpCommand(),
|
||||
r.promptExample(),
|
||||
r.rptyCommand(),
|
||||
r.tasksCommand(),
|
||||
}
|
||||
}
|
||||
|
||||
// AGPL returns all AGPL commands including any non-core commands that are
|
||||
// duplicated in the Enterprise CLI.
|
||||
func (r *RootCmd) AGPL() []*serpent.Command {
|
||||
all := append(
|
||||
r.CoreSubcommands(),
|
||||
r.Server( /* Do not import coderd here. */ nil),
|
||||
r.Provisioners(),
|
||||
ExperimentalCommand(r.AGPLExperimental()),
|
||||
)
|
||||
return all
|
||||
}
|
||||
|
||||
// ExperimentalCommand creates an experimental command that is hidden and has
|
||||
// the given subcommands.
|
||||
func ExperimentalCommand(subcommands []*serpent.Command) *serpent.Command {
|
||||
cmd := &serpent.Command{
|
||||
Use: "exp",
|
||||
Short: "Internal commands for testing and experimentation. These are prone to breaking changes with no notice.",
|
||||
Handler: func(i *serpent.Invocation) error {
|
||||
return i.Command.HelpHandler(i)
|
||||
},
|
||||
Hidden: true,
|
||||
Children: subcommands,
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
// RunWithSubcommands runs the root command with the given subcommands.
|
||||
// It is abstracted to enable the Enterprise code to add commands.
|
||||
func (r *RootCmd) RunWithSubcommands(subcommands []*serpent.Command) {
|
||||
|
||||
Reference in New Issue
Block a user