OCPP WS IOOCPP WS IO
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

OptionAliasDefaultDescription
--schema-s-Schema URL or local file path.
--name-n-Subprotocol name (e.g. my-custom-protocol).
--out-o./@types/ocpp-ws-ioOutput directory for the generated files.

Example

ocpp generate --schema ./custom-schemas/station.json --name vendor-extensions --out ./src/types

ocpp 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

OptionAliasDefaultDescription
--type-tserverType of certificate to generate: ca, server, or client.
--identity-i-Common Name (CN) for the certificate (e.g., CP-001, localhost).
--out-o./certsOutput directory for generated certificates and keys.

Workflow Example

  1. Generate a Root CA:

    ocpp certs --type ca

    This creates ca.key and ca.crt.

  2. Generate a Server Certificate (signed by CA):

    ocpp certs --type server --identity localhost

    This creates server.key and server.crt.

  3. Generate a Client Certificate (for a Charge Point):

    ocpp certs --type client --identity CP-001

    This creates client.key and client.crt.

On this page