MCPcopy Create free account
hub / github.com/github/gh-aw / NewSecretsCommand

Function NewSecretsCommand

pkg/cli/secrets_command.go:13–44  ·  view source on GitHub ↗

NewSecretsCommand creates the main secrets command with subcommands

()

Source from the content-addressed store, hash-verified

11
12// NewSecretsCommand creates the main secrets command with subcommands
13func 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
20This command provides tools for managing secrets required by agentic workflows, including
21AI API keys (Anthropic, OpenAI, GitHub Copilot) and GitHub tokens for workflow execution.
22
23Available 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}

Calls 4

newSecretsSetSubcommandFunction · 0.85
PrintMethod · 0.80
ErrorfMethod · 0.45