@@ -14,25 +14,24 @@ $ sh -c "$(curl -sL https://git.io/getpwcli)"
1414
1515- Clone the repo
1616
17- ```
17+ ``` shell
1818$ git clone https://github.com/hoppscotch/hopp-cli.git
1919```
2020
2121- Build and install
2222
23- ```
23+ ``` shell
2424$ make
25-
2625$ sudo make install
2726```
2827
2928### From Binary
3029
31- - You can find the Binaries in Gzipped form from the [ Releases] ( https://github.com/athul/pwcli /releases ) page
32- ** Supports **
33- - Linux(x64,x86)
34- - Mac(x64)
35- - Windows(x64,x86)
30+ - You can download prebuilt binaries from the [ Releases] ( https://github.com/hoppscotch/hopp-cli /releases ) page.
31+ - ** Supported platforms ** :
32+ - Linux (x64, x86)
33+ - Mac (x64)
34+ - Windows (x64, x86)
3635
3736> ** IMPORTANT: Not tested on Windows, please leave your feedback/bugs in the Issues section**
3837
@@ -49,16 +48,30 @@ hopp-cli-git | https://aur.archlinux.org/packages/hopp-cli-git/ | Compiled fro
4948
5049### Homebrew
5150
52- Install by ` brew install athul/tap/hopp-cli `
51+ Install by
52+
53+ ``` shell
54+ brew install athul/tap/hopp-cli
55+ ```
56+
57+ ### Windows
58+
59+ You can download pre-built binaries from the [ Releases] ( https://github.com/hoppscotch/hopp-cli/releases ) page.
60+
61+ Alternatively, you can install ` hopp-cli ` via [ Scoop] ( https://scoop.sh/ ) :
62+
63+ ``` shell
64+ scoop install hopp-cli
65+ ```
5366
5467## Usages
5568
5669Putting Simply: ** Just pass the URL to the request method**
5770
5871### Basic Commands
5972
60- - GET : ` $ hopp-cli get <url> `
61- - POST: ` $ hopp-cli post <url> `
73+ - GET : ` $ hopp-cli get <url> `
74+ - POST: ` $ hopp-cli post <url> `
6275- PATCH: ` $ hopp-cli patch <url> `
6376- PUT : ` $ hopp-cli put <url> `
6477- DELETE: ` $ hopp-cli delete <url> `
@@ -67,27 +80,38 @@ Example for a POST request:
6780
6881``` shell
6982$ hopp-cli post https://reqres.in/api/users/2 -c js -b ' {"name": "morp","job": "zion resident"}'
70-
7183```
7284
7385### Extra Commands
7486
7587- ` send ` for testing multiple endpoints
7688- ` gen ` for generating API docs from Collection
7789
78- ** SEND** : This can be used to test multiple endpoints from the ` hoppscotch-collection.json ` file.
90+ #### SEND
91+
92+ This can be used to test multiple endpoints from the ` hoppscotch-collection.json ` file.
7993
8094> The output will only be the ` statuscode `
8195
82- Example : ` hopp-cli send <PATH to hoppscotch collection.json> `
96+ Example:
8397
84- Sample Output:
85- ![ ] ( /assets/send.png )
98+ ``` shell
99+ $ hopp-cli send < PATH to hoppscotch-collection.json>
100+ ```
101+
102+ Sample output:
103+
104+ ![ send-output] ( /assets/send.png )
105+
106+ #### GEN
86107
87- ---
108+ The ` gen ` command generates the API documentation from ` hoppscotch-collection.json ` file and serves it as a static page on port ` 1341 ` .
88109
89- ** GEN** : Gen command Generates the API Documentation from ` hoppscotch-collection.json ` file and serves it as a Static Page on port ` 1341 `
90- Example: ` hopp-cli gen <PATH to hoppscotch collection.json> `
110+ Example:
111+
112+ ``` shell
113+ $ hopp-cli gen < PATH to hoppscotch-collection.json>
114+ ```
91115
92116Sample Hosted site: https://hopp-docsify.surge.sh/
93117
@@ -106,10 +130,9 @@ _(optional)_
106130- ` -u ` for the ` Username ` in Basic Auth
107131- ` -p ` for the ` password ` in Basic Auth
108132
109- ### There are 2 flags especially for the data management requests like POST,PUT,PATCH and DELETE
133+ ### There are 2 flags especially for the data management requests like POST, PUT, PATCH and DELETE
110134
111135- ` -c ` or ` --ctype ` for the _ Content Type_
112-
113136- ` -b ` or ` --body ` for the Data Body, this can be of json, html or plain text based on the request.
114137
115138> Enclose the body in Single Quotes(\' )
@@ -124,20 +147,28 @@ _(optional)_
124147| ` plain ` | ` text/plain ` |
125148
126149### Include Arbitrary Headers
150+
127151- ` -H ` or ` --header ` may be specified multiple times to include headers with the request.
128- - Example:
129- - ` hopp-cli get -H 'X-Api-Key: foobar' -H 'X-Api-Secret: super_secret' https://example.com/api/v1/accounts `
152+
153+ Example:
154+
155+ ``` shell
156+ $ hopp-cli get -H ' X-Api-Key: foobar' -H ' X-Api-Secret: super_secret' https://example.com/api/v1/accounts
157+ ```
130158
131159### Providing a Request Body via stdin
132160
133- In addition to ` -b ` /` --body ` , you may provide a request body via stdin.
161+ In addition to ` -b ` /` --body ` , you may provide a request body via stdin.\
134162If you combine this method with the ` -b ` flag, the body provided with ` -b ` will be ignored.
135163
136164** Example with Pipes**
165+
137166``` shell
138167$ echo ' {"foo":"bar"}' | hopp-cli post -c js http://example.com
139168```
169+
140170** Example with Redirection**
171+
141172``` shell
142173$ cat myrequest.json
143174{
0 commit comments