MCPcopy Create free account
hub / github.com/diillson/chatcli / cmdViewOutput

Method cmdViewOutput

cli/agent_command_blocks.go:406–415  ·  view source on GitHub ↗

cmdViewOutput shows a previously captured output in the pager.

(renderer *agent.UIRenderer, outputs []*CommandOutput, answer string)

Source from the content-addressed store, hash-verified

404
405// cmdViewOutput shows a previously captured output in the pager.
406func (a *AgentMode) cmdViewOutput(renderer *agent.UIRenderer, outputs []*CommandOutput, answer string) {
407 nStr := strings.TrimPrefix(answer, "v")
408 n, err := strconv.Atoi(nStr)
409 if err != nil || n < 1 || n > len(outputs) || outputs[n-1] == nil {
410 fmt.Println(i18n.T("agent.status.no_output_to_show"))
411 _ = a.getInput(renderer.Colorize(i18n.T("agent.status.press_enter"), agent.ColorGray))
412 return
413 }
414 _ = renderer.ShowInPager(outputs[n-1].Output)
415}
416
417// cmdSaveOutput writes a previously captured output to a temp log file.
418func (a *AgentMode) cmdSaveOutput(renderer *agent.UIRenderer, outputs []*CommandOutput, answer string) {

Callers 1

handleCommandBlocksMethod · 0.95

Calls 4

getInputMethod · 0.95
TFunction · 0.92
ColorizeMethod · 0.80
ShowInPagerMethod · 0.80

Tested by

no test coverage detected