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.

Evaluated Mar 06, 2026 (0d ago) v7.x / 8.x
Homepage ↗ Repo ↗ Developer Tools cli terminal box border chalk output formatting sindresorhus
⚙ Agent Friendliness
67
/ 100
Can an agent use this?
🔒 Security
98
/ 100
Is it safe for agents?
⚡ Reliability
89
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
88
Error Messages
75
Auth Simplicity
100
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
100
Scope Granularity
100
Dep. Hygiene
85
Secret Handling
100

Local computation, MIT licensed. No network, no credentials. Terminal output only.

⚡ Reliability

Uptime/SLA
100
Version Stability
85
Breaking Changes
80
Error Recovery
90
AF Security 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

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

Local library — no authentication required. MIT licensed.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

MIT licensed. Zero cost.

Agent Metadata

Pagination
none
Idempotent
Full
Retry Guidance
Not documented

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.

$99

Scores are editorial opinions as of 2026-03-06.

5209
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered