CLI
Use the Monta Partner API from your terminal — every endpoint as a command.
CLI
The Monta Partner API CLI (monta) lets you call the Partner 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 Partner 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:
npm install -g @monta-api/cli
monta --helpAuthentication
Authenticate with the same Client ID and Client Secret you use for the Partner API. The CLI resolves credentials in this order (highest priority first):
| Priority | Method | Example |
|---|---|---|
| 1 | CLI flags | monta --client-id X --client-secret Y charges list |
| 2 | Environment variables | MONTA_CLIENT_ID + MONTA_CLIENT_SECRET |
| 3 | Bearer token | MONTA_BEARER_TOKEN |
| 4 | Saved profile | created 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:
monta --client-id YOUR_ID --client-secret YOUR_SECRET auth login
monta auth whoamiTo keep separate credentials for different environments, use named profiles:
# 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 listQuick start
# 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 method | CLI action | Example |
|---|---|---|
GET /resource | list | monta charge-points list |
GET /resource/{id} | get | monta charge-points get 12345 |
POST /resource | create | monta sites create --body '{...}' |
PATCH/PUT /resource/{id} | update | monta sites update 456 --body '{...}' |
DELETE /resource/{id} | delete | monta 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:
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 pipingjson (pretty-printed) is the default.
Updated 1 day ago