a command line tool for OpenRPC
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
The single executables created using
pkg
may be too big. This is because they includeNode.js
.
npm run build # If using `npm`
yarn build # If using `yarn`
pkg package.json # After running `yarn` or `npm install`
$ref
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.
Make a single OpenRPC document from multiple files that are linked via
$ref
$ openrpc-cli bundle FILE
-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
$ 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
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.
Validate an OpenRPC document
$ openrpc-cli validate FILE
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 |
tslib | BSD Zero Clause License |
This project is under the Apache License 2.0.