npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ocpp-cp-simulator

v0.10.1

Published

OCPP 1.6 / 2.0.1 / 2.1 charge point simulator: CLI daemon with a Socket.IO control plane, JSON-Lines mode, MCP endpoint, scenario engine and a bundled web console (runs on Bun)

Downloads

503

Readme

OCPP CP Simulator

Ask DeepWiki

OCPP 1.6J charge point simulator for AI agent testing, CI automation, and CSMS development. Comes with a browser UI, a headless CLI, and a Socket.IO control API that any agent or script can drive. Also speaks OCPP 2.0.1 / 2.1 (WebSocket) and OCPP 1.2 / 1.5 / 1.6S (SOAP).

| Interface | Description | Docs | | ----------- | ------------------------------------------------------- | ----------------------------------------------------------------------------------------- | | Browser | Web console at / / Tauri desktop app | Web console · Desktop app | | CLI | Headless mode for scripting, CI, and AI integration | CLI | | Server | Long-running Socket.IO server, multi-CP per process | Daemon · Control plane | | Docker | Pre-built image (daemon + web console) on GHCR | Docker image | | MCP | POST /mcp tools for Claude Code and other MCP clients | MCP endpoint |

Web console — a charge point charging over OCPP 1.6J against SteVe, with labels, its connector card and the message log

See the web console tour for each feature in action, with videos.

Quick Start

# Install dependencies
npm install

# Browser UI (dev server)
npm run dev

# CLI / Server mode (requires Bun)
ocpp-cp-sim --ws-url ws://localhost:9000/ocpp --cp-id CP001

Install as a global command (ocpp-cp-sim; ocpsim and cp-sim are aliases)

# From the npm registry (Bun is needed at run time: the bin runs under a `bun` shebang)
pnpm install -g ocpp-cp-simulator     # or: bun install -g / npm install -g ocpp-cp-simulator

# Without installing
bunx ocpp-cp-simulator --help         # or: npx ocpp-cp-simulator --help

# Prebuilt release tarball (same package, from GitHub)
pnpm install -g https://github.com/shiv3/ocpp-cp-simulator/releases/download/cli-latest/ocpp-cp-simulator.tgz
bun install -g https://github.com/shiv3/ocpp-cp-simulator/releases/download/cli-latest/ocpp-cp-simulator.tgz

# From a local checkout
bun link              # in this repo
bun link ocpp-cp-simulator   # in any other project

The package installs four commands for the same entry point: ocpp-cp-sim, ocpsim, cp-sim and ocpp-cp-simulator (what npx / bunx run).

Every install URL above is fetched by CI, so a URL printed here resolves. Do not use GitHub's releases/latest/download/… — releases made before the trains were unified carry no .tgz, so "latest" can land on one. Use the cli-latest URL below.

releases/download/cli-latest/ocpp-cp-simulator.tgz is a rolling pre-release the Release CLI workflow moves onto every stable CLI release (a SemVer prerelease such as v1.0.0-rc.1 is skipped), so the commands above always install the newest stable CLI. To pin a version, use that release's own asset instead, e.g. releases/download/v0.10.0/ocpp-cp-simulator-0.10.0.tgz. See docs/entities/cli.md.

The release tarballs are produced by the Release CLI workflow on v* tags (the same tag that builds the desktop app, so the CLI and the app share one version). A bare bun install -g github:shiv3/ocpp-cp-simulator does not work — dist/ is built at release time, not committed, and bun doesn't install devDependencies for global packages so the on-install vite build can't run.

Then run from anywhere:

# Interactive REPL against a CSMS
ocpp-cp-sim --ws-url ws://localhost:9000/ocpp --cp-id CP001

# Headless daemon (Socket.IO control API only)
ocpp-cp-sim --daemon --http-port 9700

# Daemon + bundled browser UI on the same origin
#   open http://127.0.0.1:5172 to drive the daemon from the web console
ocpp-cp-sim --http-port 5172 --web-console \
            --cp-id CP001 --connectors 2 \
            --ws-url wss://csms.example.com/ocpp/

# Full kitchen-sink: persistent SQLite, JSON-line logs, demo scenario auto-loaded
ocpp-cp-sim --http-port 5172 --web-console \
            --cp-id CP001 --connectors 5 \
            --ws-url wss://csms.example.com/ocpp/ \
            --scenario-template-file docs/examples/scenarios/demo-charging.json \
            --scenario-connector all \
            --state-db ./state.db --log-format json

--web-console serves the browser UI (built into dist/ and shipped inside the release tarball) from the same HTTP port as the Socket.IO control plane, so a single port is all you need to expose. See CLI for the full flag reference and Control plane for the Socket.IO protocol.

Behind a reverse proxy? Bound to a non-loopback host the daemon applies a safe same-origin CORS policy, so the web console served at a public URL will 403 its own assets until you name that origin with --cors-origin https://your.url (or, behind a trusted proxy, --trust-forwarded-headers). See Access control → Behind a reverse proxy for details and an nginx + Authelia example compose.

Documentation

docs/ is organized as an LLM Wiki: an interlinked knowledge base maintained by an LLM agent under the schema in CLAUDE.md.

Also browsable at https://deepwiki.com/shiv3/ocpp-cp-simulator.

Highlights

  • AI agent & automation testing — structured JSON logs, one Socket.IO rpc/event contract, an MCP endpoint, runtime-injected scenario templates with machine-readable verdicts, an unauthenticated health probe, and SQLite persistence. Minimal recipe and client options: Driving from an AI agent.
  • SOAP versions (1.2, 1.5, 1.6S) — full bidirectional OCPP-S in CLI / server mode, send-only in the browser: OCPP versions & transports.
  • OCPP 1.6 security profiles 1–3 — Basic Auth with AuthorizationKey, server-certificate verification, mutual TLS: Security profiles.
  • Network simulation — seeded latency / jitter, forced and periodic disconnects, delayed reconnect, configured at runtime: Network simulation.
  • Certification scenarios — 47 cert16-* templates covering the OCPP 1.6 test cases, verified against SteVe: Scenario templates.
  • Diagnostics — versioned OCPP trace files and DebugKit reports via ocpp-cp-sim analyze: analyze.
  • Persistence — the browser (sql.js + IndexedDB) and the daemon (--state-db) share one SQLite schema: State persistence.
  • Local vs Remote mode — the browser decides once per load by probing /v1/healthz: Local vs Remote mode.

Contributing

See CONTRIBUTING.md: the checks to run before pushing, the wiki update rule, the contribution terms, and how issues and pull requests are labelled and assigned to milestones. Everyone taking part follows the code of conduct.