cmd_output
Read plain-text output from a command run with line numbers, paging from a chosen line or filtering by text; check status and total lines, and call again while it is still running.
Instructions
Reads the output of one command run as plain text with line numbers (colours removed), finished or still running. Three ways: no options = the last 150 lines; fromLine (+ lines) = a window starting at that line; grep = only the lines that contain that text, with their line numbers (100 by default). The header gives the run's status and the total line count, so you can page with fromLine; at most 500 lines per call, and a very long reply is cut to the size limit. A run that is still going says so: call again for newer lines. WHEN TO USE: you need more than the last lines a cmd_* result or cmd_wait showed, such as the first compiler error or a whole test failure. To wait for the run to end use cmd_wait; to find a run id use cmd_list. An unknown run id is an error.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"runId": "<runId>"
},
"name": "cmd_output"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grep | No | Optional: plain text, not a pattern; only lines that contain it are shown, any letter case. Example: 'error CS', 'FAILED'. | |
| guide | No | true: put the commands guide first in the result. Use on your first commands call, or when told it changed. | |
| lines | No | Optional: how many lines (default 150, or 100 with grep; 1 to 500). | |
| runId | Yes | The run number from a cmd_* result or cmd_list, for example 12. | |
| fromLine | No | Optional: first line to show (1-based). Omit for the last lines. Ignored with grep. |