CLI
Install the moniary command, sign in through your browser and work with Moniary from the terminal, scripts, CI and AI agents.
moniary is the Moniary command line tool. It finds and runs API actions, uploads documents for extraction and waits for the result. It prints JSON, so it works well with tools like jq and with AI agents.
Install
You need Node.js 20 or newer.
npm install -g @moniary/cli
moniary --version
To try it without installing:
npx @moniary/cli login
Run npm install -g @moniary/cli again to update.
Sign in
moniary login
Your browser opens. Sign in to Moniary, pick the company and the access level (Read or Read and write) and click Allow access. The CLI gets its own key called "CLI (your computer's name)". You'll find it in Settings → API and CLI, where you can revoke it at any time.
Check who you're signed in as:
moniary whoami
{
"key": {
"name": "CLI (macbook)",
"prefix": "mny_RTE5jErA",
"scope": "write"
},
"user": { "email": "jana@example.com" },
"workspace": { "name": "Example s.r.o." }
}
On a server without a browser, run moniary login --no-browser and open the printed link on another device. Or pass a key you created in the app:
moniary login --key mny_…
echo "$MONIARY_API_KEY" | moniary login
The sign-in is saved in ~/.config/moniary/cli.json, readable only by you. To work with another company, sign in again and pick it. moniary logout removes the saved sign-in from your computer; the key itself stays valid until you revoke it in the app.
Commands
| Command | What it does |
|---|---|
moniary login | Sign in through the browser |
moniary whoami | Show the key, user and company |
moniary actions [search] [--area <area>] [--json] | List the actions your key can run |
moniary describe <action> | Show an action and its input schema |
moniary run <action> [json|-] [key=value …] | Run an action and print the result |
moniary upload <files…> [--wait] | Upload documents for extraction |
moniary uploads <id> | Show extraction progress |
moniary logout | Remove the saved sign-in |
moniary --version, moniary --help | Version and help |
Run actions
Find an action and look at its input:
moniary actions invoice
moniary describe invoices.getInvoiceStats
Run it. Pass the input as JSON, as key=value pairs, or on standard input:
moniary run invoices.getInvoiceStats
moniary run invoices.getInvoiceStats '{"filter": {"overdue": true}}'
moniary run tags.create name="Fuel" color='"#3b82f6"'
cat draft.json | moniary run issuedInvoices.saveDraft -
A key=value value is read as JSON when possible (pageSize=20 is a number, overdue=true a boolean) and as text otherwise. Every action and its input is in the API reference.
Upload documents
moniary upload invoice.pdf receipts/*.jpg
moniary upload invoice.pdf --wait
With --wait, the CLI waits until the documents are extracted (up to 10 minutes) and prints the result, including the numbers of the documents it created. Without it, it prints an uploadSessionId you can check later:
moniary uploads On3iHRaS2JhErPH2Ai
Supported files and limits are on the Uploading documents page.
Scripts and CI
In scripts and CI, don't sign in through the browser. Create a key in the app and pass it in an environment variable:
export MONIARY_API_KEY=mny_…
moniary run invoices.getOverdueInvoices | jq '.[].invoiceNumber'
| Variable | Meaning |
|---|---|
MONIARY_API_KEY | The key; takes precedence over the saved sign-in |
MONIARY_API_URL | Another API address (default https://moniary.com/api/v1) |
Results go to standard output and errors to standard error. The exit code is 0 on success, 1 when the API returns an error (such as invalid input or a missing permission) and 2 when the command is used incorrectly.
With AI agents
Agents such as Claude Code, Codex or Cursor can use the CLI on their own. See For AI agents.