testify-api-cli 1.2.6 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +182 -19
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,39 +1,202 @@
|
|
|
1
|
-
|
|
1
|
+
<img src="assets/ascii-logo.svg" alt="Testify ASCII Logo" />
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
> — zero-config API testing for your terminal.
|
|
3
|
+
# Testify
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
**Zero-config API testing for your terminal.**
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
## The Problem
|
|
13
|
+
|
|
14
|
+
Postman and Insomnia require manual setup for every project: creating collections, typing URLs, guessing request bodies, and constantly switching context. Testify eliminates this busywork by statically analyzing your actual source code. It reads your codebase, finds your routes, infers your validation schemas, and provides an instant TUI workspace to test them immediately.
|
|
15
|
+
|
|
16
|
+
## What Testify Does
|
|
17
|
+
|
|
18
|
+
- **Zero Config**: Auto-detects your tech stack by reading `package.json`, `requirements.txt`, or `go.mod`
|
|
19
|
+
- **Smart Scraping**: Recursively scans your codebase for API routes across 10+ frameworks and extracts DTO schemas
|
|
20
|
+
- **Terminal UI (TUI)**: Persistent split-pane workspace — edit request, see response, no context switching
|
|
21
|
+
- **Web Dashboard** (`testify ui`): A beautiful, modern Next.js interface with dark mode, interactive JSON editors, and polished animations
|
|
22
|
+
- **Advanced Request Builder**:
|
|
23
|
+
- Fully editable API URLs
|
|
24
|
+
- Dynamic Path Parameters detection (e.g. automatically creates input fields for `:id` or `{user_id}`)
|
|
25
|
+
- Comprehensive Headers management with Autocomplete for standard HTTP headers
|
|
26
|
+
- "Use Cookie" quick-action to extract `Set-Cookie` tokens from responses instantly
|
|
27
|
+
- **Edge-case Support**: Works on monorepos, custom routes via `testify.json`, and maintains a full request history
|
|
28
|
+
|
|
29
|
+
## Supported Frameworks
|
|
30
|
+
|
|
31
|
+
| Language | Frameworks |
|
|
32
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
|
|
33
|
+
| **Node.js** | NestJS, Next.js, Express*, Fastify*, Hono*, Koa*, AdonisJS*, Sails.js*, Restify*, Hapi.js*, Polka*, Feathers*, ts-rest*, tRPC* |
|
|
34
|
+
| **Bun** | Elysia* |
|
|
35
|
+
| **Python** | FastAPI, Flask*, Django*, Litestar*, Tornado*, aiohttp*, Falcon*, Sanic* |
|
|
36
|
+
| **Go** | Gin*, Echo*, Fiber*, Chi*, HttpRouter*, Gorilla Mux*, Go stdlib* |
|
|
37
|
+
| **Java/Kotlin** | Spring Boot*, Quarkus*, Micronaut* |
|
|
38
|
+
| **PHP** | Laravel*, Slim*, Symfony*, CakePHP* |
|
|
39
|
+
| **Ruby** | Rails*, Sinatra*, Grape* |
|
|
40
|
+
| **Rust** | Actix Web*, Axum*, Rocket*, Warp*, Poem* |
|
|
41
|
+
| **C#/.NET** | ASP.NET Core* |
|
|
42
|
+
|
|
43
|
+
*\* pattern-implemented, less extensively tested against massive monoliths.*
|
|
44
|
+
|
|
45
|
+
## Installation
|
|
46
|
+
|
|
47
|
+
### Node Package Manager (NPM) (Recommended)
|
|
48
|
+
|
|
49
|
+
You can install Testify globally using npm:
|
|
7
50
|
|
|
8
51
|
```bash
|
|
9
52
|
npm install -g testify-api-cli
|
|
10
53
|
```
|
|
11
54
|
|
|
12
|
-
|
|
55
|
+
### Build from source
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
git clone https://github.com/nityam123-pixle/testify-cli.git
|
|
59
|
+
cd testify-cli
|
|
60
|
+
go build -o testify .
|
|
61
|
+
|
|
62
|
+
# Option A: Move to your PATH for global access
|
|
63
|
+
sudo mv testify /usr/local/bin/testify
|
|
64
|
+
|
|
65
|
+
# Option B: Run it locally in your project folder
|
|
66
|
+
./testify start
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Homebrew
|
|
70
|
+
|
|
71
|
+
You can install Testify via Homebrew:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
brew tap nityam123-pixle/homebrew-testify
|
|
75
|
+
brew install testify-api-cli
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### cURL (Linux & macOS)
|
|
79
|
+
|
|
80
|
+
You can install Testify with a single command — no Node or Homebrew required:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
curl -fsSL https://raw.githubusercontent.com/nityam123-pixle/testify-cli/main/install.sh | bash
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This script auto-detects your OS and CPU architecture, downloads the correct binary from the [latest GitHub release](https://github.com/nityam123-pixle/testify-cli/releases/latest), and installs it to `/usr/local/bin/testify`.
|
|
87
|
+
|
|
88
|
+
### PowerShell (Windows)
|
|
89
|
+
|
|
90
|
+
Open **PowerShell as Administrator** and run:
|
|
91
|
+
|
|
92
|
+
```powershell
|
|
93
|
+
iwr -useb https://raw.githubusercontent.com/nityam123-pixle/testify-cli/main/install.ps1 | iex
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
This script auto-detects your CPU architecture (`amd64` or `arm64`), downloads the correct `.zip` from the [latest GitHub release](https://github.com/nityam123-pixle/testify-cli/releases/latest), extracts it to `%LOCALAPPDATA%\Programs\testify`, and automatically adds it to your user `PATH`.
|
|
97
|
+
|
|
98
|
+
After installation, restart your terminal and run:
|
|
99
|
+
|
|
100
|
+
```powershell
|
|
101
|
+
testify version
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
> **Manual download**: You can also grab a `.zip` directly from the [Releases page](https://github.com/nityam123-pixle/testify-cli/releases) and add the folder to your PATH manually.
|
|
105
|
+
|
|
106
|
+
## Quick Start
|
|
107
|
+
|
|
108
|
+
Navigate to your backend project folder and run Testify:
|
|
13
109
|
|
|
14
110
|
```bash
|
|
15
111
|
cd your-project
|
|
16
|
-
testify start
|
|
112
|
+
testify start # (or ./testify start if you didn't move it to your PATH)
|
|
17
113
|
```
|
|
18
114
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
115
|
+
1. **Stack Detection**: Testify scans for `package.json`, `go.mod`, etc., to identify your framework and language.
|
|
116
|
+
2. **Route Scraping**: It recursively searches your source code, building an AST to extract endpoints and DTO schemas.
|
|
117
|
+
3. **Workspace**: An interactive TUI opens, pre-filled with your API routes and ready for you to send requests.
|
|
118
|
+
|
|
119
|
+
## Usage
|
|
120
|
+
|
|
121
|
+
| Command | Description |
|
|
122
|
+
| ---------------------- | --------------------------------------------------- |
|
|
123
|
+
| `testify start` | Start Testify in the current project (TUI) |
|
|
124
|
+
| `testify ui` | Launch the embedded Web Dashboard in browser |
|
|
125
|
+
| `testify scan` | Scan project and list detected routes |
|
|
126
|
+
| `testify frameworks` | List supported frameworks and their status |
|
|
127
|
+
| `testify history` | View the last 20 test executions |
|
|
128
|
+
| `testify add` | Interactively add a custom route to`testify.json` |
|
|
129
|
+
| `testify version` | Print the version number of Testify |
|
|
130
|
+
| `testify help` | Help about any command |
|
|
22
131
|
|
|
23
|
-
##
|
|
132
|
+
## Configuration
|
|
24
133
|
|
|
25
|
-
Testify
|
|
26
|
-
pre-fills request bodies from your actual schemas, and gives you a
|
|
27
|
-
persistent split-pane terminal workspace for testing — no manual setup,
|
|
28
|
-
no collections to create.
|
|
134
|
+
Testify automatically infers the backend port by parsing your source code (e.g., `app.listen(3000)`). However, if you are running Testify on a remote production or staging server, you can override the base URL by injecting environment variables:
|
|
29
135
|
|
|
30
|
-
|
|
136
|
+
```bash
|
|
137
|
+
# Override the port
|
|
138
|
+
PORT=5000 testify
|
|
139
|
+
|
|
140
|
+
# Override the entire base URL
|
|
141
|
+
TESTIFY_URL=https://<your-site-doman>.com testify start
|
|
142
|
+
```
|
|
31
143
|
|
|
32
|
-
##
|
|
144
|
+
## Keyboard Shortcuts
|
|
33
145
|
|
|
34
|
-
|
|
35
|
-
|
|
146
|
+
| Key | Action |
|
|
147
|
+
| ------------------ | --------------------------------------------------- |
|
|
148
|
+
| `/` | Open the Route Search Command Palette |
|
|
149
|
+
| `Tab` | Switch focus between Request Pane and Response Pane |
|
|
150
|
+
| `Ctrl+S` | Send the current request |
|
|
151
|
+
| `1` | View Response Body JSON |
|
|
152
|
+
| `2` | View Response Headers |
|
|
153
|
+
| `3` | View Raw HTTP Response |
|
|
154
|
+
| `c` | Copy the active response view to clipboard |
|
|
155
|
+
| `r` | Clear the response pane |
|
|
156
|
+
| `Up` / `k` | Scroll up the response pane |
|
|
157
|
+
| `Down` / `j` | Scroll down the response pane |
|
|
158
|
+
| `PageUp` | Fast scroll up |
|
|
159
|
+
| `PageDown` | Fast scroll down |
|
|
160
|
+
| `Home` | Scroll to top |
|
|
161
|
+
| `Esc` | Close route palette or defocus input |
|
|
162
|
+
| `Ctrl+C` / `q` | Quit Testify |
|
|
163
|
+
|
|
164
|
+
## Custom Routes (`testify.json`)
|
|
165
|
+
|
|
166
|
+
Sometimes routes are dynamically mounted by third-party libraries (like Better Auth) and cannot be statically detected in your source code. You can manually define these routes in a `testify.json` file in your project root.
|
|
167
|
+
|
|
168
|
+
You can add them interactively using the CLI:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
testify add
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Example `testify.json`:
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"custom_routes": [
|
|
179
|
+
{
|
|
180
|
+
"method": "POST",
|
|
181
|
+
"path": "/api/auth/sign-in/email",
|
|
182
|
+
"description": "Better Auth - Email Sign In",
|
|
183
|
+
"body_template": "{\n \"email\": \"\",\n \"password\": \"\"\n}"
|
|
184
|
+
}
|
|
185
|
+
]
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Project Status
|
|
190
|
+
|
|
191
|
+
This is an actively developed personal project. The CLI engine is currently complete and stable (`v1.2.10`). The web-based UI Next.js frontend is fully embedded and deployed!
|
|
192
|
+
|
|
193
|
+
## Contributing
|
|
194
|
+
|
|
195
|
+
Issues and PRs are welcome! Please open an issue to discuss your ideas before submitting a PR to ensure it aligns with the project direction.
|
|
36
196
|
|
|
37
197
|
## License
|
|
38
198
|
|
|
39
|
-
Apache
|
|
199
|
+
This project is licensed under the **Apache License 2.0**. See the [LICENSE](LICENSE) file for details.
|
|
200
|
+
|
|
201
|
+
> [!WARNING]
|
|
202
|
+
> This is a proprietary open-source project. You are welcome to view, learn from, and contribute to the code. However, you may not copy, rebrand, or re-distribute this project or its core engine as your own product.
|