Skip to content
docsv0.2.0

CliRenderer

Renderer for CLI channel. Transforms ToolResult into CLI-friendly output using Symfony Console formatting.

CliRenderer::supports()

public function supports(string $channel): bool

Check whether this renderer handles the given channel (CLI only).

Parameters

Parameters of supports()
NameTypeDescription
$channelstring

CliRenderer::render()

public function render(Milpa\ToolRuntime\ToolResult $result, ?Milpa\ToolRuntime\Contracts\ToolContext $ctx = null): string

Render a ToolResult as Symfony-Console-formatted text, dispatching by result type (list, detail, confirmation, blocked, error, or a generic fallback).

Parameters

Parameters of render()
NameTypeDescription
$resultMilpa\ToolRuntime\ToolResult
$ctx?Milpa\ToolRuntime\Contracts\ToolContext