Skip to content

feat(cli): scaffold + inspect + report + scenario commands + package config#41

Merged
sepehr-safari merged 1 commit into
mainfrom
feat/cli-package
Jul 7, 2026
Merged

feat(cli): scaffold + inspect + report + scenario commands + package config#41
sepehr-safari merged 1 commit into
mainfrom
feat/cli-package

Conversation

@sepehr-safari

Copy link
Copy Markdown
Member

Summary

Creates the @ocpp-debugkit/cli package with inspect, report, and scenario commands. Also converts JSON fixtures to TS modules to fix Node.js ESM JSON import compatibility.

Closes #25

Changes

New package: packages/cli/

  • src/index.ts — CLI entry point (Commander)
  • src/commands/inspect.tsocpp-debugkit inspect <file>
  • src/commands/report.tsocpp-debugkit report <file> [--format markdown] [--output <file>]
  • src/commands/scenario.tsocpp-debugkit scenario list + scenario run <name>
  • src/utils.ts — file reading with path safety, size limits
  • src/cli.test.ts — 17 integration tests (execa-based)
  • package.json — publish-ready with bin field

Fixture format change

Converted all JSON fixtures to TypeScript modules to fix Node.js ESM JSON import compatibility (ERR_IMPORT_ATTRIBUTE_MISSING):

  • packages/core/src/__fixtures__/*.json*.ts
  • packages/scenarios/src/__scenarios__/*.json*.ts

Note on scenario run

Runs built-in static fixtures through the local analysis engine only. It is NOT active endpoint testing, WebSocket simulation, or live station/CSMS testing.

Verification

  • pnpm lint — ✅
  • pnpm typecheck — ✅
  • pnpm test — ✅ (196 tests)
  • pnpm build — ✅
  • pnpm format:check — ✅

@sepehr-safari sepehr-safari added this to the v0.1.0 — Inspector MVP milestone Jul 7, 2026
@sepehr-safari sepehr-safari added type:feature New feature or enhancement package:cli @ocpp-debugkit/cli labels Jul 7, 2026
…config

- ocpp-debugkit inspect <file> — parse + analyze + output summary
- ocpp-debugkit report <file> — generate Markdown report (stdout or --output)
- ocpp-debugkit scenario list — list all 5 built-in scenarios
- ocpp-debugkit scenario run <name> — run scenario through analysis engine,
  compare detected vs expected failures
- Path safety: validated file paths, size limits
- Input validation: safe parsing, non-sensitive error messages
- 17 integration tests (execa-based)
- Converted JSON fixtures to TS modules (fixes Node.js ESM JSON import issue)

Closes #25
@sepehr-safari sepehr-safari merged commit a959fa4 into main Jul 7, 2026
1 check passed
@sepehr-safari sepehr-safari deleted the feat/cli-package branch July 7, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package:cli @ocpp-debugkit/cli type:feature New feature or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cli): scaffold + inspect + report + scenario commands + package config

1 participant