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

Function NewExperimentsListSubcommand

pkg/cli/experiments_command.go:128–154  ·  view source on GitHub ↗

NewExperimentsListSubcommand creates the experiments list subcommand.

()

Source from the content-addressed store, hash-verified

126
127// NewExperimentsListSubcommand creates the experiments list subcommand.
128func NewExperimentsListSubcommand() *cobra.Command {
129 cmd := &cobra.Command{
130 Use: "list",
131 Short: "List all experiment workflow branches",
132 Long: `List all experiment workflow branches in the repository.
133
134Reads the state.json file from each experiments/* branch and shows a summary
135of each workflow's A/B experiments: number of experiments defined, total runs,
136and timestamp of the most recent run.`,
137 Example: ` ` + string(constants.CLIExtensionPrefix) + ` experiments list # List all experiments
138 ` + string(constants.CLIExtensionPrefix) + ` experiments list --json # Output in JSON format
139 ` + string(constants.CLIExtensionPrefix) + ` experiments list --repo owner/repo # List from a specific repository`,
140 RunE: func(cmd *cobra.Command, args []string) error {
141 jsonOutput, _ := cmd.Flags().GetBool("json")
142 repoOverride, _ := cmd.Flags().GetString("repo")
143 return RunExperimentsList(ExperimentsListConfig{
144 RepoOverride: repoOverride,
145 JSONOutput: jsonOutput,
146 })
147 },
148 }
149
150 addJSONFlag(cmd)
151 addRepoFlag(cmd)
152
153 return cmd
154}
155
156// NewExperimentsAnalyzeSubcommand creates the experiments analyze subcommand.
157func NewExperimentsAnalyzeSubcommand() *cobra.Command {

Callers 2

NewExperimentsCommandFunction · 0.85

Calls 4

RunExperimentsListFunction · 0.85
addJSONFlagFunction · 0.85
addRepoFlagFunction · 0.85
GetStringMethod · 0.65

Tested by 1