Monta
Tools & Access

CLI

Use the Monta Partner API from your terminal — every endpoint as a command.

CLI

The Monta API CLI (monta) lets you call the Monta API directly from your terminal. Every API endpoint is available as a command, so you can script automations, run quick lookups, and pipe results into other tools — without writing any integration code.

What can it do?

  • Full API coverage — one command per Monta API endpoint, always in sync with the API
  • Scriptable — ideal for bulk operations, scheduled jobs, and CI/CD pipelines
  • Multiple output formats — JSON, table, CSV, or raw (for piping to jq)
  • Multi-profile auth — switch between production, staging, and test credentials
  • OAuth handled for you — pass your Client ID and Secret; token refresh is automatic

Installation

Requires Node.js 18 or newer.

Install globally to get the monta command everywhere:

TerminalCode
npm install -g @monta-api/cli monta --help

npx (no install)

Run without installing:

TerminalCode
npx @monta-api/cli charge-points list

Launcher script

Download a self-contained launcher (no npm required) — it fetches and caches the CLI, auto-updating every 24 hours:

TerminalCode
curl -o monta-cli.sh https://partner-api-mcp.monta.app/scripts/monta-cli.sh chmod +x monta-cli.sh ./monta-cli.sh --help

Authentication

Authenticate with the same Client ID and Client Secret you use for the Monta API. The CLI resolves credentials in this order (highest priority first):

PriorityMethodExample
1CLI flagsmonta --client-id X --client-secret Y charges list
2Environment variablesMONTA_CLIENT_ID + MONTA_CLIENT_SECRET
3Bearer tokenMONTA_BEARER_TOKEN
4Saved profilecreated with monta auth login

Don't have credentials yet?

See Authentication for how to obtain a Client ID and Client Secret.

Save your credentials

Store credentials once so you don't repeat them on every command:

TerminalCode
monta --client-id YOUR_ID --client-secret YOUR_SECRET auth login monta auth whoami

To keep separate credentials for different environments, use named profiles:

TerminalCode
# Save staging credentials under a profile monta --client-id STG_ID --client-secret STG_SECRET --profile staging auth login # Use that profile monta --profile staging charge-points list

Quick start

TerminalCode
# List your charge points monta charge-points list # Get a single charge point monta charge-points get 12345 # List charges (sessions) in a date range monta charges list --state completed --fromDate 2024-01-01 --toDate 2024-12-31 # Start a charge monta charges create --body '{"chargePointId": 12345}'

Commands follow a predictable pattern based on the API:

HTTP methodCLI actionExample
GET /resourcelistmonta charge-points list
GET /resource/{id}getmonta charge-points get 12345
POST /resourcecreatemonta sites create --body '{...}'
PATCH/PUT /resource/{id}updatemonta sites update 456 --body '{...}'
DELETE /resource/{id}deletemonta sites delete 456

Run monta --help, or monta <resource> --help, to discover every available command.

Output formats

Use -o / --output to control how results are printed:

TerminalCode
monta charges list -o table # aligned ASCII table monta charges list -o csv # CSV, ready for spreadsheets monta charges list -o raw | jq # compact JSON for piping

json (pretty-printed) is the default.

Last modified on