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

Function newTaskInspectCommand

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

Source from the content-addressed store, hash-verified

454}
455
456func newTaskInspectCommand(deps commandDeps) *cobra.Command {
457 return &cobra.Command{
458 Use: "inspect <id>",
459 Short: "Inspect a task or run with diagnostics",
460 Args: exactOneNonBlankArg(),
461 RunE: func(cmd *cobra.Command, args []string) error {
462 client, err := clientFromDeps(deps)
463 if err != nil {
464 return err
465 }
466
467 id := strings.TrimSpace(args[0])
468 var inspect TaskInspectRecord
469 switch taskInspectTargetForID(id) {
470 case taskInspectTargetTask:
471 inspect, err = client.InspectTask(cmd.Context(), id)
472 case taskInspectTargetRun:
473 inspect, err = client.InspectRun(cmd.Context(), id)
474 default:
475 inspect = taskInspectUnknownIDRecord(id, cliNow(deps.now))
476 }
477 if err != nil {
478 return err
479 }
480 return writeCommandOutput(cmd, taskInspectBundle(&inspect))
481 },
482 }
483}
484
485func newTaskUpdateCommand(deps commandDeps) *cobra.Command {
486 var (

Callers 1

newTaskCommandFunction · 0.85

Calls 9

exactOneNonBlankArgFunction · 0.85
clientFromDepsFunction · 0.85
taskInspectTargetForIDFunction · 0.85
cliNowFunction · 0.85
writeCommandOutputFunction · 0.85
taskInspectBundleFunction · 0.85
InspectTaskMethod · 0.65
InspectRunMethod · 0.65

Tested by

no test coverage detected