Skip to content

Agent CLI

A coding agent's terminal session, replayed from a script of run events or shown still: the prompt typed in, thinking, tool calls with folded output and inline diffs, a todo checklist, a numbered permission prompt and the status line, in eight looks close to the CLIs people use. Built for people who make plugins and tools for those CLIs and want to show them in place.

On this page
Used for
  • Showing how your CLI plugin or tool looks inside a coding agent
  • A product page that shows the agent at work
  • Replaying a real run from your traces
  • Docs and changelog demos
  • Onboarding that walks through one task

Examples

Look
Last prompt

Not affiliated with or endorsed by the makers of the tools these looks are named after. The agent marks only label who is running. Portions adapted from MIT-licensed projects; see THIRD_PARTY_NOTICES.md.

Installation

npx knowns-ui@latest add agent-cli
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

One frame

Pass `time` and no controls for a still: a screenshot, a poster frame or a capture that steps the clock by hand. The same time always draws the same frame.

For plugin authors

Quillo is a made-up runbook plugin. Its tool, `Quillo.search`, prints a result view of its own; its slash command, `/quillo`, sits in the menu with a description; its status segment says the index is ready. Pass `entries` for a still screen: no timeline, so no replay controls. The same entries in every look:

Or build the screen from the parts. Each one follows the look of the CliFrame around it, and a part on its own draws its own surface.

Props

steps
ScriptStep[]
The session: { at, event } in ms from the start. Events are run-store events (span.start and span.end for tool calls, task.start and task.end for todos, approval.request for a prompt, with the id of the call it gates) and terminal events: session, prompt, think, say, output, diff, todos, status, approval.pick. sequence() lays them end to end.
entries
CliEntry[]
A still session instead of steps: { kind: "user" | "say" | "think" | "note", text } and { kind: "tool", tool, args, state, output, summary, error, result, diff, permission, children }. No timeline, so the replay controls hide.
session
StillSession
For entries: agent, model, cwd, mode, tokens, cost, todos and a waiting permission prompt.
input
string
What the input holds in a still session. "/qu" shows the slash menu open on it.
preset
"neutral" | "claude-like" | "codex-like" | "grok-like" | "opencode-like" | "antigravity-like" | "hermes-like" | "pi-like"
Default"neutral"
The look: layout, glyphs, words and colours. Override any --cli-* variable through style for your own colours.
agentMark
ReactNode
Defaultmodel logo or a terminal glyph
The small mark beside the agent's name in the header.
time / defaultTime
number / number | "end"
Default0
Controlled or starting replay time in ms.
onTimeChange
(time) => void
Every clock tick and seek.
playing / onPlayingChange
boolean / (playing) => void
Defaultfalse
Controlled playing state.
autoPlay
boolean | "in-view"
Defaultfalse
Play at mount, or once half of it is on screen. With reduced motion it shows the last frame instead.
speed / defaultSpeed / onSpeedChange
number
Default1
Replay speed. The controls offer 0.5x, 1x, 2x and 4x.
controls
boolean
Defaulttrue
Play, seek, time and speed under the terminal.
onApprove
(id, choice) => void
A prompt was answered, by a person or the script: "once", "session" or "deny".
onSubmit
(text) => void
A line sent from the input after the replay. Without it, and without onCommand, the input is read only.
onCommand
(name) => void
A command taken from the slash menu. Without it, it goes to onSubmit as /name.
commands
{ name, description }[]
DefaultDEFAULT_COMMANDS
The slash menu: yours, with the defaults spread in if you want them.
statusSegments
StatusSegment[] | (view, defaults) => StatusSegment[]
Defaultmodel, tokens, cost, mode
The status line: { id, label, tone, badge, wide }. The function form adds yours to the session's own.
renderResult
(tool: ToolView) => ReactNode
Your own view under a replayed tool call, from the span's input and output (tool.input, tool.data).
modes / onModeChange
string[] / (mode) => void
Shift+Tab in the input cycles the mode shown in the status line.
run
AgentRun
Mirror the replay into a run for other views. A seek back resets it.
collapseAfter
number
Default4
Lines of tool output before +N lines.
height
number | "auto"
Default440
Transcript height in px: it scrolls and follows the newest line unless you scroll up. "auto" fits the transcript.
placeholder
string
Defaultthe look's own
The input's placeholder. Each look has its own ("Ask Codex to do anything", a "Try ..." line), else "Ask, or / for commands".

Parts

One install, npx knowns-ui add agent-cli, brings every part. Each is a named import from the same file, so a plugin can take one alone: import { CliToolCall } from "@/components/knowns/agent-cli/agent-cli". A part outside a CliFrame draws its own surface in the look you pass; inside one it follows the frame.

CliHeader
preset, agent, model, cwd, mark, meta, version, user, org, tips, whatsNew, headline, subhead, menu, commands, logo, shimmer
The look's header. Named per look: NeutralHeader, ClaudeHeader, CodexHeader, GrokHeader, OpencodeHeader, AntigravityHeader, HermesHeader, PiHeader.
PixelSprite / DotMark / BlockWordmark / AntigravityBlockMark / PiBlockMark / HermesWordmark / HermesHero / AntigravityMark
scale, shimmer (DotMark), className
The launch marks, for a header's logo slot or on their own.
CliFrame
preset, agent, model, cwd, mark, meta, welcome, time
The surface and the look's header (a CliHeader). Every part inside follows its preset.
CliMessage
role: "user" | "agent" | "note", text, streaming
A line of the conversation. Backticks in agent text mark code.
CliThinking / CliWorking
elapsed, done, text
Thinking with its time, and the busy line of a turn.
CliToolCall
tool, args, state, output, summary, error, result, diff, permission, children
Any tool, in the look's grammar. result is your own node; children are nested calls.
CliDiff
path, before / after or patch, maxRows
A change, numbered, added and removed.
CliTodos
items: { title, state }[], title
The plan as a checklist.
CliPermission
tool, title, detail, onPick, autoFocus
The numbered prompt: 1-3 or y, a, n pick; the arrows move; Escape says no.
CliPrompt
value, onSubmit, onCommand, commands, placeholder, readOnly
The input with its slash menu. A still value such as "/qu" shows the menu open.
CliStatus
segments, hints, statusLines, aside
The status line, or a bar with the mode as a badge in some looks. statusLines adds rows of your own (off by default); aside sits at the right of the hint row.

CliHeader

The top of the session in the look's grammar. Each look also has a named one: NeutralHeader, ClaudeHeader, CodexHeader, GrokHeader, OpencodeHeader, AntigravityHeader, HermesHeader and PiHeader.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
agent / model / cwd
string
Who is running, on which model, in which folder.
mark
ReactNode
Defaulta terminal glyph
The small mark beside the name in a header line.
meta
ReactNode
The right side of the grok-like header line.
product / version
string
Defaultthe agent / per look
The product name and version in the box or card.
user / org / tips / whatsNew
string / string / string[] / string[]
Defaultmade-up defaults
The claude-like welcome box: pass user, tips or whatsNew to open it; without them the header is three lines beside the sprite. org also sits after the model there.
headline / subhead / menu
string / string / { label, keys, onSelect }[]
Defaultmade-up defaults
The grok-like launch card; headline and subhead also fill the antigravity-like news rail and the codex-like greeting.
commands
{ name, description, keys }[]
Defaultper look
The codex-like command list, the hermes-like toolsets, the pi-like keys; opencode-like lists none unless you pass some.
logo
ReactNode
Defaultthe look's own mark
The large mark: PixelSprite, DotMark, BlockWordmark, AntigravityBlockMark, PiBlockMark, HermesWordmark or your own. For hermes-like it replaces the banner and the hero.
provider / branch / permissions
string
Defaultmade-up defaults
The provider after the model in the opencode-like box; the branch beside the folder (opencode-like, grok-like); the codex-like permissions line.
shimmer
boolean
Defaultfalse
A slow grey sweep across the grok-like mark. Still under reduced motion.

CliMessage

A line of the conversation: what you typed, what the agent said, or a note.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
role
"user" | "agent" | "note"
Who says it.
text
string
The words. Backticks in agent text mark code.
streaming
boolean
Defaultfalse
A caret at the end while it streams.
tone
"muted" | "warn"
Default"muted"
A note's colour.

CliThinking

The agent thinking, then how long it thought and a one-line gist.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
elapsed
number
Ms thought so far, or in all.
done
boolean
Defaultfalse
Finished: the time and the gist instead of the spinner.
text
string
The gist, once done.

CliWorking

The busy line while a turn runs.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
elapsed
number
Ms since the turn started.

CliToolCall

Any tool, in the look's grammar, with its output folded, a result of your own and nested calls.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
tool / args
string
Any name (Read, Bash, MyPlugin.search) and what it was called with.
state
"waiting" | "running" | "done" | "failed" | "denied"
Default"done"
Where the call is.
output / streaming
string / boolean
Its output, folded after collapseAfter lines; streaming shows the newest lines.
summary / error
string
The one-line result, or what went wrong.
result
ReactNode
Your own view under the call.
diff
{ path, before, after } | { path, patch }
A change under the call.
permission
"once" | "session" | "deny"
How the call was allowed.
collapseAfter
number
Default4
Lines before +N lines.
children
ReactNode
Nested calls.

CliDiff

A change as the look prints it: numbered rows, added and removed, the changed span marked.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
path
string
The file.
before / after
string
The file's text before and after.
patch
string
A unified patch instead.
maxRows
number
Default14
Rows before +N lines.

CliTodos

The agent's plan as a checklist, in the look's glyphs.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
items
{ id?, title, state?: "pending" | "active" | "done" | "failed" }[]
The plan.
title
string
Defaultthe look's word
The heading.

CliPermission

The prompt that asks before a tool runs. 1-3 or y, a, n pick; the arrows move; Escape says no.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
tool
string
The tool asking: its name goes into the session choice.
title / detail
string
What it wants to do, and the command or change as is.
onPick
(choice: "once" | "session" | "deny") => void
The answer.
pressed
"once" | "session" | "deny"
A choice shown as pressed (a scripted answer about to land).
autoFocus
boolean
Defaultfalse
Take focus on mount, for keyboard answers.

CliPrompt

The input with its slash-command menu. A still value such as "/he" shows the menu open.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
value / defaultValue / onValueChange
string
Default""
The text, controlled or not.
onSubmit / onCommand
(text) => void / (name) => void
A line sent, a command taken. Without either the prompt is read only.
commands
{ name, description }[]
DefaultDEFAULT_COMMANDS
The slash menu.
placeholder / readOnly / caret
string / boolean / boolean
The placeholder, read only, and a block caret after the text.
model / mode / modes / onModeChange
string / string / string[] / (mode) => void
Shown where the look prints them; Shift+Tab cycles modes.

CliStatus

The status line under the input: the look's hints, then your segments.

Look
preset
AgentCliPreset
Defaultthe frame's, else "neutral"
The look. Inside a CliFrame the part follows the frame; alone it draws its own surface.
segments
{ id, label, tone?, badge?, wide? }[]
Left to right: the session's, a plugin's own.
hints
ReactNode | false
Defaultthe look's own
Key hints; false hides them.
statusLines
ReactNode[]
Rows of your own under the segments, such as a custom status line's meters. Off by default.
aside
ReactNode
The right end of the hint row: a warning count, a key to view them.

Headers

Each look has its own header, exported under its own name. A named header is CliHeader with the preset fixed, so it takes the same props. Alone it draws its own surface.

NeutralHeader

The neutral look's header: one bar with the name, model and folder. The same as <CliHeader preset="neutral" />.

ClaudeHeader

The claude-like opening: the pixel sprite beside three lines, bold name and version, model and plan, folder. Pass user, tips or whatsNew for the full welcome box. The same as <CliHeader preset="claude-like" />.

CodexHeader

The codex-like opening: >_ with the bold name and version, the folder under it, then the permissions line. Pass commands for a list under it. The same as <CliHeader preset="codex-like" />.

GrokHeader

The grok-like opening: branch and folder on top, then a card with the braille dot mark, name and version, news and a menu with its keys, and a tip under it. The same as <CliHeader preset="grok-like" />.

OpencodeHeader

The opencode-like launch screen: the block wordmark in the middle, the prompt box under it with the keys, then folder and branch, MCP and version along the bottom. Inside a CliFrame the frame's own prompt is the box. The same as <CliHeader preset="opencode-like" />.

AntigravityHeader

The antigravity-like launch screen: the half-block mark beside name and version, account, model and folder, then a news rail. The same as <CliHeader preset="antigravity-like" />.

HermesHeader

The hermes-like opening: the block-letter banner, then the panel with the braille hero, model and folder beside the toolsets. The same as <CliHeader preset="hermes-like" />.

PiHeader

The pi-like opening lines: the two-line block mark with the version beside its first line and the keys beside its second, then the startup hints. The same as <CliHeader preset="pi-like" />.

Accessibility

  • A polite live region reads finished answers, tool calls as they end and a prompt that needs you, never single characters of typing or streaming.
  • The permission prompt is a listbox: 1, 2 and 3 (or y, a and n) pick, the arrows or j and k move, Enter or Space picks the highlighted choice and Escape denies. It takes focus only when focus was already inside the session.
  • The input is a combobox for the slash menu: the arrows move, Enter or Tab take a command, Escape closes the menu.
  • The transcript is a focusable scroll region; each sent prompt starts with "You:" for screen readers. Todos read their state after the title.
  • Play, seek and speed are a button, a slider and a radio group, all on the keyboard. Spinners step with the replay clock, so pausing stops them.

What it handles

  1. 01Replays a coding agent's terminal session from a script of run events: the prompt typed in, thinking with its time, tool calls with their output folded, inline diffs, a todo checklist and the status line.
  2. 02Plays, pauses, seeks and changes speed on a virtual clock. Every frame comes from the time alone, so a paused, sought or captured frame is always the same.
  3. 03Stops at a permission prompt nobody answered until someone picks 1, 2 or 3. Allow for the session skips the next prompt for that tool; Deny ends the script there.
  4. 04Mirrors what it has played into an AgentRun, so a tree, a trace or an approvals list beside it follows the same session.
  5. 05Takes over the input once the replay ends: send a line, or type / for a filtered command menu.
  6. 06Shows a still session from a plain list of entries, with no timeline and no replay controls.

States

First render
The frame at defaultTime; nothing plays until play, autoPlay or a time you pass
none
Replaying
Prompts type in, answers and output stream, a diff reveals line by line, spinners step
the script's own durations, at the chosen speed
Waiting for an answer
The prompt replaces the input; the clock holds at it
none
Answered
The prompt's choice shows on the tool call and the replay goes on
none
Denied
The tool call reads Denied, the script stops with a note
none
Ended
The input takes your own text; play turns into Replay
none
Output or a diff unfolded
The lines past the fold show under the call
none
Reduced motion
autoPlay shows the last frame instead of playing
0ms

Works with

When to use

When to use

  • Showing a coding agent at work on a product or docs page: a whole terminal session replayed from a script, with its prompts, tool calls, diffs and permission prompts.
  • Replaying a recorded run from your own traces, frame by frame, for a review, a bug report or a capture.

When not to use

  • Live shell commands in your app that a person approves: use Agent Terminal.
  • One tool call with its arguments and result: use Tool Call Card.
  • Reviewing one file's change line by line: use Inline Diff.

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 CLI to my app and wire it to my own data.
  • I need showing a coding agent at work on a product or docs page: a whole terminal session replayed from a script, with its prompts, tool calls, diffs and permission prompts. Set that up with the Knowns UI Agent CLI.
  • Which Agent CLI props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-cli" }) and search_docs({ query: "agent cli" }).

Need help?

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