OCPP CLI
Project Setup & Generation
Commands for scaffolding projects, generating types, and managing certificates.
ocpp generate
Generates TypeScript declaration files (.d.ts) from custom JSON schemas. This is crucial for ensuring type safety when working with vendor-specific OCPP extensions.
Usage
ocpp generate [options]Options
| Option | Alias | Default | Description |
|---|---|---|---|
--schema | -s | - | Schema URL or local file path. |
--name | -n | - | Subprotocol name (e.g. my-custom-protocol). |
--out | -o | ./@types/ocpp-ws-io | Output directory for the generated files. |
Example
ocpp generate --schema ./custom-schemas/station.json --name vendor-extensions --out ./src/typesocpp certs
A local TLS Certificate Authority (CA) manager. It helps you generate self-signed certificates for development and testing of secure WebSocket connections (WSS).
Usage
ocpp certs [options]Options
| Option | Alias | Default | Description |
|---|---|---|---|
--type | -t | server | Type of certificate to generate: ca, server, or client. |
--identity | -i | - | Common Name (CN) for the certificate (e.g., CP-001, localhost). |
--out | -o | ./certs | Output directory for generated certificates and keys. |
Workflow Example
-
Generate a Root CA:
ocpp certs --type caThis creates
ca.keyandca.crt. -
Generate a Server Certificate (signed by CA):
ocpp certs --type server --identity localhostThis creates
server.keyandserver.crt. -
Generate a Client Certificate (for a Charge Point):
ocpp certs --type client --identity CP-001This creates
client.keyandclient.crt.