Skip to navigation

ocpplab-cli

One command per API operation, for your terminal, scripts and AI agents.

ocpplab-cli is a single binary generated from the OCPPLab API. Every operation in the API Reference is a command, grouped by domain:

ocpplab-cli <domain> <resource> <operation> [flags]
ocpplab-cli evcharger catalog list_brands --limit 5

Install

Install it with npm. npm downloads only the binary for your platform: macOS and Linux on x64 or arm64, and Windows on x64.

npm i -g @ocpplab/cli
ocpplab-cli --version

Or run it once without installing:

npx @ocpplab/cli health live

Sign in

ocpplab-cli auth login

auth login opens your browser: sign in, choose the organization, and select Allow. The CLI keeps the access and refresh tokens in your OS keyring and refreshes them on its own. On a machine without a browser, such as CI, set OCPPLAB_TOKEN to an SDK token instead. When both are set, OCPPLAB_TOKEN wins.

CommandDoes
ocpplab-cli auth loginSigns in with your browser
ocpplab-cli auth login --with-tokenReads a token from stdin into the keyring
ocpplab-cli auth statusShows which credential each request will use
ocpplab-cli auth logoutRemoves stored credentials

Your first commands

# Check the API is up
ocpplab-cli health live
# Browse the charger catalog
ocpplab-cli evcharger catalog list_brands --limit 5
# Plug a cable into a virtual charger, then read the command's status
ocpplab-cli evcharger commands plug_connector \
--target.identity DEMO-CP-001 --payload.evse-id 1 --payload.connector-id 1
ocpplab-cli evcharger commands get_status --command-id <command-id>

Nested fields are flags with dots (--target.identity), or pass a whole object as JSON (--target '{"identity": "DEMO-CP-001"}').

Find a command

ocpplab-cli --help # domains
ocpplab-cli evcharger commands --help # operations in a resource
ocpplab-cli evcharger commands start_session --help # flags of one operation

Use it from an AI agent

The CLI prints JSON when its output is piped, and describes itself as JSON:

ocpplab-cli --schema # every operation and its parameters
ocpplab-cli generate-skills # SKILL.md files for coding agents

To give an agent the API as tools instead, see MCP.