Skip to content

reqsh Documentation

Master the interactive HTTP shell. Learn how to install, configure your environment and execute requests efficiently.

Getting Started

1. Install reqsh

Head over to the installation guide to download the binary or build from source.

2. Start the shell

Simply type reqsh in your terminal. This drops you into the interactive REPL.

reqsh
1
reqsh

3. Set a base URL

Define your target host. All subsequent requests in this session will be appended to this base URL automatically.

reqsh
1
reqsh> base https://api.example.com

4. Send a request

Type the HTTP method and the relative path. Then execute it using the special ::send command.

reqsh
1
reqsh> GET /users
2
.....> ::send

Sending Requests

The shell supports building complex requests step-by-step. Start with the method and path. HTTP methods are case-insensitive - GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS are all supported. You can also use absolute URLs, no base URL required. Add headers on the following lines. Leave a blank line to start writing the body.

reqsh
1
reqsh> PATCH /users/1
2
.....> Content-Type: application/json
3
.....>
4
.....> {"name": "Alice"}
5
.....> ::send

The response includes the HTTP version, status code (color-coded), response time, all response headers and the body. JSON responses are automatically pretty-printed with colored syntax.

reqsh
1
HTTP/1.1200 OK 142ms
2
content-type: application/json
3
date: Mon, 01 Jan 2024 00:00:00 GMT
4
 
5
{
6
"id": 1,
7
"name": "Alice"
8
}

Session state (base URL, headers, variables, saved requests) is persisted automatically to ~/.reqsh_state.json and restored when you restart the REPL. Command history is saved to ~/.reqsh_history.

Variables

Store values with set and reference them anywhere in your request using {{name}}. Variables are interpolated at request time.

reqsh
1
reqsh> set token eyJhbGciOiJIUzI1NiJ9
2
reqsh> set host api.example.com
3
reqsh> GET /users/{{token}}
4
.....> Authorization: Bearer {{token}}
5
.....> ::send

Query Parameters

Add query parameters with param: lines. Values are URL-encoded automatically.

reqsh
1
reqsh> GET /users
2
.....> param: page=1
3
.....> param: limit=20
4
.....> ::send

Save & Run

Timeout

Set a default timeout for all requests in a session.

reqsh
1
reqsh> timeout 10
2
Request timeout set to 10 seconds

You can also set a timeout when starting the REPL:

reqsh
1
reqsh --timeout 30

Clear Session

Reset the entire session state — base URL, headers, variables, and saved requests.

reqsh
1
reqsh> clear
2
Session cleared

Session Persistence

Your session state is automatically saved to ~/.reqsh_state.json when you exit and restored when you start the REPL again.

Save & Run

Save a request to session memory after executing it, then run it again instantly without retyping.

reqsh
1
reqsh> GET /users/{{id}}
2
.....> ::send
3
reqsh> save get-user
4
saved
5
reqsh> run get-user