NewSecretsCommand creates the main secrets command with subcommands
()
| 11 | |
| 12 | // NewSecretsCommand creates the main secrets command with subcommands |
| 13 | func NewSecretsCommand() *cobra.Command { |
| 14 | secretsCommandLog.Print("Creating secrets command with subcommands") |
| 15 | cmd := &cobra.Command{ |
| 16 | Use: "secrets", |
| 17 | Short: "Manage GitHub Actions secrets for agentic workflows", |
| 18 | Long: `Manage GitHub Actions secrets for agentic workflows. |
| 19 | |
| 20 | This command provides tools for managing secrets required by agentic workflows, including |
| 21 | AI API keys (Anthropic, OpenAI, GitHub Copilot) and GitHub tokens for workflow execution. |
| 22 | |
| 23 | Available subcommands: |
| 24 | - set - Create or update individual secrets |
| 25 | - bootstrap - Validate and configure all required secrets for workflows`, |
| 26 | Example: ` gh aw secrets set MY_SECRET --value "secret123" # Set a secret directly |
| 27 | gh aw secrets bootstrap # Check all required secrets`, |
| 28 | Args: func(cmd *cobra.Command, args []string) error { |
| 29 | if len(args) > 0 { |
| 30 | return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath()) |
| 31 | } |
| 32 | return nil |
| 33 | }, |
| 34 | RunE: func(cmd *cobra.Command, args []string) error { |
| 35 | return cmd.Help() |
| 36 | }, |
| 37 | } |
| 38 | |
| 39 | // Add subcommands |
| 40 | cmd.AddCommand(newSecretsSetSubcommand()) |
| 41 | cmd.AddCommand(newSecretsBootstrapSubcommand()) |
| 42 | |
| 43 | return cmd |
| 44 | } |