Install
Homebrew on macOS and Linux installs the binary, the man page and the shell completions:lago version prints the CLI version and the API spec version it was built from. lago upgrade tells you whether a newer release exists and the command to install it.
Configure
Get an API key from Developers > API keys in the Lago app, then:init checks the key against the API before saving anything to ~/.config/lago/config.toml. Pass the base URL only: the CLI adds /api/v1. The dashboard URL (app.getlago.com) is refused, because it is not the API.
lago whoami shows the profile and the exact host requests go to. lago doctor checks configuration, network, and authentication.
First commands
lago seed demo creates a full chain (metric, plan, customer, subscription, event, invoice preview) in one command.
How it works
Flags are API fields
Asnake_case field is a --kebab-case flag. Nested fields carry their parent as a prefix. Objects and arrays take JSON. --input sends a whole request body.
Creates print identifiers
Acreate or update prints the identifier block. Add --output json for the full resource.
Responses are wrapped
The API wraps every response in its resource name. A--query starts with that wrapper. A query that matches nothing prints null and lists the available keys on stderr.
Destructive operations ask first
delete, void, finalize, terminate, and retry-payment prompt for the identifier. In a script, pass it with --confirm.
Live is the default mode
--mode test is a safety declaration, not a sandbox. Live mode prints [LIVE] and gates destructive operations. Credentials passed by flag or environment run live unless you set a mode.
Nothing is sent on --dry-run
The CLI prints the method, URL, redacted headers, and exact body. No connection is opened.
Scripting
Exit codes
Money is exact:
*_amount_cents are integers, units are decimal strings. The CLI sends no telemetry.
Command reference
One page per command group, with commands and their output side by side.
API reference
The schemas the CLI is generated from.