PDF CLI
Convert documents to PDF from the command line — without starting an HTTP server.
The ANNÁVE PDF Engine ships a CLI binary (annave) that runs the full conversion pipeline locally. No server, no HTTP — useful for scripts, CI pipelines, and one-off conversions where starting an HTTP server is unnecessary overhead.
Build the CLI
Build the annave binary from the repository root:
go build -o annave ./cmd/cliMove the binary to a directory on your $PATH to use it from anywhere:
mv annave /usr/local/bin/annaveCommands
annave pdf convert
Convert a document file to PDF. The --format flag is optional — the engine infers the format from the file extension by default.
annave pdf convert [file] [flags]| Flag | Short | Default | Description |
|---|---|---|---|
| --output | -o | stdout | Output PDF path. Omit to write PDF bytes to stdout. |
| --format | -f | auto | Input format: md, html, docx, csv, json, yaml, xml, rst, ipynb, png, jpg, gif, webp, txt |
| --stdin | false | Read input from stdin instead of a file argument | |
| --style | (none) | Per-document style override as JSON, e.g. '{"paragraph":{"fontSize":14}}' |
Examples
Common conversion patterns. All produce a valid PDF to the specified output path, or to stdout if --output is omitted.
# Convert a Markdown file
annave pdf convert README.md -o output.pdf
# Convert a Word document
annave pdf convert report.docx -o report.pdf
# Convert CSV to a table PDF
annave pdf convert data.csv -o table.pdf
# Read from stdin (pipe-friendly)
cat spec.md | annave pdf convert --stdin --format md > spec.pdf
# Override font size
annave pdf convert README.md -o big.pdf --style '{"paragraph":{"fontSize":14}}'annave pdf serve
Start the HTTP server (same as running the server binary directly).
annave pdf serve [--port 5741]annave version
Print the installed engine version and exit.
annave version
# ANNÁVE PDF Engine v1.0.0Exit codes
| Code | Meaning |
|---|---|
| 0 | Conversion succeeded |
| 1 | Error — message printed to stderr with the ENGINE_ERR_* code |
Error output goes to stderr; PDF bytes go to stdout. This makes the CLI safe to use in pipelines — you can redirect stdout to a file without mixing in error messages.
CI / scripting example
Generate a PDF artifact as part of a CI pipeline. The script exits with code 1 if conversion fails, which causes the CI step to fail.
#!/bin/bash
# Generate a PDF report in CI and upload as an artifact
annave pdf convert report.md -o dist/report.pdf \
&& echo "PDF generated: dist/report.pdf" \
|| exit 1