managementCommand returns the prompt/skill/agent/plugin command tree with four subcommands modeled after `gh skill`: search, list, update, install.
(group, alias string, state *globalState)
| 29 | // managementCommand returns the prompt/skill/agent/plugin command tree with |
| 30 | // four subcommands modeled after `gh skill`: search, list, update, install. |
| 31 | func (a *App) managementCommand(group, alias string, state *globalState) *cobra.Command { |
| 32 | kind := groupKind(group) |
| 33 | aliases := []string{} |
| 34 | if alias != "" { |
| 35 | aliases = []string{alias} |
| 36 | } |
| 37 | cmd := &cobra.Command{ |
| 38 | Use: group, |
| 39 | Aliases: aliases, |
| 40 | Short: "Manage " + group + " configurations", |
| 41 | } |
| 42 | cmd.AddCommand(entitySearchCommand(kind)) |
| 43 | cmd.AddCommand(entityListCommand(kind)) |
| 44 | cmd.AddCommand(entityUpdateCommand(kind)) |
| 45 | cmd.AddCommand(entityInstallCommand(kind)) |
| 46 | cmd.AddCommand(entityUninstallCommand(kind)) |
| 47 | return cmd |
| 48 | } |
| 49 | |
| 50 | func groupKind(group string) entities.Kind { |
| 51 | switch group { |
no test coverage detected