stagetty
v0.1.1
Published
TTY stage renderer with rolling log output for CLI tools
Maintainers
Readme
stagetty
TTY stage renderer with a rolling log window for CLI tools.

stagetty is a small utility for stage-based terminal output with:
- spinner title rows
- rolling output windows
- grouped output using
│and└ - a convenience wrapper for running subprocess commands
Install
pnpm add stagettyUsage
import { runStageCommand } from 'stagetty'
await runStageCommand('Installing dependencies', 'pnpm', ['install'], {
cwd: process.cwd(),
maxLines: 5
})Custom Renderer
import { DEFAULT_SPINNER_FRAMES, StageRenderer } from 'stagetty'
const renderer = new StageRenderer('Building package', {
maxLines: 6,
spinnerFrames: DEFAULT_SPINNER_FRAMES,
spinnerInterval: 100
})
renderer.start()
renderer.appendLine('Resolving entry files')
renderer.appendLine('Bundling modules')
renderer.finishSuccess()API
new StageRenderer(title, options?)
Creates a renderer instance for one stage.
runStageCommand(title, command, args?, options?)
Runs a subprocess with streaming output and renders the latest lines in place.
Options
maxLines: maximum number of visible output lines, default5spinnerFrames: custom spinner framesspinnerInterval: spinner frame interval in milliseconds, default100cwd: working directory for subprocess executionshell: override shell execution behaviourenv: extra environment variables for subprocess executionstdout: custom output stream for renderingstderr: custom error stream for rendering
