485 words
2 minutes
TReq

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.

preview

This is my first Open Source project. And my big tried to created some helpful tools for me and hopefully for others. It was also the first and definitive project I used to learned Rust.

Actually, this version is a full rewrite of my original attempt: https://github.com/talis-fb/legacy_TReq. That first version had a lot of flaws due to my lack of experience, but I learned a ton from it. Eventually, I decided to take all those lessons and rebuild it from scratch, with a clearer vision and better code.

🎯 My goals and ideias…#

It started with a simple problem I kept running into as a backend developer:

I just want to re-run a saved API request without opening Postman or writing a giant curl command I’ve already forgotten.

Sure, tools like curl or HTTPie are great for quick requests, but they don’t really help when:

  1. You have a complex payload or tons of query params.
  2. You just want to run something you’ve already saved—without reopening a big GUI app.

That’s when I thought: Why isn’t there a terminal tool that does this?

My really first and main ideia was focusing in creating a TUI application. Just like a lot of TUI application out there to replace GUI tools, like lazydocker, lazygit, htop, neovim, etc… TReq should be a TUI tool to deal with HTTP requests.

❌ TUI First Attempt#

My original vision was actually a full TUI (Text User Interface) app using ratatui.

And I did build it. It had screens, panes, keybindings… the whole package.

preview-first-attempt

But eventually I hit a wall.

TUI apps are cool—but hard to get right. And no matter how much polish I added, it still didn’t feel better than just opening a GUI app. The TUI was getting in the way of productivity instead of helping it.

So, I scrapped it.

âś… The definitive version#

This time, I focused purely on the command line. I wanted something you could use like:

treq run my-request

And that’s it. Clean, quick, repeatable.

TReq is inspired by HTTPie in terms of syntax and usability, but with a strong focus on persistency and interactive workflows. You can save a request once, and run it again anytime with full support for bodies, headers, auth, and more.

TL;DR#

Submit and saving the request locally as “main-endpoint” with --save-as flag

treq POST example.com name="John Doe" --save-as main-endpoint

Executing saved request with run command

treq run main-endpoint

Executing it adding more data

treq run main-endpoint email='john@gmail.com' job=dev

A pratical usage…

# Create a user and save the request for make it again later
treq POST api.com/user name=John job=dev friends:='["Bob", "Jane"]' birth-year:=1990 --save-as create-user

# Make the same request for create a user "Jane"
treq run create-user name=Jane birth-year:=2001

# Editing saved request
treq edit birth-year:=2002 --method PATCH