Skip to main content

Authenticate

In CI, skip invoice-ai login and set INVOICE_AI_API_KEY:
The CLI uses the first key it finds: --api-key, then INVOICE_AI_API_KEY, then the saved profile. Give a CI key only the scopes the job needs.

JSON output

Output is a table in a terminal and JSON when piped. Pass --json to force JSON, or --format csv.
A single object prints as the object. A list prints as { "data": [...], "next_cursor": ... }. Messages and errors go to stderr, so stdout stays valid JSON.

No prompts

  • send, void, delete and archive ask for confirmation. Pass --yes to skip it.
  • invoices create starts a wizard in a terminal. Pass --no-interactive with flags such as --customer and --price.
  • When CI is set or there’s no terminal, the CLI never prompts. A command that needs a prompt exits with code 2.

Exit codes

GitHub Actions example

Send every draft invoice each Monday:
.github/workflows/send-invoices.yml
The key needs invoices:read and invoices:send. Sending is capped at 10 emails per hour per key and 50 per account, so a large batch stops with exit code 4.