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
- 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
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-cliPaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Agent CLI from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/agent-cli
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add agent-cli
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- lib/knowns/icons/actor-icon.tsx
- lib/knowns/icons/model-icons.tsx
- lib/knowns/icons/tool-icons.tsx
- lib/knowns/icons/model-icons.data.ts
- lib/knowns/icons/tool-icons.data.ts
- lib/knowns/icons/LICENSES.md
- components/ui/knowns/agent-cli-core/agent-cli-core.ts
- components/ui/knowns/agent-cli-core/agent-cli-art.tsx
- components/ui/knowns/agent-cli-core/agent-cli-frame.tsx
- components/ui/knowns/agent-cli-core/agent-cli-grammar.tsx
- components/ui/knowns/agent-cli-core/agent-cli-header.tsx
- components/ui/knowns/agent-cli-core/agent-cli-look.tsx
- components/ui/knowns/agent-cli-core/agent-cli-skins.ts
- components/ui/knowns/agent-cli-core/agent-cli-utils.ts
- components/ui/knowns/agent-cli-core/agent-cli-diff.ts
- components/ui/knowns/agent-cli-core/THIRD_PARTY_NOTICES.md
- components/ui/knowns/agent-cli-antigravity/agent-cli-antigravity.tsx
- components/ui/knowns/agent-cli-antigravity/antigravity-header.tsx
- components/ui/knowns/agent-cli-antigravity/antigravity-mark.tsx
- components/ui/knowns/agent-cli-antigravity/antigravity-parts.tsx
- components/ui/knowns/agent-cli-antigravity/antigravity-slash-menu.tsx
- components/ui/knowns/agent-cli-antigravity/antigravity-tool.tsx
- components/ui/knowns/agent-cli-antigravity/antigravity-session.tsx
- components/ui/knowns/agent-cli-claude/agent-cli-claude.tsx
- components/ui/knowns/agent-cli-claude/claude-header.tsx
- components/ui/knowns/agent-cli-claude/claude-parts.tsx
- components/ui/knowns/agent-cli-claude/claude-slash-menu.tsx
- components/ui/knowns/agent-cli-claude/claude-session.tsx
- components/ui/knowns/agent-cli-codex/agent-cli-codex.tsx
- components/ui/knowns/agent-cli-codex/codex-exec.tsx
- components/ui/knowns/agent-cli-codex/codex-header.tsx
- components/ui/knowns/agent-cli-codex/codex-parts.tsx
- components/ui/knowns/agent-cli-codex/codex-slash-menu.tsx
- components/ui/knowns/agent-cli-codex/codex-session.tsx
- components/ui/knowns/agent-cli-grok/agent-cli-grok.tsx
- components/ui/knowns/agent-cli-grok/grok-event.tsx
- components/ui/knowns/agent-cli-grok/grok-header.tsx
- components/ui/knowns/agent-cli-grok/grok-parts.tsx
- components/ui/knowns/agent-cli-grok/grok-slash-menu.tsx
- components/ui/knowns/agent-cli-grok/grok-status.tsx
- components/ui/knowns/agent-cli-grok/grok-thought.tsx
- components/ui/knowns/agent-cli-grok/grok-time.ts
- components/ui/knowns/agent-cli-grok/grok-working.tsx
- components/ui/knowns/agent-cli-grok/grok-session.tsx
- components/ui/knowns/agent-cli-hermes/agent-cli-hermes.tsx
- components/ui/knowns/agent-cli-hermes/hermes-header.tsx
- components/ui/knowns/agent-cli-hermes/hermes-parts.tsx
- components/ui/knowns/agent-cli-hermes/hermes-slash-menu.tsx
- components/ui/knowns/agent-cli-hermes/hermes-session.tsx
- components/ui/knowns/agent-cli-neutral/agent-cli-neutral.tsx
- components/ui/knowns/agent-cli-neutral/neutral-header.tsx
- components/ui/knowns/agent-cli-neutral/neutral-parts.tsx
- components/ui/knowns/agent-cli-neutral/neutral-session.tsx
- components/ui/knowns/agent-cli-opencode/agent-cli-opencode.tsx
- components/ui/knowns/agent-cli-opencode/opencode-header.tsx
- components/ui/knowns/agent-cli-opencode/opencode-parts.tsx
- components/ui/knowns/agent-cli-opencode/opencode-session.tsx
- components/ui/knowns/agent-cli-pi/agent-cli-pi.tsx
- components/ui/knowns/agent-cli-pi/pi-header.tsx
- components/ui/knowns/agent-cli-pi/pi-parts.tsx
- components/ui/knowns/agent-cli-pi/pi-slash-menu.tsx
- components/ui/knowns/agent-cli-pi/pi-session.tsx
- components/ui/knowns/spinner.tsx
- components/ui/knowns/button.tsx
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/segmented-control.tsx
- components/ui/knowns/slider.tsx
- components/ui/knowns/agent-cli/agent-cli.tsx
- components/ui/knowns/agent-cli/agent-cli-parts.tsx
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0, class-variance-authority@^0.7.1.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/agent-cli, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "agent-cli" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
model logo or a terminal glyph - The small mark beside the agent's name in the header.
- time / defaultTime
number / number|"end"- Default
0 - Controlled or starting replay time in ms.
- onTimeChange
(time) => void- Every clock tick and seek.
- playing / onPlayingChange
boolean / (playing) => void- Default
false - Controlled playing state.
- autoPlay
boolean|"in-view"- Default
false - Play at mount, or once half of it is on screen. With reduced motion it shows the last frame instead.
- speed / defaultSpeed / onSpeedChange
number- Default
1 - Replay speed. The controls offer 0.5x, 1x, 2x and 4x.
- controls
boolean- Default
true - 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 }[]- Default
DEFAULT_COMMANDS - The slash menu: yours, with the defaults spread in if you want them.
- statusSegments
StatusSegment[]|(view, defaults) => StatusSegment[]- Default
model, 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- Default
4 - Lines of tool output before +N lines.
- height
number|"auto"- Default
440 - Transcript height in px: it scrolls and follows the newest line unless you scroll up. "auto" fits the transcript.
- placeholder
string- Default
the 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".
| Prop | Type | Default | Description |
|---|---|---|---|
| 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" | "neutral" | The look: layout, glyphs, words and colours. Override any --cli-* variable through style for your own colours. |
| agentMark | ReactNode | model logo or a terminal glyph | The small mark beside the agent's name in the header. |
| time / defaultTime | number / number | "end" | 0 | Controlled or starting replay time in ms. |
| onTimeChange | (time) => void | - | Every clock tick and seek. |
| playing / onPlayingChange | boolean / (playing) => void | false | Controlled playing state. |
| autoPlay | boolean | "in-view" | false | Play at mount, or once half of it is on screen. With reduced motion it shows the last frame instead. |
| speed / defaultSpeed / onSpeedChange | number | 1 | Replay speed. The controls offer 0.5x, 1x, 2x and 4x. |
| controls | boolean | true | 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 }[] | DEFAULT_COMMANDS | The slash menu: yours, with the defaults spread in if you want them. |
| statusSegments | StatusSegment[] | (view, defaults) => StatusSegment[] | model, 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 | 4 | Lines of tool output before +N lines. |
| height | number | "auto" | 440 | Transcript height in px: it scrolls and follows the newest line unless you scroll up. "auto" fits the transcript. |
| placeholder | string | the 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 by CLI
Each CLI is its own install, npx knowns-ui add agent-cli-claude, with its parts under their own names and its session as a block. Every part has a page of its own.
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.
| Part | Props | Default | What it draws |
|---|---|---|---|
| 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.
- preset
AgentCliPreset- Default
the 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- Default
a 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- Default
the agent / per look - The product name and version in the box or card.
- user / org / tips / whatsNew
string / string / string[] / string[]- Default
made-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 }[]- Default
made-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 }[]- Default
per look - The codex-like command list, the hermes-like toolsets, the pi-like keys; opencode-like lists none unless you pass some.
- logo
ReactNode- Default
the 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- Default
made-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- Default
false - A slow grey sweep across the grok-like mark. Still under reduced motion.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | a 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 | the agent / per look | The product name and version in the box or card. |
| user / org / tips / whatsNew | string / string / string[] / string[] | made-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 }[] | made-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 }[] | per look | The codex-like command list, the hermes-like toolsets, the pi-like keys; opencode-like lists none unless you pass some. |
| logo | ReactNode | the 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 | made-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 | false | 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.
- preset
AgentCliPreset- Default
the 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- Default
false - A caret at the end while it streams.
- tone
"muted"|"warn"- Default
"muted" - A note's colour.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | false | A caret at the end while it streams. |
| tone | "muted" | "warn" | "muted" | A note's colour. |
CliThinking
The agent thinking, then how long it thought and a one-line gist.
- preset
AgentCliPreset- Default
the 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- Default
false - Finished: the time and the gist instead of the spinner.
- text
string- The gist, once done.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | false | Finished: the time and the gist instead of the spinner. |
| text | string | - | The gist, once done. |
CliWorking
The busy line while a turn runs.
- preset
AgentCliPreset- Default
the 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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.
- preset
AgentCliPreset- Default
the 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- Default
4 - Lines before +N lines.
- children
ReactNode- Nested calls.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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" | "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 | 4 | 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.
- preset
AgentCliPreset- Default
the 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- Default
14 - Rows before +N lines.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | 14 | Rows before +N lines. |
CliTodos
The agent's plan as a checklist, in the look's glyphs.
- preset
AgentCliPreset- Default
the 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- Default
the look's word - The heading.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | the 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.
- preset
AgentCliPreset- Default
the 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- Default
false - Take focus on mount, for keyboard answers.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | false | 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.
- preset
AgentCliPreset- Default
the 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 }[]- Default
DEFAULT_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.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the frame's, else "neutral" | The look. Inside a CliFrame the part follows the frame; alone it draws its own surface. |
| value / defaultValue / onValueChange | string | "" | 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 }[] | DEFAULT_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.
- preset
AgentCliPreset- Default
the 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- Default
the 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| preset | AgentCliPreset | the 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 | the 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
- 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.
- 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.
- 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.
- 04Mirrors what it has played into an AgentRun, so a tree, a trace or an approvals list beside it follows the same session.
- 05Takes over the input once the replay ends: send a line, or type / for a filtered command menu.
- 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
| State | What moves | Timing |
|---|---|---|
| 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
- Agent TerminalThe shell commands alone, with Approve and Deny, for an app rather than a replay.
- Approval PromptThe same approvals, read from the mirrored run, as cards in your own app.
- DiffThe full file view for a change the session made.
- Agent TreeThe calls as a tree from the same run.
- Cost MeterThe spend from the status line, against a budget.
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" }).