CLI
The Beliq command-line tool. Validate, generate, parse, and convert EN 16931 e-invoices from the terminal or CI, with exit codes for scripts.
Listing pending
The beliq CLI wraps the same API as the SDKs for the terminal and CI. It is a thin layer over the Node SDK, so validation, generation, parsing, and conversion behave identically to every other path.
- Package:
beliq-clion npm (binarybeliq) - Source: github.com/beliq-eu/beliq-cli
Install
npm install -g beliq-cli
# or run without installing
npx beliq-cli validate invoice.xml
Authentication
The CLI reads your key from --api-key or the BELIQ_API_KEY environment variable (the flag wins over the env):
export BELIQ_API_KEY="blq_..."
beliq me # zero-quota credential check
Commands
| Command | What it does |
|---|---|
beliq validate <files...> |
Validate one or many XML or PDF invoices against authority-pinned rules |
beliq generate <data.json> |
Generate a document from an EN 16931 invoice |
beliq parse <file> |
Extract a canonical JSON invoice from XML or a hybrid PDF |
beliq convert <file> |
Convert within the EN 16931 family (CII, UBL, and profiles) |
beliq me |
Confirm a key works, with no quota cost |
Batch validation
validate accepts many file arguments, shell globs, and a directory (walked recursively over .xml and .pdf). It prints a per-file verdict and an aggregate summary:
beliq validate invoices/ # every .xml / .pdf under invoices/
beliq validate "out/*.xml" --fail-on error
Exit codes
The exit code is the contract for scripts and CI:
| Code | Meaning |
|---|---|
0 |
All documents valid |
1 |
A document is invalid (per --fail-on) |
2 |
Usage error |
3 |
API error (auth, quota, rate limit) |
4 |
I/O error (file not found or unreadable) |
--json prints the raw result (a batch report { total, passed, failed, errored, results } in batch mode) as the only thing on stdout, so piped output stays clean; human-readable output goes to stderr.
See also
- Node SDK: the client the CLI wraps.
- GitHub Action: run the same validation in a pull request.
- Quickstart: the underlying API in five minutes.