Skip to content
mercury framework
GitHub

CliPostProcessor

CliPostProcessor = (cmd, result, t) => CliResult

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

Deterministically transforms a runCli result. A plugin contributes at most one, and it runs after every allowed command of the plugin’s tool; prefix is the allowlist entry that matched ([] for --help), so the plugin decides for itself which commands it touches and passes the rest through. Can augment data, attach a display, or turn a technically-ok result into { ok: false } when the data isn’t shaped as it needs. t gives the texts of the turn’s person, for a display it renders.

string[]

string

string[]

CliResult

Translate

CliResult