Skip to main content

TerminalToolCall

Transcriptterminal

A single tool invocation dressed as a CLI line: a status glyph (success/error/pending), the tool name plus its optional argument in parentheses, a result summary on a ⎿ row, and detail behind a real disclosure.

import { TerminalToolCall } from "@elabs-ai/components-terminal";
Install
npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminal

Skipping the @source line is the most common first failure: Tailwind does not scan node_modules, so every component renders unstyled. The one-time wiring

Prompt for your coding agent

Paste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.

Add the brand-ui TerminalToolCall component (from @elabs-ai/components-terminal) to this project.

1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`.
2. Look TerminalToolCall up before writing code: `npx -y @elabs-ai/components-cli docs TerminalToolCall` prints its real props, variants, what it pairs with and what to avoid.
3. If @elabs-ai/components-terminal is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminal` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui @elabs-ai/components-terminal`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`.
4. Use it here: [the screen or file, and what it should show]
5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop.
6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.

Avoid

  • Relying on the recoloured `⏺` alone to tell success from error — only `success` keeps that literal glyph; `error`/`pending` each get their own shape (`✗`/`○`) plus `gutterLabel`'s announced word, never colour alone.
  • Setting `role="alert"` while `status="pending"` — a still-running call is not a settled failure (`.claude/rules/conventions.md`, Loading & streaming states); only `error` fires the alert.
  • Reaching for the 7-state canonical `Status` or `TimelineStatus` — neither matches this grammar's exact `success`/`error`/`pending` vocabulary or its live-not-yet-settled meaning of `pending`.
  • Reproducing upstream's inert `"(ctrl+o to expand)"` hint as decorative text — the expand affordance is a real, localized, focusable `CollapsibleTrigger`, so a keyboard user never needs to know a CLI chord.
  • Putting expansion state in `TerminalSurface`'s context — it is per-row Radix `Collapsible` state, same as every other disclosure in this family.

Works with

Contains

  • TerminalRow

Pairs with

Avoid next to

  • Tool (that is the chat skin of the same fact, not a row sibling)

Examples

7 live examples

Success

A succeeded call — the literal upstream `⏺` glyph, green as a redundant cue.

Error State

A settled, terminal failure. Readable in greyscale: the `✗` glyph (never the success rung's `⏺`, recoloured) plus the "Failed"/"Error" words carry the meaning even with colour turned off.

Pending

Still in flight — its own hollow-circle glyph, not the success bullet recoloured.

With Detail

Detail behind disclosure, collapsed by default. The trigger is a real, localized, focusable control — a keyboard user opens it with Tab then Enter, never a CLI chord.

Session

A short run of calls, reading top to bottom as one session.

Boxed

The `boxed` variant frames each of the call's own rows independently.

API

TerminalToolCall

PropTypeDescription
toolNamerequiredstringThe tool being invoked, verbatim as the runtime names it — e.g. `"Bash"`, `"Read"`.
argumentReactNodeThe call's argument, rendered after the name in parentheses — e.g. `Bash(rm -rf tmp)`. Omitted, no parentheses render at all.
summaryReactNodeThe one-line result, on its own `⎿` continuation row. Same fact as `Tool`'s (`@elabs-ai/components-ai`) `summary` prop — the business headline, not the raw payload. Omitted, no result row renders (a call that is still `pending` usually has none yet).
detailReactNodeThe technical payload, behind the disclosure this component owns. Omitted, no disclosure renders at all — there is nothing to expand.
variantTerminalVariantGutter grammar for every row this component renders. Omitted, each row inherits the surrounding `TerminalSurface`; passed, it overrides it for the whole call — the same override contract every row in this family exposes.

Also accepts: Omit<ComponentProps<typeof Collapsible>, "children">, VariantProps<typeof terminalToolCallGlyphVariants>

TerminalRow

variant
marker (default)railboxed
PropTypeDescription
variantTerminalVariantGutter grammar. Omitted, the row inherits the surrounding `TerminalSurface`; passed, it overrides it, so a row still renders correctly outside any surface.
gutterReactNodeWhat sits in the gutter cell — usually one glyph. Decorative by default.
gutterLabelstringThe meaning the gutter glyph carries, as words. Set it whenever the glyph is not purely ornamental; it is announced and it survives greyscale.
childrenReactNode

Also accepts: Omit<HTMLAttributes<HTMLDivElement>, "children">, Omit<VariantProps<typeof terminalRowVariants>, "variant">

Theming

The tokens each state resolves to. Change the token and every theme follows.

StateToken
successtext-terminal-ansi-green
errortext-terminal-ansi-red
pendingtext-terminal-ansi-yellow