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:
$ npx @pressa/cli compile document.texTo keep the pressa command around, install it globally:
$ npm install -g @pressa/cliVerify the installation:
$ pressa --version
# prints the installed version, e.g. 0.7.0pressa auth
Authenticate the CLI with your Pressa API key. The key is validated against the API and stored locally for future commands.
Usage
# Interactive mode - prompts for your key
$ pressa auth
# Pass key directly
$ pressa auth--key pressa_xxxOptions
| Option | Description |
|---|---|
--key | API key to store. If omitted, the CLI prompts interactively. |
--url | Override the API URL. Useful for local development. |
What it does
- Validates the key by calling
GET /api/v1/usage - On success, stores the key in
~/.pressa/config.json - Prints your current plan and usage summary
Example output
$ pressa auth --key pressa_k_abc123
Authenticating...
Authenticated! API key stored in ~/.pressa/config.json
Plan: Free | Used: 12/50 compilations | Resets: May 1, 2026pressa 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
$ pressa compile <file> [options]Options
| Option | Default | Description |
|---|---|---|
--compiler | pdflatex | LaTeX compiler to use: pdflatex, xelatex, or lualatex |
--output | input name + .pdf | Output file path for the downloaded PDF. |
--json | false | Output the raw JSON response instead of downloading the PDF. |
--no-download | false | Skip downloading. Prints the PDF URL to stdout. |
--asset | none | Include an asset file (PNG, JPG, JPEG, PDF, SVG). Forms: logo.png or logo.png=/abs/path/file.png. Repeatable. |
--stored-asset | none | Reference 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-bundle | false | Disable auto-bundling of \includegraphics assets from the input file's directory. |
--url | config value | Override 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
# 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.pngExplicit asset with custom path
$ pressa compile letter.tex --asset signature.png=/Users/me/assets/sig.pngStdin input
Pass - instead of a filename to read LaTeX from stdin. This is useful for piping content from other tools.
Examples
Basic compilation
$ pressa compile report.tex
# Compiles report.tex and saves report.pdfWith a specific compiler
$ pressa compile report.tex --compiler xelatexJSON response
$ pressa compile report.tex --json
# {"pdf_url": "https://...", "pages": 3, "compilation_time_ms": 1250}Custom output path
$ pressa compile report.tex --output ./build/final-report.pdfFrom stdin
$ 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
$ pressa render <template> --data <source> [options]Options
| Option | Default | Description |
|---|---|---|
--data | required | Placeholder data: path to a JSON file, inline JSON starting with {, or - for stdin. |
--output | auto | Output PDF filename. - writes the PDF binary to stdout for piping. |
--json | off | Machine-readable JSON output (for AI agents and scripts). |
--no-download | off | Skip the download and print the signed PDF URL instead. |
Examples
Render by template name with inline JSON
$ pressa render invoice --data '{"customer_name": "Acme GmbH", "amount": 1250}'Render from a data file into a named PDF
$ pressa render invoice --data april.json --output invoice-april.pdfpressa 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
| Command | Description |
|---|---|
templates list | List 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
| Option | Applies to | Description |
|---|---|---|
--json | list, get | Output raw JSON response. |
--output | get | Save LaTeX content to a file instead of printing to stdout. |
--description | save | Short human-readable summary (max 500 chars). |
--instructions | save | Inline agent playbook (prose markdown, max 50000 chars). Mutually exclusive with --instructions-file. |
--instructions-file | save | Read the agent playbook from a file (handy for longer markdown). |
--instructions-out | get | Write the template's instructions (if any) to this file, parallel to --output for the LaTeX content. |
--yes | delete | Skip confirmation prompt. |
Examples
List all templates
$ pressa templates listSave a template from a file
$ pressa templates save invoice invoice.tex --description "Standard invoice layout"Save a template with an agent instructions playbook
$ pressa templates save invoice invoice.tex \
--description "Toptal monthly invoice" \
--instructions-file invoice-rules.mdDownload template and instructions to separate files
$ pressa templates get invoice \
--output invoice.tex \
--instructions-out invoice-rules.mdDelete without confirmation
$ pressa templates delete invoice --yespressa 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
| Command | Description |
|---|---|
assets list | List 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
| Option | Applies to | Description |
|---|---|---|
--name | upload | Override the asset name. Defaults to the local file's basename. |
--output | get | Path to write the decoded binary to. For non-text formats this is required. |
--json | list, get | Output the raw JSON response from the API. |
--yes | delete | Skip the confirmation prompt. |
Examples
Upload a logo once, reuse in every compile
$ pressa assets upload ./brand/logo.png
# Uploaded logo.png (18 KB)
$ pressa compile invoice.tex --stored-asset logo.pngList stored assets
$ pressa assets listUpload with a custom asset name
$ pressa assets upload ~/Downloads/company-seal-v3.png --name seal.pngDownload a stored asset to a local file
$ pressa assets get logo.png --output ./logo.pngDelete an asset without confirmation
$ pressa assets delete logo.png --yespressa usage
Check your current plan and compilation usage.
Usage
$ pressa usageOptions
| Option | Description |
|---|---|
--url | Override the API URL. |
Example output
$ pressa usage
Plan: Free
Compilations: 42 / 50
Resets: May 1, 2026Configuration
The CLI stores its configuration in ~/.pressa/config.json. This file is created automatically when you run pressa auth.
Config file format
{
"api_key": "pressa_k_abc123",
"api_url": "https://api.pressa.dev"
}| Field | Description |
|---|---|
api_key | Your Pressa API key. Set via pressa auth. |
api_url | API 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.
$ pressa compile report.tex --url http://localhost:3100