boxen
Creates formatted terminal boxes with configurable borders around text output. Supports multiple border styles (single, double, round, bold, doubleSingle, classic), padding, margin, text alignment, title, and full-color support via chalk. Published by Sindre Sorhus — ESM-only since v7. Used by CLI tools to emphasize important messages, warnings, or summaries.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local computation, MIT licensed. No network, no credentials. Terminal output only.
⚡ Reliability
Best When
You need to highlight important terminal messages in CLI tools with a simple, styled box — especially for warnings, errors, update notices, or summaries.
Avoid When
Output goes anywhere other than a terminal. For rich interactive terminal UIs, use ink (React for terminals) or blessed.
Use Cases
- • Display prominent warning or error messages in CLI tools by boxing them with colored borders
- • Present agent output summaries or status reports in formatted terminal boxes for visual clarity
- • Show CLI help or important configuration notices in visually distinct bordered boxes
- • Highlight update notifications or important messages in developer tools (similar to npm update-notifier pattern)
- • Create visual separation between sections of verbose CLI output in agent terminal interfaces
Not For
- • Browser or web applications — boxen is terminal-only; outputs ANSI escape codes that display as garbage in HTML
- • Logging frameworks or file output — terminal formatting codes should not be written to log files
- • Complex terminal UI — use blessed, ink, or terminal-kit for interactive TUI applications
Interface
Authentication
Local library — no authentication required. MIT licensed.
Pricing
MIT licensed. Zero cost.
Agent Metadata
Known Gotchas
- ⚠ v7+ is ESM-only — use import { boxen } from 'boxen' not require(); pin to v6 for CommonJS support
- ⚠ boxen() returns a STRING with ANSI codes — call console.log(boxen('text')) to display; don't write the output to log files
- ⚠ Width defaults to terminal width — in non-TTY environments (CI, pipes), terminal width may be 80 or undefined; set explicit width option for consistent output
- ⚠ title option places text in the top border of the box — requires v7.0.0+; older versions don't support title
- ⚠ Multi-line text in boxes: boxen handles '\n' line breaks — pre-format multi-line content before passing
- ⚠ Unicode box characters may not render correctly in all terminal emulators — use borderStyle: 'classic' for maximum compatibility with ASCII-only terminals
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for boxen.
Scores are editorial opinions as of 2026-03-06.