nextui.dev
Home
Docs
Saved
Pricing
Components37
  • Forms & inputs7
  • Cards13
  • Buttons, badges & avatars8
  • Feedback & display6
  • Effects3
Agents27
  • Chat inputNew
  • Task checklistNew
  • ReasoningNew
  • Tool callNew
  • Terminal OutputNew
  • Model pickerNew
  • Tool approvalNew
  • Error & RetryNew
  • AttachmentsNew
  • SourcesNew
  • Agent timelineNew
  • Context meterNew
  • Artifact panelNew
  • Message actionsNew
  • Streaming messageNew
  • Sub-agentsNew
  • Diff ViewerNew
  • Conversation shellNew
  • Agent questionNew
  • Plan ReviewNew
  • Voice agentNew
  • Voice orbNew
  • Thinking ring
  • Thinking waveNew
  • Thinking sparkle
  • Thinking bot
  • Prompt deckNew
Blocks20
  • Agent chatNew
  • Pill heroNew
  • Grid hero
  • Moodboard generatorNew
  • Waitlist heroNew
  • Intro bannerNew
  • Creative home heroNew
  • Chat heroNew
  • App shelfNew
  • Usage card
  • Design resultsNew
  • Pricing tiers
  • Dashboard home
  • The shiftNew
  • Launch perksNew
  • Testimonials
  • Quote
  • Team
  • Leads tableNew
  • Sign in
Pages13
  • ASCII workspace$49
  • Research agent$49
  • Support agent$49
  • Coding agent$49
  • CRM overviewNew
  • Marketing dashboardNew
  • Developer portfolio$49
  • Particle landing$49
  • Particle story$49
  • Statement converter$49
  • AI photo studio$49
  • Group card launch$49
  • Month-end storyNew
Themes9
  • Default
  • Ember
  • Ocean
  • Forest
  • Grape
  • Rose
  • Amber
  • Clay
  • Brutal
Upgrade
nextui.dev

nextui components, blocks and themes you install with one command.

Product

  • Components
  • Blocks
  • Themes
  • Pricing

Resources

  • Docs
  • Roadmap
  • GitHub

Legal

  • License
  • Privacy
  • Terms
  • Refunds

nextUI

[ 200 OK ] · nextUI

© 2026 NEXTUI • All rights reserved.

Upgrade
ComponentsAI & agentsTerminal Output
Copy promptCopy prompt

Customize

The command the agent ran

Running shows a live pill and cursor and keeps the newest line in view

Shown once the command has finished

0

Lines shown once finished before a Show all button; the tail is kept

12

Loop a scripted test run, for demos

JSX · copied with Copy prompt

<TerminalOutput autoPlay />

Terminal OutputNew

A command the agent ran: live output with stderr marked, exit code, run time, copy and stop.

Installation

Set your access key from API keys as NEXTUI_TOKEN in .env.local and add the @nextui namespace below to components.json once. Then every item installs by name. Each install counts as a copy on a free account.

$pnpm dlx shadcn@latest add @nextui/terminal-output
1{
2 "registries": {
3 "@nextui": {
4 "url": "https://nextui.dev/r/{name}.json",
5 "headers": { "Authorization": "Bearer ${NEXTUI_TOKEN}" }
6 }
7 }
8}

Usage

1"use client";
2
3import type { UIMessage } from "ai";
4import { TerminalOutput } from "@/components/nextui/terminal-output";
5
6// Render a "bash" tool part from useChat messages.
7// Stream output from your tool with preliminary results (async *execute yields).
8export function BashPart({ part }: { part: Extract<UIMessage["parts"][number], { type: `tool-${string}` }> }) {
9 const input = part.input as { command?: string } | undefined;
10 const output = part.output as { lines: string[]; exitCode?: number; ms?: number } | undefined;
11 const done = part.state === "output-available" && part.preliminary !== true;
12
13 return (
14 <TerminalOutput
15 command={input?.command ?? ""}
16 lines={output?.lines ?? []}
17 status={!done ? "running" : output?.exitCode ? "error" : "success"}
18 exitCode={output?.exitCode ?? 0}
19 duration={output?.ms ?? 0}
20 />
21 );
22}

API reference

Edit props live in the preview above, or see all 13 props
PropTypeDefaultDescription
commandstring–The command the agent ran
cwdstring"~/app"Working directory, shown before the prompt
lines(string | { text: string; stream?: "stdout" | "stderr" })[]–Output so far. Strings are stdout; stderr lines are tinted and announced as stderr
status"running" | "success" | "error""success"Running shows a live pill and cursor and keeps the newest line in view
exitCodenumber0Shown once the command has finished
durationnumber–Run time in ms
onStop() => void–Called by the stop button while running. Leave out to hide it
maxLinesnumber12Lines shown once finished before a Show all button; the tail is kept
openboolean–Controlled open state of the output
defaultOpenbooleantrueStarting open state when uncontrolled
onOpenChange(open: boolean) => void–Called when the header is clicked
autoPlaybooleanfalseLoop a scripted test run, for demos
classNamestring–Extra classes on the card

Related

All components

Chat inputNew

Task checklistNew

Free

ReasoningNew

Sign in to see the code

Preview it freely. A free account copies code and prompts a few times a day.

Sign in