Codeprint CLI

From terminal to paper.

Turn Markdown, code, JSON, and CSV files into polished PDFs. Preview the result or approve the exact settings before anything reaches your printer.

Local by default. Review before printing.

Interactive playground

Every example uses commands and options available in the package.

~/project$ codeprint render README.md

Parsing Markdown...

Created 2-page PDF at /project/README.pdf

One pipeline, four formats

The same local rendering engine as the web app, packaged for terminal and agent workflows.

Markdown

Headings, tables, code blocks, and an optional table of contents.

Code

Syntax colors, line numbers, and more than 20 language profiles.

JSON

Pretty-printed as syntax-highlighted code with the JSON language profile.

CSV

Landscape-ready tables with headers and alternating row colors.

Print controls without a GUI detour

Physical print
codeprint printPrepare and submit a print jobsrc/App.tsxInput file--page-size a4Also letter or legal--orientation landscapePortrait or landscape--duplex two-sided-long-edgeOne-sided, long-edge, or short-edge--copies 2Choose 1 to 99 copies--color monochromeAuto, color, or monochrome--page-ranges 1-3,5Print selected pages
PDF layout
codeprint renderCreate a PDF without printingREADME.mdMarkdown input--margins wideSmall, normal, or wide--tocAdd a Markdown table of contents--font-size 11Choose 8 to 24 points--no-line-numbersHide code line numbers

Hover an argument to inspect it.

Built for humans and agents

One core rendering engine powers three workflows without sending documents through a Codeprint cloud.

Browser

An immediate editor and print preview for everyday use.

CLI

PDF rendering and confirmed CUPS printing from the terminal.

MCP

The same local capabilities exposed safely to AI assistants.

Powered by @codeprint/core

Safe physical printing

Printing consumes paper and ink. Codeprint resolves the file, printer, copies, paper size, duplex mode, color mode, and page ranges before asking for confirmation. Nothing reaches the spooler until you say yes.

For reviewed automation, --yes is the explicit escape hatch. It is never the default.

$ codeprint print manifest.json

Prepared manifest.pdf: 1 copy, A4, one-sided, auto, all pages, printer Home_LaserJet

Print these settings? [y/N]

Installation

npm install --global @codeprint/cli
Runtime
Node.js 22.12 or newer.
Physical printing
macOS or Linux with CUPS. PDF rendering works without a printer.
Output behavior
Render writes to the current directory by default and refuses to overwrite a PDF unless you pass--force.

Frequently asked questions

Is the CLI free?
Yes. The CLI is free and open source for local use.
What formats does it support?
Markdown, code files with syntax highlighting, JSON through the code renderer, CSV, and existing PDFs that you want to submit to a printer.
Are my files sent to a server?
No. Parsing, PDF rendering, printer discovery, and print submission all happen on your machine.
What is the relationship to MCP?
The CLI and MCP server share @codeprint/core for document rendering and @codeprint/print for local printer access. The MCP server adds a token-based approval boundary for assistants.
Does physical printing work on Windows?
Not in the first release. Local printer discovery and submission currently use CUPS on macOS and Linux. PDF rendering remains portable.

Print locally.

Stop tabbing to the browser just to get a clean PDF. Install the CLI when the terminal is where your document begins.

Install the CLI