TReq
A Terminal Request HTTP Client. TReq is a user-friendly Command Line Interface (CLI) HTTP client, designed to be simple and a complete CLI tool to interact with APIs. With options to save and edit frequently used requests with simple commands to run them again later. Imagine a workflow like GUI tools for HTTP requests in terminal.

Features
- Made to APIs and REST: TReq is tailored for working with APIs, REST, and JSON with minimal effort.
- HTTPie based: The CLI interface is entirely based on HTTPie, and seeks to implement and extend its main features (a superset of HTTPie's).
- Persistent Request Storage: Save and edit frequently used requests with simple commands to run them again later. Imagine a workflow like GUI tools for HTTP requests in terminal.
- Pretty Outputs: The UX is relevant in a CLI.
Examples
Basic requests
POST with custom header and json payload
Submit and saving the request locally as "main-endpoint" with --save-as flag
Executing saved request with run command
Executing it adding more data
A pratical usage...
# Create a user and save the request for make it again later
# Make the same request for create a user "Jane"
# Editing saved request
Installation
Ubuntu / Debian based
Download the latest .deb package from the last release page. Open your terminal and navigate to the directory where the downloaded .deb file is located. Install TReq using the following command:
Alternatively, you can try:
Arch / Manjaro
If you're using Arch Linux, you can install TReq from the AUR using an AUR helper such as yay:
Cargo
For any OS, the best way to install TReq is using cargo.
Install cargo using rustup and then...
Linux generic
TReq's binary is statically linked and has no dependencies, making it compatible with most major Linux distributions. To install, download the binary from the latest release page and place it in your PATH directory.
Using Curl
Using wget
Windows
Download the latest .exe file at last release page. Place the downloaded .exe file in a directory included in your system's PATH, or add the directory containing the .exe to your PATH.
Usage
For more detailed information on commands and options, refer to the built-in help:
TReq uses HTTPie's request-item syntax to set headers, request body, query string, etc.
=/:=for setting the request body's JSON or form fields (= for strings and := for other JSON types).==for adding query strings.:for adding or removing headers e.g connection:keep-alive or connection:.
Body, header e params manipulation
# POST with JSON payload => { "language": "Rust", "food": "pizza" }
# POST with custom Header => { Content-Type: application/json }
# Define query params at url
# (these two below are equivalent)
&job=dev
More complex requests
# POST with JSON payload
# => {
# "friends": ["John", "Jane"],
# "job": "dev",
# food": "pizza"
# }
# (these three below are equivalent)
Localhost alias
When defining urls with localhost, you can use the alias :{PORT}/{ROUTES} instead of complete url.
For example, each pair of the commands below are equivalents...
Contributing
Contributions and feature requests are welcome! Feel free to submit issues or pull requests on our GitHub repository.
Upcoming features
- TUI view like https://github.com/talis-fb/legacy_treq
- Enviroment Variables in Request payloads (like {{ .env.ENV_NAME }})