Coder Social home page Coder Social logo

openrpc-cli's Introduction

openrpc-cli

a command line tool for OpenRPC

Table of Contents

Installation

Running from source

git clone https://github.com/habenamare/bounty-openrpc-project
cd bounty-openrpc-project

npm install   # If using `npm`
yarn          # If using `yarn`

./bin/run     # Run the openrpc-cli program

Pack using pkg to create a single executable

The single executables created using pkg may be too big. This is because they include Node.js.

npm run build # If using `npm`
yarn build    # If using `yarn`

pkg package.json # After running `yarn` or `npm install`

Features

  • Make a single OpenRPC document from multiple files that are linked via $ref
  • Execute JSON-RPC requests to methods defined inside an OpenRPC document
  • Validate an OpenRPC document
  • YAML support

Usage

Use the help command or the --help option to get more info about the commands and their options.

openrpc-cli COMMAND [OPTIONS] FILE

FILE can be either a JSON file or a YAML file with a yaml or yml extension.

Bundle

Make a single OpenRPC document from multiple files that are linked via $ref

$ openrpc-cli bundle FILE

Options

  -f, --format=json|yaml  the output format [default: json]
  -o, --output=<file>     place the output into <file>, the default output is 'stdout'
  -s, --substitute        substitute $ref pointers with their resolved value

Examples

$ openrpc-cli bundle root-openrpc.json > output.json
$ openrpc-cli bundle root-openrpc.yaml > output.json
$ openrpc-cli bundle root-openrpc.yml > output.json

$ openrpc-cli bundle -f yaml root-openrpc.json > output.yaml

$ openrpc-cli bundle -o output.json root-openrpc.json
$ openrpc-cli bundle -f yaml -o output.yaml root-openrpc.json

$ openrpc-cli bundle -s root-openrpc.json
$ openrpc-cli bundle -s -f yaml root-openrpc.json
$ openrpc-cli bundle -s -f yaml -o output.yaml root-openrpc.json

Inspect

Execute JSON-RPC requests to methods defined inside an OpenRPC document

$ openrpc-cli inspect FILE

When connecting to a server, the following protocols are supported.

  • HTTP/HTTPS
  • WebSocket

Validate

Validate an OpenRPC document

$ openrpc-cli validate FILE

Dependencies

This project is inspired by swagger-cli and it makes use of the following great open-source libraries (in alphabetical order).

Dependency License
ajv MIT License
chalk MIT License
cli-highlight ISC License
Inquirer.js MIT License
JS-YAML MIT License
JSON Schema $Ref Parser MIT License
oclif MIT License
OpenRPC Client JS Apache License 2.0

License

This project is under the Apache License 2.0.

Notes

This project was forked from https://github.com/etclabscore/bounty-openrpc-project and was authored by: https://github.com/habenamar

openrpc-cli's People

Contributors

habenamare avatar semantic-release-bot avatar shanejonas avatar stevanlohja avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.