MCPcopy Create free account
hub / github.com/openclaw/gogcli / Run

Method Run

internal/cmd/batch.go:103–131  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

101}
102
103func (c *BatchShowCmd) Run(ctx context.Context) error {
104 batchID := strings.TrimSpace(c.BatchID)
105 if err := validateDocsBatchIDArg(batchID); err != nil {
106 return err
107 }
108 store, err := openDocsBatchStore(ctx)
109 if err != nil {
110 return err
111 }
112 state, err := store.Get(batchID)
113 if err != nil {
114 return err
115 }
116 payload := map[string]any{
117 "batch": state,
118 "payload": docsBatchWirePayload(state, state.Requests),
119 }
120 if outfmt.IsJSON(ctx) {
121 return outfmt.WriteJSON(ctx, stdoutWriter(ctx), payload)
122 }
123
124 data, err := json.MarshalIndent(payload, "", " ")
125 if err != nil {
126 return err
127 }
128 ui.FromContext(ctx).Out().Println(string(data))
129
130 return nil
131}
132
133type BatchAbortCmd struct {
134 BatchID string `arg:"" name:"batchId" help:"Batch ID"`

Callers

nothing calls this directly

Calls 10

IsJSONFunction · 0.92
WriteJSONFunction · 0.92
FromContextFunction · 0.92
validateDocsBatchIDArgFunction · 0.85
openDocsBatchStoreFunction · 0.85
docsBatchWirePayloadFunction · 0.85
stdoutWriterFunction · 0.85
PrintlnMethod · 0.80
OutMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected