OCPP WS IOOCPP WS IO
OCPP CLI

CLI Ecosystem

CLI tools for scaffolding, testing, and debugging your OCPP infrastructure.

The ocpp-ws-io CLI

The ocpp-ws-io ecosystem includes CLI tools for building, testing, and debugging OCPP infrastructure. Some are stable and shipping today, others are in beta or on the roadmap.

Installation
You can install the CLI globally via npm install -g ocpp-ws-cli, or run it on the fly using npx ocpp-ws-cli <command>.

Command Status: Not all CLI commands are at the same maturity level. Commands marked [stable] are fully implemented and tested. Commands marked [beta] work but may change. Commands marked [planned] are documented for roadmap visibility but not yet available.


🏗️ 1. Building & Scaffolding

These commands help you write code faster by automating boilerplate and TypeScript configuration.

ocpp generate [stable]

What it does: Reads your custom .json OCPP schemas and generates perfectly typed .d.ts declaration files.
When to use it: When your hardware vendor provides custom DataTransfer methods and you want full IDE autocomplete in your handlers.

ocpp generate --schema ./schemas/custom-cp.json --name custom-1.6

🏎️ 2. Testing & Simulation

Testing Websockets is notoriously difficult. These tools allow you to simulate hardware and stress-test your server.

ocpp simulate [stable]

What it does: Spins up an interactive, automated Charge Point simulator.
When to use it: When you need a virtual charger to connect to your CSMS so you can rapidly test your BootNotification and Heartbeat database logic.

ocpp simulate --identity CP-001 --endpoint ws://localhost:3000/ocpp

ocpp load-test [stable]

What it does: A distributed load testing engine capable of simulating thousands of concurrent Charge Point connections.
When to use it: When you've configured Redis Clustering and Rate Limiting, and want to prove your infrastructure can handle massive traffic spikes.

ocpp load-test --clients 1000 --ramp-up 20 --endpoint wss://api.csms.com/ocpp

ocpp fuzz [stable]

What it does: A protocol fuzzer that aggressively spams your server with malformed strings, invalid arrays, and schema-breaking anomalies.
When to use it: To guarantee your CSMS Strict-Mode validators and crash-guards are correctly dropping bad actors before they crash Node.js.

ocpp fuzz --endpoint ws://localhost:3000/ocpp --workers 20 --flood

🔎 3. Compliance & Auditing

When you need to ensure your implementation strictly adheres to the OCPP specification and security profiles.

ocpp test [stable]

What it does: Runs OCTT (Open Charge Point Testing Tool) style compliance tests against a running OCPP server.
When to use it: When you're ready for certification or need to verify your transport and RPC layers strictly follow OCPP specification.

ocpp test --endpoint ws://localhost:3000/ocpp --suite rpc --report md

ocpp audit [stable]

What it does: An interactive wizard for production security auditing.
When to use it: Before deploying to production, to ensure your endpoints are properly secured and reject unauthenticated or legacy protocol connections.

ocpp audit --endpoint wss://api.csms.com/ocpp

🔒 4. Security & Development Tools

Utilities for handling complex hardware requirements like Mutual TLS and mocking dashboards.

ocpp certs [stable]

What it does: Operates as a local Certificate Authority utilizing OpenSSL to generate .pem files.
When to use it: When you are implementing Security Profile 2 (TLS) or Profile 3 (mTLS) and need immediate spoofed client/server certificates to validate your handshake logic.

ocpp certs --type client --identity CP-001 --out ./certs

ocpp mock [stable]

What it does: An HTTP Server-Sent Events (SSE) stream that endlessly spits out dummy OCPP telemetry data.
When to use it: When your Frontend/React developers are building the fleet dashboard and need a fast stream of mock MeterValues without running a real server.

ocpp mock --port 8080 --rate 500

Need Help?

You can access the command list and flags at any time directly in your terminal:

ocpp -h

On this page