CLI
Generate documents and batches from a terminal, a CI job, or an agent. No code required.
Install
Requires Node 20.12 or newer.
npm install -g @shablonix/cli Authenticate
Create an API key with the documents:generate scope
under Dashboard → API Keys. Read it from stdin so it never appears in shell history or
process lists.
shablonix auth login --key-stdin < /secure/path/shablonix-api-key
shablonix auth status
shablonix auth logout auth login verifies the key before saving it to ~/.config/shablonix/auth.json with mode 0600. Logging out removes the local copy; revoke the
key in the dashboard to disable it server-side.
CI and agents
SHABLONIX_API_KEY from your secret manager instead
of saving a key. SHABLONIX_BASE_URL points the CLI at a
self-hosted API.Interactive mode
A guided menu for connecting a key, generating one document, submitting a batch, checking jobs, and downloading files. The key is masked while you type. Scripts and agents should use the flag-based commands below.
shablonix interactive Generate a document
By default the command returns a job ID right away. --output waits for completion and streams the file to disk.
shablonix generate --template cm123 --data-file invoice.json
shablonix generation status <generation-id>
shablonix generation download <generation-id> --output invoice.pdf
# Wait and save in one step
shablonix generate --template cm123 --data-file invoice.json --output invoice.pdf
# Use a plain text file as the template's text field
shablonix generate --template cm123 --text-file letter.txt --wait --output letter.pdf
# Receive the file in the generate response; Shablonix keeps no copy
shablonix generate --template cm123 --data-file invoice.json --stream --output invoice.pdf --docx-template <id> selects an uploaded DOCX
template, and --format docx returns DOCX output.
--stream uses a direct file response:
one request, no job to poll, and no stored copy or download URL. It requires --output. Add --idempotency-key <key> (8–200 visible ASCII
characters, such as an invoice number) to any generate so a retried command returns the same document without another charge.
Submit a batch
One batch uses one published template and 1–100 rows from a CSV, JSON array, or JSONL file. Dotted CSV headers become nested JSON; CSV values stay strings, so invoice numbers and decimals are preserved.
customer.name,invoice.number,amount
Ada,INV-001,12.50
Bob,INV-002,24.00 shablonix batch submit --template cm123 --file invoices.csv
shablonix batch status <batch-id>
shablonix generation download <generationId> --output ada.pdf Files outside 1–100 rows are rejected rather than silently split across several requests.
Use one batch per template. Completed items include a generationId for download.
Output formats
Output is compact TOON by default, which keeps agent context small. Add --json for standard JSON. Every command supports --help. Colors are off when NO_COLOR is set.
Webhooks
Account webhooks (document.completed, batch.completed, and the failure events) fire for CLI
submissions just as they do for SDK and API calls. Configure them in the dashboard, or poll
with generation status and batch status.