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

Function registerAddCommandFlags

pkg/cli/add_command.go:159–204  ·  view source on GitHub ↗
(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

157}
158
159func registerAddCommandFlags(cmd *cobra.Command) {
160 // Add name flag to add command
161 cmd.Flags().StringP("name", "n", "", "Specify name for the added workflow (without .md extension)")
162
163 // Add AI flag to add command
164 addEngineFlag(cmd)
165
166 // Add repository flag to add command.
167 // Note: the repo is specified directly in the workflow path argument (e.g., "owner/repo/workflow-name"),
168 // so this flag is not read by the command. It is kept hidden to avoid breaking existing scripts
169 // that may pass --repo but should not be advertised in help text.
170 cmd.Flags().StringP("repo", "r", "", "Source repository containing workflows (owner/repo format)")
171 _ = cmd.Flags().MarkHidden("repo") // Hidden: repo is already embedded in the workflow path spec
172
173 // Add PR flag to add command (--create-pull-request with --pr as alias)
174 cmd.Flags().Bool("create-pull-request", false, "Create a pull request with the workflow changes")
175 cmd.Flags().Bool("pr", false, "Alias for --create-pull-request")
176 _ = cmd.Flags().MarkHidden("pr") // Hide the short alias from help output
177
178 // Add force flag to add command
179 cmd.Flags().BoolP("force", "f", false, "Overwrite existing workflow files without confirmation")
180
181 // Add append flag to add command
182 cmd.Flags().String("append", "", "Append extra content to the end of agentic workflow on installation")
183
184 // Add no-gitattributes flag to add command
185 cmd.Flags().Bool("no-gitattributes", false, "Skip updating .gitattributes file")
186
187 // Add workflow directory flag to add command
188 cmd.Flags().StringP("dir", "d", "", "Workflow directory (default: .github/workflows)")
189
190 // Add no-stop-after flag to add command
191 cmd.Flags().Bool("no-stop-after", false, "Remove any stop-after field from the workflow")
192
193 // Add stop-after flag to add command
194 cmd.Flags().String("stop-after", "", "Override stop-after value in the workflow (e.g., '+48h', '2025-12-31 23:59:59')")
195
196 // Add no-security-scanner flag to add command (--disable-security-scanner is kept as an undocumented alias)
197 cmd.Flags().Bool("no-security-scanner", false, "Disable security scanning of workflow markdown content")
198 cmd.Flags().Bool("disable-security-scanner", false, "Disable security scanning of workflow markdown content")
199 _ = cmd.Flags().MarkHidden("disable-security-scanner")
200
201 // Register completions for add command
202 RegisterEngineFlagCompletion(cmd)
203 RegisterDirFlagCompletion(cmd, "dir")
204}
205
206// AddWorkflows adds one or more workflows from components to .github/workflows
207// with optional repository installation and PR creation.

Callers 1

NewAddCommandFunction · 0.85

Calls 4

addEngineFlagFunction · 0.85
StringMethod · 0.45

Tested by

no test coverage detected