AI terminal
Shown as Lathe, a made-up product
The shell commands an agent ran, each a line that opens to its output as it streams: a time strip, exit codes, follow, filter and wrap, and on a failure the agent's read of the error with a fix it can run.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/lathe-terminal.json?token=…"Adds the piece to components/propui/12-lathe-terminal/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- Showing the shell commands an agent ran, such as installs, lint, tests and builds.
- Any long-running job whose output streams in and that can fail with an exit code.
- Letting an agent explain a failure and offer the fix next to the output.
Something else fits when
- An interactive shell people type into: use a real terminal emulator.
- Logs from many services at once: a log viewer with search and levels fits better.
- A single quick command: one line with its result is enough.
Usage
Fills a full window: give it a container with a definite height.
import Piece from "@/components/propui/12-lathe-terminal/Section";
export default function Page() {
return (
<main className="h-dvh w-full overflow-hidden">
<Piece />
</main>
);
}Replace FIRST_RUN, FIX_RUN and TASK in data.ts. Each command has its duration, exit code and output lines; a failing command can carry the agent's read and the output lines it refers to.
Your data
Replace these and everything on screen follows.
FIRST_RUN, FIX_RUN{ id; cmd; ms; exit; out; why? }[]- The commands in each run, how long they take, how they end and what they print.
OutLine{ s; tone?: "plain" | "ok" | "err" | "warn" | "dim" | "head" }- One output line and its colour.
why{ text; lines: number[] }- The agent's read of a failure and the output lines Show lines points at.
Interactions
- Open a command to see its output; a running one opens on its own once output arrives.
- Scroll up while output streams to stop following it, then Follow output to catch up.
- Filter the output, wrap long lines, or copy the command with its output.
- On a failure, read the agent's explanation, jump to the lines it means, and Fix it to run the fix and the remaining steps.
- Replay the run from the start.
Keyboard
- EnterorSpace
- Open or close the focused command, or press the focused button.
- ↑or↓
- In the focused output, scroll.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Each command is a button with aria-expanded; the copy, wrap and filter controls sit next to it, not inside it.
- Status is said in words (Running, Ran, Skipped, exited with code 1) as well as shown by colour and icon.
- The output is a focusable log region with a label; line numbers are hidden from screen readers.
- The run's state is a polite live region; the time strip is an image with a summary label.
Motion
- Output streams in line by line with a blinking cursor; the time strip fills as each command runs.
- Commands open and fold with a short height ease; Show lines scrolls to and lights the lines.
- Reduced motion stops the spinner, the pulse and the cursor.
Responsive
- The card is at most 760px wide and grows with its commands; output scrolls inside a 240px window.
- At 640px and below the time and exit code move under each command and the output tools become icons.
- At 400px and below the run's state hides from the header and line numbers narrow.
Performance
- One 50ms clock drives the running command and stops when nothing runs.
- Long output scrolls inside its own box; one local font file.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- To stream real output, append each chunk to the running command's output as it arrives, keyed by its id.
- A run stops at the first non-zero exit and skips the rest; keep that so a failure is never buried.
- Every class is prefixed lx- and scoped under .lx; the output stays a dark terminal in both themes.
/p/lathe-terminal/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.