Output formatting for the CLI.
Supports human-readable table output with ANSI colors and machine-readable JSON output.
Summary
Functions
Prints an error message to stderr with red color.
Formats a byte count into a human-readable string.
Formats an ISO 8601 datetime string into a shorter display format.
Prints an informational message to stdout.
Prints data in the appropriate format based on context.
Prints a success message to stdout with green color.
Prints a table with headers and rows.
Prints a warning message to stderr with yellow color.
Functions
Prints an error message to stderr with red color.
Formats a byte count into a human-readable string.
Formats an ISO 8601 datetime string into a shorter display format.
Prints an informational message to stdout.
Prints data in the appropriate format based on context.
When ctx.json is true, outputs JSON. Otherwise, uses the
provided formatter function for human-readable output.
Prints a success message to stdout with green color.
Prints a table with headers and rows.
Parameters
headers- List of column header stringsrows- List of row lists (each row is a list of cell values)
Prints a warning message to stderr with yellow color.