1
Run it
There is nothing to install for a one-off:
npx @trylath/cli fetches and runs it. Installed, the binary is lath.With no arguments it prints the whole command list — every operation, with the sentence describing what it does.2
Store a key
lath init writes the key to ~/.lath/config.json with mode 600, so it is not passed on every command and does not land in your shell history.LATH_API_KEY overrides the file, which is what CI should use — an empty value counts as unset, because a template that exports LATH_API_KEY="" is more common than one that unsets it. LATH_BASE_URL and LATH_CONFIG_DIR override the rest.Without a key you get no_key and the fix, not a stack trace.3
Call an operation
The shape is
lath <product> <name...> with one flag per field. --json takes the whole input at once, which is easier to generate and easier to paste from the reference.A field the registry declares as an array is repeatable: pass the flag more than once.Anything not retry-safe takes --idempotency-key, and the CLI tells you which those are.4
Ask the CLI instead of the docs
--help on any command prints that operation’s fields with their types, which are required, and any enum values — plus the three facts you need before calling it: whether it reads or writes, whether retrying is safe, and the permission the key must have.This is generated from the registry, so it is never out of date with the API in the way a written page can be.5
Errors, and exit codes
A refusal prints the code and message on stderr, then the fix on its own line after an arrow. The exit code is non-zero, so a CI step fails rather than continuing quietly.The code is the same string the REST and MCP surfaces return, so a script can branch on it without parsing prose.
6
An MCP server for a local agent
lath mcp runs an MCP server over stdio, which is how you attach a local agent that does not speak HTTP MCP — it uses the key the CLI already has, so there is no second credential to configure.The hosted endpoint is the other option and needs no install: POST https://platform.trylath.com/mcp.
