Skip to content

Agent Terminal

Shell commands an agent runs, in one list: streaming output, commands waiting for your approval, exit codes, long output folded, and Re-run.

On this page

Examples

Waiting for approval

Empty

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

commands
TerminalCommand[]
The session, oldest first. { id, command, status, reason?, cwd?, output?, exitCode?, startedAt?, endedAt? }.
status
"pending" | "running" | "done" | "failed" | "denied" | "cancelled"
pending waits for a person; denied never ran. The status is shown as an icon and a word, never by colour alone.
output
string
Everything printed so far. Append to it while the command runs; the block follows the newest line until the reader scrolls up.
exitCode / startedAt / endedAt
number | null / ms / ms
Shown as an exit badge and the run time. A running command's time ticks.
reason
string
Why the agent wants to run it, shown above Approve and Deny.
onApprove / onDeny
(command) => void
Buttons appear on pending commands. Approve should start the command and set it to running.
onStop / onRerun
(command) => void
Stop shows on running commands, Re-run on finished ones. Leave one out to hide its button.
collapseAfter
number
Default12
Folds finished output longer than this behind "Show N more lines".
streamHeight
number
Default220
How tall a running command's output grows before it scrolls.
title / host / empty
string / string / ReactNode
Default"Terminal"
Panel heading, the host and directory in the header, and the empty state.
Screen readers
-
A polite live region announces a command that needs approval and one that ends, with its exit code. Output is not announced; each output region is labelled and focusable.

Output is shown with Code Block, so copy, folding and keyboard scrolling behave the same as there. The block holds no process: your app runs the commands, approves them and writes their output into commands.

When to use

When to use

  • An agent that runs shell commands, where a person follows the output and approves the risky ones.
  • A session log of commands with their exit codes, where a failed one can be run again.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Agent Terminal to my app and wire it to my own data.
  • I need an agent that runs shell commands, where a person follows the output and approves the risky ones. Set that up with the Knowns UI Agent Terminal.
  • Which Agent Terminal props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-terminal" }) and search_docs({ query: "agent terminal" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Agent Terminal, or found something off? We read every message.