Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukechampine/jr
A tiny Command Line Interface JavaScript Object Notation Remote Procedure Call client
https://github.com/lukechampine/jr
json-rpc
Last synced: about 1 month ago
JSON representation
A tiny Command Line Interface JavaScript Object Notation Remote Procedure Call client
- Host: GitHub
- URL: https://github.com/lukechampine/jr
- Owner: lukechampine
- License: mit
- Created: 2016-08-29T01:00:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-26T18:48:27.000Z (over 7 years ago)
- Last Synced: 2024-06-19T23:10:02.984Z (7 months ago)
- Topics: json-rpc
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 16
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
jr
==`jr` is a JSON-RPC command-line client written in Go. It is based on
[jsonrpcake](https://github.com/joehillen/jsonrpcake), which was based on
[HTTPie](https://github.com/jkbrzt/httpie). Usage of `jr` should be familiar
to users of those programs.`jr` does not support the `@` syntax or colored output of the aforementioned
programs. I'll add them if someone asks me to.`jr` *does* support an alternative parameter syntax: if you pass a single
value without a `=`, it will be sent without being enclosed in an object.
Ideally, you would be able to send multiple values this way (as an array),
but Go's jsonrpc package does not support this.Installation
------------```
go get github.com/lukechampine/jr
```Usage
-----```bash
# no hostname means localhost
$ jr :3000 hello
Hello, World!# string parameter
$ jr :3000 hello name=Luke
Hello, Luke!# bool parameter
$ jr :3000 hello name=Luke excited:=false
Hey, Luke.# stdin is not processed; must be valid JSON
$ cat | jr :3000 hello
{
"name": "Luke",
"excited": false
}
^D
Hey, Luke.
```