Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

devtrace

When your app misbehaves, the culprit is often half in .env and half in HTTP you never logged cleanly—devtrace is a small CLI that checks the former, captures the latter through a local proxy, then lets you replay and diff responses without digging through ad-hoc logs.

Area What you get
Doctor Loads .env.env.local--env-profile layers (later wins). Duplicates, diff vs .env.example, URL/port/boolean checks, HTTP/TCP probes. --strict for CI.
Capture Local HTTP forward proxy. Plain HTTP + CONNECT tunneling out of the box.
HTTPS Decrypt --decrypt enables TLS MITM: auto-generated Root CA under ~/.config/devtrace/ca.crt, per-host leaf certs on the fly. Trust the CA once, then read HTTPS traffic in plain text.
Live TUI --tui opens a real-time terminal UI: request list (method, status, host, path, latency) on the left, full detail (headers, body, timing, WebSocket frames) on the right. Navigate with ↑↓, filter with f, copy as curl with c.
Filter Combinable structured filters in the TUI: method:POST, status:2xx, host:api.example.com, body:error — or free text.
WebSocket WebSocket connections are captured with individual frames, timestamps, direction, and opcode. Frames show up in the TUI detail view.
Send One-off POST/GET/… with headers, body, or --body-file; stored like any capture.
HAR har export / har import (HAR 1.2 subset) for DevTools-style interchange.
Replay Resend captures with --base-url, extra headers, timeout; diff status, headers, body.
Diff devtrace diff <session-a> <session-b> — compare two sessions: added/removed endpoints, status changes, timing differences.
Explain Rule-based hints (401/404/5xx, tokens, DNS, latency); optional --doctor tie-in.
List / Show Sessions and captures; --json for scripts.
Config TOML under the OS config dir (config init / config path).
Safety Redacts sensitive headers/bodies (configurable); --unsafe-show-secrets for local debugging only.

Installation

You need a Rust toolchain (1.74+). Then:

cargo install --git https://github.com/Rikkarrr/devtrace.git

From a clone: cargo install --path .

Usage

# check your environment
devtrace doctor

# capture traffic (basic)
devtrace capture --port 8089

# capture with live TUI + HTTPS decryption
devtrace capture --port 8089 --tui --decrypt

# elsewhere:
HTTP_PROXY=http://127.0.0.1:8089 HTTPS_PROXY=http://127.0.0.1:8089 curl https://api.example.com

When done (q in TUI, or Ctrl+C in log mode):

devtrace list --captures
devtrace replay last
devtrace explain last --doctor

# compare two sessions
devtrace diff <session-a> <session-b>

HTTPS Decryption

The first time you run --decrypt, devtrace generates a Root CA at ~/.config/devtrace/ca.crt. Trust it once in your OS or browser:

# macOS
sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/.config/devtrace/ca.crt

# Linux (Debian/Ubuntu)
sudo cp ~/.config/devtrace/ca.crt /usr/local/share/ca-certificates/devtrace.crt
sudo update-ca-certificates

# Windows
certutil -addstore Root "%USERPROFILE%\.config\devtrace\ca.crt"

TUI Keybindings

Key Action
/k /j Navigate requests
PgUp / PgDn Scroll detail pane
f Filter mode (method:GET status:2xx host:… body:…)
c Copy selected request as curl
q / Esc Quit

Captures and config live under your OS app data / XDG paths; run devtrace config path for the exact location.

Sensitive headers and obvious secret-shaped JSON fields are redacted by default. Use --unsafe-show-secrets only on your own machine.

Updating

cargo install --git https://github.com/Rikkarrr/devtrace.git --force

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages