Commands
Beyond standard HTTP methods (GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS), reqsh provides specific REPL commands to manage your session.
Command Reference
| Command | Usage | Description |
|---|---|---|
base | base <url> | Set the global base URL for the session. |
header | header <key> <value> | Add a persistent header applied to all requests. |
set | set <name> <value> | Store a variable for interpolation. |
unset | unset <name> | Remove a variable. |
unset header | unset header <key> | Remove a global header. |
save | save <name> | Save the last executed request to memory. |
run | run <name> | Execute a saved request. |
vars | vars | List all session variables. |
headers | headers | List all global headers. |
requests | requests | List all saved requests. |
history | history | View the numbered history of past commands. |
rerun | rerun <id> | Instantly re-execute a request from history. |
timeout | timeout <seconds> | Set the request timeout for the session. |
clear | clear | Reset the entire session state (base URL, headers, variables, saved requests). |
help | help | Display syntax and command documentation. |
exit | exit | Terminate the shell session. |
Session Management
Save and Run
Save any request after executing it, then replay it instantly.
reqsh
1
reqsh> GET /users/{{id}}
2
.....> ::send
3
reqsh> save get-user
4
saved
5
reqsh> run get-user
History
View all commands executed in the current session.
reqsh
1
reqsh> history
2
1: base https://api.example.com
3
2: header Authorization Bearer sk_test
4
3: GET /users
Rerun
Re-execute a command from history by its ID.
reqsh
1
reqsh> rerun 3
Variables
Set and Use
Store values and reference them with {{name}} syntax.
reqsh
1
reqsh> set token eyJhbGciOiJIUzI1NiJ9
2
reqsh> GET /users/{{token}}
3
.....> ::send
List and Remove
reqsh
1
reqsh> vars
2
reqsh> unset token
Timeout
Set a request timeout for all requests in the session.
reqsh
1
reqsh> timeout 10
2
Request timeout set to 10 seconds
Clear
Reset the entire session, base URL, headers, variables and saved requests.
reqsh
1
reqsh> clear
2
Session cleared
Help
Display the built-in help with all available commands and syntax.
reqsh
1
reqsh> help