Colored logging, spinners, tables, boxes, ASCII art, trees, and progress bars.
bun add @seedcli/printThe print module provides all console output functionality — from simple logging to complex tables, boxes, and progress bars.
Logging
seed.print.info('Starting deployment...')
seed.print.success('Deployed successfully!')
seed.print.warning('Config file not found, using defaults')
seed.print.error('Failed to connect to database')
seed.print.debug('Query took 42ms') // Only visible with --debug
seed.print.highlight('Important note')
seed.print.muted('Less important info')
seed.print.newline()
seed.print.newline(3) // 3 blank linesDebug Mode
Debug messages are only displayed when --debug or --verbose is passed:
seed.print.debug('This is only visible in debug mode')Colors
Direct access to chalk for custom coloring:
const { colors } = seed.print
console.log(colors.red('Error!'))
console.log(colors.bold.green('Success!'))
console.log(colors.hex('#7cc576')('Custom color'))
console.log(colors.bgBlue.white(' BADGE '))Spinner
Show a loading indicator for async operations:
const spinner = seed.print.spin('Deploying...')
try {
await deploy()
spinner.succeed('Deployed!')
} catch (err) {
spinner.fail('Deployment failed')
}Spinner Methods
| Method | Description |
|---|---|
succeed(text?) | Stop with a success checkmark |
fail(text?) | Stop with a failure cross |
warn(text?) | Stop with a warning symbol |
info(text?) | Stop with an info symbol |
stop() | Stop without a symbol |
Spinner Properties
| Property | Type | Description |
|---|---|---|
text | string | Update the spinner message |
isSpinning | boolean | Check if currently spinning |
const spinner = seed.print.spin('Processing...')
spinner.text = 'Still processing...'
spinner.text = 'Almost done...'
spinner.succeed()Table
Render formatted tables:
seed.print.table(
[
['Name', 'Version', 'Status'],
['core', '1.0.0', 'published'],
['print', '1.0.0', 'published'],
['prompt', '1.0.0', 'draft'],
],
{ headers: ['Name', 'Version', 'Status'] }
)Table Options
| Option | Type | Default | Description |
|---|---|---|---|
headers | string[] | — | Header row labels |
border | 'single' | 'double' | 'rounded' | 'bold' | 'none' | 'single' | Border style |
headerColor | (text: string) => string | — | Header color function |
columns | Record<number, ColumnConfig> | — | Per-column configuration |
maxWidth | number | terminal width | Maximum table width |
seed.print.table(rows, {
headers: ['Package', 'Size', 'Status'],
border: 'rounded',
headerColor: colors.cyan,
maxWidth: 80,
columns: {
1: { alignment: 'right' },
2: { alignment: 'center' },
},
})Column Config
| Option | Type | Description |
|---|---|---|
alignment | 'left' | 'center' | 'right' | Column alignment |
width | number | Fixed column width |
truncate | boolean | Truncate overflowing text |
Box
Draw a bordered box around content:
seed.print.box('Deployment complete!\nAll services are healthy.', {
title: 'Status',
borderColor: 'green',
borderStyle: 'round',
padding: 1,
})Box Options
| Option | Type | Default | Description |
|---|---|---|---|
title | string | — | Box title |
titleAlignment | 'left' | 'center' | 'right' | 'left' | Title position |
borderColor | string | — | Border color |
borderStyle | 'single' | 'double' | 'round' | 'bold' | 'singleDouble' | 'doubleSingle' | 'classic' | 'arrow' | 'none' | 'single' | Border style |
backgroundColor | string | — | Background color |
padding | number | object | 0 | Inner padding |
margin | number | object | 0 | Outer margin |
textAlignment | 'left' | 'center' | 'right' | 'left' | Content alignment |
dimBorder | boolean | false | Dim the border |
width | number | — | Fixed width |
fullscreen | boolean | false | Fill terminal width |
float | 'left' | 'center' | 'right' | 'left' | Box position |
ASCII Art (Figlet)
Render large text banners:
seed.print.ascii('My CLI', {
font: 'Standard',
})Figlet Options
| Option | Type | Description |
|---|---|---|
font | string | Figlet font name (default: 'Standard') |
horizontalLayout | 'default' | 'full' | 'fitted' | 'controlled smushing' | 'universal smushing' | Character spacing |
verticalLayout | 'default' | 'full' | 'fitted' | 'controlled smushing' | 'universal smushing' | Vertical spacing |
width | number | Maximum width |
whitespaceBreak | boolean | Break on whitespace |
Tree
Display hierarchical data:
seed.print.tree({
label: 'my-project',
children: [
{
label: 'src',
children: [
{ label: 'commands/' },
{ label: 'extensions/' },
{ label: 'index.ts' },
],
},
{ label: 'package.json' },
{ label: 'tsconfig.json' },
],
})Tree Options
| Option | Type | Default | Description |
|---|---|---|---|
indent | number | 2 | Indentation width |
guides | boolean | true | Show tree guide lines |
Key-Value
Display aligned key-value pairs:
seed.print.keyValue({
Name: 'my-project',
Version: '1.0.0',
Runtime: 'Bun 1.3.5',
Platform: 'macOS arm64',
})
// Or with array of pairs
seed.print.keyValue([
{ key: 'Name', value: 'my-project' },
{ key: 'Version', value: '1.0.0' },
])Key-Value Options
| Option | Type | Default | Description |
|---|---|---|---|
separator | string | ':' | Key-value separator |
keyColor | (text: string) => string | — | Color function for keys |
valueColor | (text: string) => string | — | Color function for values |
indent | number | 0 | Left indentation |
Divider
Print a horizontal line:
seed.print.divider()
seed.print.divider({ title: 'Section Title' })
seed.print.divider({ title: 'Config', char: '═', color: colors.cyan })Divider Options
| Option | Type | Default | Description |
|---|---|---|---|
title | string | — | Centered title text |
char | string | '─' | Line character |
width | number | terminal width | Line width |
color | (text: string) => string | — | Color function |
padding | number | 1 | Padding around title |
Progress Bar
Show progress for long-running tasks:
const progress = seed.print.progressBar({
total: files.length,
width: 40,
format: 'Processing [:bar] :percent',
})
for (const file of files) {
await processFile(file)
progress.update(progress.current + 1)
}
progress.done()Progress Bar Options
| Option | Type | Default | Description |
|---|---|---|---|
total | number | — | Total number of steps (required) |
width | number | 30 | Bar width in characters |
complete | string | '█' | Filled character |
incomplete | string | '░' | Empty character |
format | string | — | Custom format string |
Progress Bar Methods
| Method | Description |
|---|---|
update(current) | Set progress to a specific value |
done() | Complete the progress bar |
Formatting Helpers
indent(text, spaces?)
const { indent } = seed.print
console.log(indent('indented text', 4))
// " indented text"wrap(text, width?)
const { wrap } = seed.print
console.log(wrap(longParagraph, 80))columns(items, options?)
Format items into columns:
const { columns } = seed.print
console.log(columns(
['deploy', 'init', 'build', 'test', 'lint'],
{ columns: 3, padding: 2 }
))Column Options
| Option | Type | Default | Description |
|---|---|---|---|
width | number | terminal width | Total width |
padding | number | 2 | Padding between columns |
columns | number | auto | Number of columns |