Skip to content
mercury framework
GitHub

CliResult

CliResult = { data: unknown; display?: ToolDisplay; ok: true; } | { error: string; exitCode?: number; ok: false; }

Defined in: types/plugin-types/index.ts:73

Result of running a CLI command, carrying two explicit channels. On success data is the model channel — the parsed JSON (or raw text) stdout the model reasons on — and the optional display is the user channel (see ToolDisplay), which never enters the model’s context. On failure error is a human/model-readable string, with the process’s exitCode when it ran and exited non-zero. Mirrors runCli’s return — @mercury-fw/cli-engine owns the runner, this owns the shape both sides agree on.