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

Function newSecretsBootstrapSubcommand

pkg/cli/tokens_bootstrap.go:16–42  ·  view source on GitHub ↗

newSecretsBootstrapSubcommand creates the `secrets bootstrap` subcommand

()

Source from the content-addressed store, hash-verified

14
15// newSecretsBootstrapSubcommand creates the `secrets bootstrap` subcommand
16func newSecretsBootstrapSubcommand() *cobra.Command {
17 var engineFlag string
18 var nonInteractiveFlag bool
19
20 cmd := &cobra.Command{
21 Use: "bootstrap",
22 Short: "Analyze workflows and set up required secrets",
23 Long: `Analyze all workflows in the repository to determine which secrets
24are required, check which ones are already configured, and interactively
25prompt for any missing required secrets.
26
27Only required secrets are prompted for. Optional secrets are not shown.`,
28 Example: ` gh aw secrets bootstrap # Check and set up all required secrets
29 gh aw secrets bootstrap --non-interactive # Display missing secrets without prompting
30 gh aw secrets bootstrap --engine copilot # Check secrets for a specific engine`,
31 RunE: func(cmd *cobra.Command, args []string) error {
32 repo, _ := cmd.Flags().GetString("repo")
33 return runTokensBootstrap(engineFlag, repo, nonInteractiveFlag)
34 },
35 }
36
37 cmd.Flags().BoolVar(&nonInteractiveFlag, "non-interactive", false, "Check secrets without prompting (display-only mode)")
38 cmd.Flags().StringVarP(&engineFlag, "engine", "e", "", "Check tokens for specific engine (copilot, claude, codex, gemini, crush)")
39 addRepoFlag(cmd)
40
41 return cmd
42}
43
44func runTokensBootstrap(engine, repo string, nonInteractive bool) error {
45 tokensBootstrapLog.Printf("Running tokens bootstrap: engine=%s, repo=%s, nonInteractive=%v", engine, repo, nonInteractive)

Callers 1

NewSecretsCommandFunction · 0.85

Calls 3

runTokensBootstrapFunction · 0.85
addRepoFlagFunction · 0.85
GetStringMethod · 0.65

Tested by

no test coverage detected