CLI Reference

Compile LaTeX from your terminal or let your AI assistant use it.

Installation

There is nothing to install for a one-off compile, and no API key is needed to start. Requires Node.js 18 or later:

Terminal
$ npx @pressa/cli compile document.tex

To keep the pressa command around, install it globally:

Terminal
$ npm install -g @pressa/cli

Verify the installation:

Terminal
$ pressa --version
# prints the installed version, e.g. 0.7.0

pressa auth

Authenticate the CLI with your Pressa API key. The key is validated against the API and stored locally for future commands.

Usage

Terminal
# Interactive mode - prompts for your key
$ pressa auth

# Pass key directly
$ pressa auth--key pressa_xxx

Options

OptionDescription
--keyAPI key to store. If omitted, the CLI prompts interactively.
--urlOverride the API URL. Useful for local development.

What it does

  1. Validates the key by calling GET /api/v1/usage
  2. On success, stores the key in ~/.pressa/config.json
  3. Prints your current plan and usage summary

Example output

Terminal
$ pressa auth --key pressa_k_abc123
Authenticating...
Authenticated! API key stored in ~/.pressa/config.json
Plan: Free | Used: 12/50 compilations | Resets: May 1, 2026

pressa compile

Compile a LaTeX file to PDF. The file is sent to Pressa's API, compiled on the server, and the resulting PDF is downloaded to your machine.

Usage

Terminal
$ pressa compile <file> [options]

Options

OptionDefaultDescription
--compilerpdflatexLaTeX compiler to use: pdflatex, xelatex, or lualatex
--outputinput name + .pdfOutput file path for the downloaded PDF.
--jsonfalseOutput the raw JSON response instead of downloading the PDF.
--no-downloadfalseSkip downloading. Prints the PDF URL to stdout.
--assetnoneInclude an asset file (PNG, JPG, JPEG, PDF, SVG). Forms: logo.png or logo.png=/abs/path/file.png. Repeatable.
--stored-assetnoneReference an asset from your persistent asset library by name (e.g. logo.png). The server loads the bytes and injects them into the compile workspace. Compatible with --asset and auto-bundle. Repeatable. See pressa assets to upload assets first.
--no-bundlefalseDisable auto-bundling of \includegraphics assets from the input file's directory.
--urlconfig valueOverride the API URL for this command.

Assets (images & binary files)

The CLI automatically bundles any \includegraphics references it finds in your LaTeX source. Files are resolved from the input file's directory (LaTeX's default rule: extension may be omitted), base64-encoded, and sent alongside the source. Supported formats: PNG, JPG, JPEG, PDF, SVG.

Use --asset to include files that are not referenced by \includegraphics (e.g. an embedded PDF inserted via \includepdf) or to override the auto-detected path with an explicit mapping. Use --no-bundle to skip auto-detection (useful when you only want to send --asset files).

For files you reuse across many documents (company logo, standard signature, letterhead), upload them once to your asset library via pressa assets upload and reference them with --stored-asset. The CLI sends only the filename; the server loads the bytes for you. This is an alternative to per-compile upload for files that do not change often. See pressa assets for the full workflow.

Auto-bundle referenced images

Terminal
# invoice.tex references \\includegraphics{logo}; CLI finds logo.png
# next to invoice.tex and bundles it automatically.
$ pressa compile invoice.tex
Bundled 1 asset: logo.png

Explicit asset with custom path

Terminal
$ pressa compile letter.tex --asset signature.png=/Users/me/assets/sig.png

Stdin input

Pass - instead of a filename to read LaTeX from stdin. This is useful for piping content from other tools.

Examples

Basic compilation

Terminal
$ pressa compile report.tex
# Compiles report.tex and saves report.pdf

With a specific compiler

Terminal
$ pressa compile report.tex --compiler xelatex

JSON response

Terminal
$ pressa compile report.tex --json
# {"pdf_url": "https://...", "pages": 3, "compilation_time_ms": 1250}

Custom output path

Terminal
$ pressa compile report.tex --output ./build/final-report.pdf

From stdin

Terminal
$ echo "\\documentclass{article}\\begin{document}Hello\\end{document}" | pressa compile -

pressa render

Render a saved V2 template with placeholder data and download the PDF. No LaTeX on your side - the template owns the layout, you supply the values. Data is validated against the template schema before anything compiles, the compiler is auto-detected from the source, and stored assets resolve automatically. Paid plans only.

Usage

Terminal
$ pressa render <template> --data <source> [options]

Options

OptionDefaultDescription
--datarequiredPlaceholder data: path to a JSON file, inline JSON starting with {, or - for stdin.
--outputautoOutput PDF filename. - writes the PDF binary to stdout for piping.
--jsonoffMachine-readable JSON output (for AI agents and scripts).
--no-downloadoffSkip the download and print the signed PDF URL instead.

Examples

Render by template name with inline JSON

Terminal
$ pressa render invoice --data '{"customer_name": "Acme GmbH", "amount": 1250}'

Render from a data file into a named PDF

Terminal
$ pressa render invoice --data april.json --output invoice-april.pdf

pressa templates

Manage saved LaTeX templates. Available on paid plans only.

Each template has a required LaTeX file plus two optional fields with different roles. --description is a short human-readable summary shown next to the name in templates list. --instructions (or --instructions-file) is a longer prose markdown playbook (up to 50000 chars) that an AI agent reads alongside the LaTeX when filling the template - defaults, workflow rules, edge cases, conditional logic. Templates that have an instructions playbook show a badge in the list output.

Commands

CommandDescription
templates listList all saved templates.
templates get <name-or-id>Get template LaTeX content by name or ID.
templates save <name> <file>Save a template from a LaTeX file. Updates if name exists.
templates delete <name-or-id>Delete a template by name or ID.

Options

OptionApplies toDescription
--jsonlist, getOutput raw JSON response.
--outputgetSave LaTeX content to a file instead of printing to stdout.
--descriptionsaveShort human-readable summary (max 500 chars).
--instructionssaveInline agent playbook (prose markdown, max 50000 chars). Mutually exclusive with --instructions-file.
--instructions-filesaveRead the agent playbook from a file (handy for longer markdown).
--instructions-outgetWrite the template's instructions (if any) to this file, parallel to --output for the LaTeX content.
--yesdeleteSkip confirmation prompt.

Examples

List all templates

Terminal
$ pressa templates list

Save a template from a file

Terminal
$ pressa templates save invoice invoice.tex --description "Standard invoice layout"

Save a template with an agent instructions playbook

Terminal
$ pressa templates save invoice invoice.tex \
--description "Toptal monthly invoice" \
--instructions-file invoice-rules.md

Download template and instructions to separate files

Terminal
$ pressa templates get invoice \
--output invoice.tex \
--instructions-out invoice-rules.md

Delete without confirmation

Terminal
$ pressa templates delete invoice --yes

pressa assets

Manage your persistent asset library - binary files (logos, signatures, diagrams, embedded PDFs) that you want to reuse across many documents. Available on paid plans only. Uploaded assets persist until deleted and are referenced from pressa compile with the --stored-asset flag.

Commands

CommandDescription
assets listList all stored assets with size, content type, and quota usage.
assets upload <file>Read a local file, base64-encode it, and upload to your library. Defaults to the file's basename as the asset name; override with --name. Updates bytes if the name already exists.
assets get <id-or-name>Download an asset and write the decoded binary to --output. For text formats (SVG) you may omit --output to print to stdout.
assets delete <id-or-name>Delete an asset. Prompts for confirmation unless --yes is passed.

Options

OptionApplies toDescription
--nameuploadOverride the asset name. Defaults to the local file's basename.
--outputgetPath to write the decoded binary to. For non-text formats this is required.
--jsonlist, getOutput the raw JSON response from the API.
--yesdeleteSkip the confirmation prompt.

Examples

Upload a logo once, reuse in every compile

Terminal
$ pressa assets upload ./brand/logo.png
# Uploaded logo.png (18 KB)

$ pressa compile invoice.tex --stored-asset logo.png

List stored assets

Terminal
$ pressa assets list

Upload with a custom asset name

Terminal
$ pressa assets upload ~/Downloads/company-seal-v3.png --name seal.png

Download a stored asset to a local file

Terminal
$ pressa assets get logo.png --output ./logo.png

Delete an asset without confirmation

Terminal
$ pressa assets delete logo.png --yes

pressa usage

Check your current plan and compilation usage.

Usage

Terminal
$ pressa usage

Options

OptionDescription
--urlOverride the API URL.

Example output

Terminal
$ pressa usage

Plan: Free
Compilations: 42 / 50
Resets: May 1, 2026

Configuration

The CLI stores its configuration in ~/.pressa/config.json. This file is created automatically when you run pressa auth.

Config file format

~/.pressa/config.json
{
"api_key": "pressa_k_abc123",
"api_url": "https://api.pressa.dev"
}
FieldDescription
api_keyYour Pressa API key. Set via pressa auth.
api_urlAPI base URL. Defaults to https://api.pressa.dev. Override with --url on any command.

URL override

All commands accept a --url flag to temporarily override the API URL without modifying the config file. This is useful for local development or testing against a staging server.

Terminal
$ pressa compile report.tex --url http://localhost:3100