|
8 | 8 | [](https://github.com/tensorix-labs/t-req/actions/workflows/ci.yml) |
9 | 9 | [](https://discord.gg/sKY4M3eS) |
10 | 10 |
|
11 | | -HTTP request parsing, execution, and testing. Define requests in `.http` files, test them in isolation. |
| 11 | +HTTP request parsing, execution, and testing. Define requests in `.http` files, explore them in the TUI or web dashboard, see every request your scripts make. |
12 | 12 |
|
13 | | -**Visit the docs at [t-req.io](https://t-req.io)** |
| 13 | +**[Read the docs](https://t-req.io)** | **[Join Discord](https://discord.gg/sKY4M3eS)** |
14 | 14 |
|
15 | | -## Why t-req |
16 | | - |
17 | | -- **`.http` files as source of truth** -- Standard format supported by VS Code REST Client and JetBrains HTTP Client. Version-controllable, diffable, shareable. |
18 | | -- **Library-first** -- `@t-req/core` is an embeddable TypeScript library. Use it in scripts, tests, CI, or your own tools. |
19 | | -- **Full dev workflow** -- CLI scaffolding, TUI for interactive exploration, web dashboard for visual debugging, all wired to the same server. |
20 | | -- **Multi-language server** -- `treq serve` exposes a REST API so Python, Go, Ruby, or any language can execute `.http` files. |
21 | | -- **Zero-config observability** -- Run scripts from the TUI and every HTTP request automatically appears in the dashboard. No code changes required. |
22 | | -- **Extensible with plugins** -- Add custom resolvers, hooks, and middleware. Write plugins in TypeScript or any language via subprocess protocol. |
23 | | -- **One command** -- `treq open` starts the server, TUI, and optionally the web dashboard. |
24 | | - |
25 | | -## Ecosystem |
26 | | - |
27 | | -``` |
28 | | - treq open |
29 | | - | |
30 | | - +--------+--------+ |
31 | | - | | |
32 | | - treq serve treq tui |
33 | | - (HTTP API server) (terminal UI) |
34 | | - | | |
35 | | - +--------+--------+ |
36 | | - | |
37 | | - @t-req/core |
38 | | - (parse, interpolate, |
39 | | - execute .http files) |
40 | | - | |
41 | | - .http files (source of truth) |
42 | | -
|
43 | | - +----------------------------------------------------------+ |
44 | | - | @t-req/web Browser dashboard (--web flag) | |
45 | | - | @t-req/ui Shared theme & Tailwind config | |
46 | | - | @t-req/webdocs Documentation site | |
47 | | - +----------------------------------------------------------+ |
48 | | -``` |
49 | | - |
50 | | -## Quick Start |
51 | | - |
52 | | -### As a library |
| 15 | +## Install |
53 | 16 |
|
54 | 17 | ```bash |
55 | | -npm install @t-req/core |
| 18 | +curl -fsSL https://t-req.io/install | bash |
56 | 19 | ``` |
57 | 20 |
|
58 | | -```typescript |
59 | | -import { createClient } from '@t-req/core'; |
60 | | -import { createNodeIO } from '@t-req/core/runtime'; |
| 21 | +<p align="center"> |
| 22 | + <img src="./docs/assets/web.png" alt="t-req web dashboard"> |
| 23 | +</p> |
61 | 24 |
|
62 | | -const client = createClient({ |
63 | | - io: createNodeIO(), |
64 | | - variables: { email: 'user@example.com', password: 'secret' }, |
65 | | -}); |
| 25 | +## What You Can Do |
66 | 26 |
|
67 | | -const response = await client.run('./auth/login.http'); |
68 | | -const { token } = await response.json(); |
69 | | -``` |
| 27 | +- **`treq open`** - One command starts the server + TUI |
| 28 | +- **`treq open --web`** - Add a browser-based dashboard |
| 29 | +- **`treq init`** - Scaffold complete projects instantly |
| 30 | +- **Observer Mode** - See HTTP requests from scripts in real-time, no code changes |
| 31 | +- **Language-agnostic** - Python, Go, Ruby via `treq serve` |
| 32 | +- **Standard `.http` files** - VS Code REST Client / JetBrains compatible |
70 | 33 |
|
71 | | -### As a CLI tool |
| 34 | +## Quick Start |
| 35 | + |
| 36 | +### Primary workflow |
72 | 37 |
|
73 | 38 | ```bash |
74 | | -# Install via curl |
| 39 | +# Install |
75 | 40 | curl -fsSL https://t-req.io/install | bash |
76 | 41 |
|
77 | | -# Or via npm |
78 | | -npm install -g @t-req/app |
79 | | -``` |
| 42 | +# Create a project |
| 43 | +treq init my-api && cd my-api |
80 | 44 |
|
81 | | -```bash |
82 | | -# Scaffold a project |
83 | | -treq init my-api |
84 | | - |
85 | | -# Open the TUI + server (the primary workflow) |
86 | | -cd my-api && treq open |
| 45 | +# Open TUI |
| 46 | +treq open |
87 | 47 |
|
88 | | -# Or open with the web dashboard too |
| 48 | +# Or with web dashboard |
89 | 49 | treq open --web |
90 | 50 | ``` |
91 | 51 |
|
92 | | -### As a multi-language server |
| 52 | +### Multi-language server |
| 53 | + |
| 54 | +For Python, Go, Ruby, or any language: |
93 | 55 |
|
94 | 56 | ```bash |
95 | 57 | treq serve --port 4096 |
96 | 58 |
|
97 | | -# From any language -- just POST to the server |
| 59 | +# POST from any language |
98 | 60 | curl -X POST http://localhost:4096/execute \ |
99 | 61 | -H "Content-Type: application/json" \ |
100 | 62 | -d '{"content": "GET https://httpbin.org/get"}' |
101 | 63 | ``` |
102 | 64 |
|
103 | | -## Packages |
| 65 | +### TypeScript library |
104 | 66 |
|
105 | | -| Package | Description | |
106 | | -|---------|-------------| |
107 | | -| [@t-req/core](./packages/core) | Core HTTP request parsing and execution library | |
108 | | -| [@t-req/app](./packages/app) | CLI for scaffolding, executing, and serving t-req projects | |
109 | | -| [@t-req/web](./packages/web) | Browser dashboard for the t-req server | |
110 | | -| [@t-req/ui](./packages/ui) | Shared UI components and Tailwind CSS configuration | |
111 | | -| [@t-req/webdocs](./packages/webdocs) | Documentation site | |
| 67 | +For tests, scripts, or building your own tools: |
112 | 68 |
|
113 | | -## Documentation |
| 69 | +```bash |
| 70 | +npm install @t-req/core |
| 71 | +``` |
114 | 72 |
|
115 | | -Visit [t-req.io](https://t-req.io) for full documentation, guides, and API reference. |
| 73 | +```typescript |
| 74 | +import { createClient } from '@t-req/core'; |
| 75 | +import { createNodeIO } from '@t-req/core/runtime'; |
116 | 76 |
|
117 | | -## Monorepo Structure |
| 77 | +const client = createClient({ |
| 78 | + io: createNodeIO(), |
| 79 | + variables: { email: 'user@example.com', password: 'secret' }, |
| 80 | +}); |
118 | 81 |
|
| 82 | +const response = await client.run('./auth/login.http'); |
| 83 | +const { token } = await response.json(); |
119 | 84 | ``` |
120 | | -t-req/ |
121 | | -├── examples/ |
122 | | -│ ├── plugins/ # Plugin examples |
123 | | -│ └── ... |
124 | | -├── packages/ |
125 | | -│ ├── core/ # @t-req/core - HTTP parsing & execution |
126 | | -│ ├── app/ # @t-req/app - CLI, TUI, and server |
127 | | -│ ├── web/ # @t-req/web - Browser dashboard |
128 | | -│ ├── webdocs/ # @t-req/webdocs - Documentation site |
129 | | -│ └── ui/ # @t-req/ui - UI components & theming |
130 | | -├── .changeset/ # Changesets for versioning |
131 | | -└── ... |
132 | | -``` |
| 85 | + |
| 86 | +## Packages |
| 87 | + |
| 88 | +| Package | Description | |
| 89 | +|---------|-------------| |
| 90 | +| [@t-req/core](./packages/core) | HTTP parsing and execution library | |
| 91 | +| [@t-req/app](./packages/app) | CLI, TUI, and server | |
| 92 | +| [@t-req/web](./packages/web) | Browser dashboard | |
133 | 93 |
|
134 | 94 | ## Contributing |
135 | 95 |
|
|
0 commit comments