MCPcopy Create free account
hub / github.com/compozy/agh / newTaskRunStartCommand

Function newTaskRunStartCommand

internal/cli/task.go:2496–2520  ·  view source on GitHub ↗
(deps commandDeps)

Source from the content-addressed store, hash-verified

2494}
2495
2496func newTaskRunStartCommand(deps commandDeps) *cobra.Command {
2497 var idempotencyKey string
2498
2499 cmd := &cobra.Command{
2500 Use: "start <run-id>",
2501 Short: "Start a claimed task run",
2502 Args: exactOneNonBlankArg(),
2503 RunE: func(cmd *cobra.Command, args []string) error {
2504 client, err := clientFromDeps(deps)
2505 if err != nil {
2506 return err
2507 }
2508
2509 run, err := client.StartTaskRun(cmd.Context(), args[0], StartTaskRunRequest{
2510 IdempotencyKey: strings.TrimSpace(idempotencyKey),
2511 })
2512 if err != nil {
2513 return err
2514 }
2515 return writeCommandOutput(cmd, taskRunBundle(run))
2516 },
2517 }
2518 cmd.Flags().StringVar(&idempotencyKey, "idempotency-key", "", "Optional idempotency key")
2519 return cmd
2520}
2521
2522func newTaskRunAttachSessionCommand(deps commandDeps) *cobra.Command {
2523 var sessionID string

Callers 1

newTaskRunCommandFunction · 0.85

Calls 5

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
writeCommandOutputFunction · 0.85
taskRunBundleFunction · 0.85
StartTaskRunMethod · 0.65

Tested by

no test coverage detected