Skip to main content

Module output

Module output 

Source
Expand description

Output helpers for CLI subcommands: aligned tables and JSON.

Functionsยง

image_dimensions
(width, height) of a PNG or JPEG from its header bytes, without an image crate. None for anything else or a truncated header.
print_json
Print a serializable value as pretty JSON, followed by a newline.
print_table
Print rows as a simple aligned table.
terminal_width
Best-effort terminal width for human table formatting.
write_private_file
Write bytes to path and restrict it to the current user (0600 on Unix). Shared by the file-writing MCP tools; the cookie/fetch CLI writers follow the same contract.