Skip to content

feat: add native OpenRPC support - #25

Merged
EvilFreelancer merged 1 commit into
EvilFreelancer:mainfrom
viktor-drobek:feature/openrpc-support
Sep 22, 2026
Merged

EvilFreelancer merged 1 commit into
EvilFreelancer:mainfrom
viktor-drobek:feature/openrpc-support

Conversation

@viktor-drobek

Copy link
Copy Markdown
Collaborator

What changed

ocli now accepts OpenRPC JSON and YAML documents through the existing --openapi-spec option. It creates one command for each documented RPC method and sends JSON-RPC 2.0 requests automatically.

  • Added OpenRPC method transformation with named parameters as CLI options.
  • Added JSON-RPC request envelopes for OpenRPC commands.
  • Kept --api-base-url as the primary request target, with the first OpenRPC server URL as fallback.
  • Added a minimal OpenRPC fixture, transform test, and CLI request integration test.
  • Updated README and the Claude Code and OpenClaw skill instructions.

Verification

  • npx jest tests/openrpc-to-commands.test.ts tests/openrpc-cli.test.ts --runInBand
  • npm test -- --runInBand with 122 passing tests and 26 expected fixture-dependent skips
  • npm run build

Example

ocli profiles add widgets \
  --api-base-url https://api.example.com/rpc \
  --openapi-spec ./openrpc.json

ocli getWidget --widgetId widget-7

The generated request body is:

{
  "jsonrpc": "2.0",
  "method": "getWidget",
  "params": { "widgetId": "widget-7" },
  "id": 1
}

@EvilFreelancer
EvilFreelancer merged commit ea9f737 into EvilFreelancer:main Sep 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants