Agentic
Terminal
A shell command the agent runs, as one line: what it ran, how long it took, and how it ended. It opens to the output, which streams in with the newest line in view.
Usage
With the AI SDK
A tool result arrives only when the command exits. To stream the output while it runs, write it from the tool as a data part with the tool call's id; the AI SDK replaces a part with the same id, so the output grows in place.
With TanStack AI
Read the command from the tool-call part's input, and the output and exit code from its result once it completes.
Examples
Failed command
A non-zero exit opens the output, with terminal red kept for errors, and Retry.
Recommendations
| Guidance | Practice |
|---|---|
| Do | Pass the output as it grows and the exit code once it ends, so a failure opens on its own. Put a turn's commands next to its tool calls, in the order they ran. |
Usage boundaries
| Guidance | Boundary |
|---|---|
| Scope | The application runs the command and streams its output. Terminal shows it; it never runs anything. |
| Scope | Output renders as text with red, bold, and dim kept. Other terminal colors show as plain text, and cursor moves are dropped. |
API reference
Public props from @mizen-labs/ui. Use exported prop types for the complete TypeScript contract.
| Prop | Type | Default | Description |
|---|---|---|---|
| | — | The command as typed, shown in mono in the line. |
| | — | running while it runs; complete for exit 0, error otherwise. The output opens on its own once it starts and when the command fails. |
| | "" | Everything printed so far. Up to 16 lines show before it scrolls, the newest line stays in view unless the reader scrolls up, terminal red, bold, and dim are kept, and lines that redraw themselves keep their last state. |
| | — | The exit code of a failed command, shown in the line, and Retry under it. |
| | Measured | Seconds it ran. Measured while the component watches it run; pass it for a command from history. |