feat(ui-cli): add custom JSON payload option for OCPP and transaction commands
Add -p, --payload <json|@file|-> to all 16 OCPP commands and both
transaction commands. Supports three input modes:
- Inline JSON: -p '{"reason":"PowerUp"}'
- File: -p @collections/boot.json
- Stdin: echo '{}' | evse-cli ocpp heartbeat -p -
Payload is merged beneath command-specific options (--id-tag, etc.)
so CLI flags always take precedence.
Implementation:
- New resolve-payload.ts: async resolver with validation (object check,
empty check, JSON parse error with preview)
- Payload resolution integrated into runAction try/catch for clean
error handling (no stack traces on user input errors)
- PAYLOAD_OPTION/PAYLOAD_DESC constants shared via payload.ts
- 11 unit tests for resolvePayload (inline, @file, edge cases)
- README and SKILL.md updated with examples