rouint 1.0.0__tar.gz
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.
- rouint-1.0.0/LICENSE +21 -0
- rouint-1.0.0/PKG-INFO +289 -0
- rouint-1.0.0/README.md +255 -0
- rouint-1.0.0/pyproject.toml +53 -0
- rouint-1.0.0/rouint/__init__.py +3 -0
- rouint-1.0.0/rouint/cli.py +844 -0
- rouint-1.0.0/rouint/core/__init__.py +0 -0
- rouint-1.0.0/rouint/core/executor.py +155 -0
- rouint-1.0.0/rouint/core/manager.py +125 -0
- rouint-1.0.0/rouint/core/parser.py +39 -0
- rouint-1.0.0/rouint/ui/__init__.py +19 -0
- rouint-1.0.0/rouint/ui/components.py +153 -0
- rouint-1.0.0/rouint/ui/screens.py +1 -0
- rouint-1.0.0/rouint/utils/__init__.py +0 -0
- rouint-1.0.0/rouint/utils/config.py +133 -0
- rouint-1.0.0/rouint/utils/logger.py +1 -0
- rouint-1.0.0/rouint.egg-info/PKG-INFO +289 -0
- rouint-1.0.0/rouint.egg-info/SOURCES.txt +24 -0
- rouint-1.0.0/rouint.egg-info/dependency_links.txt +1 -0
- rouint-1.0.0/rouint.egg-info/entry_points.txt +2 -0
- rouint-1.0.0/rouint.egg-info/requires.txt +7 -0
- rouint-1.0.0/rouint.egg-info/top_level.txt +1 -0
- rouint-1.0.0/setup.cfg +4 -0
- rouint-1.0.0/tests/test_executor.py +43 -0
- rouint-1.0.0/tests/test_manager.py +44 -0
- rouint-1.0.0/tests/test_parser.py +37 -0
rouint-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Kavimugil Rajasekar
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
rouint-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rouint
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: CLI-Based API Endpoint Management and Testing Tool
|
|
5
|
+
Author-email: Kavimugil Rajasekar <kavimugil28@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/KavimugilRajasekar/Rouint
|
|
8
|
+
Project-URL: Repository, https://github.com/KavimugilRajasekar/Rouint
|
|
9
|
+
Project-URL: Issues, https://github.com/KavimugilRajasekar/Rouint/issues
|
|
10
|
+
Keywords: api,testing,curl,cli,tui,endpoint-management
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Programming Language :: Python :: 3
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Environment :: Console
|
|
20
|
+
Classifier: Intended Audience :: Developers
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
23
|
+
Classifier: Topic :: Software Development :: Testing
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: click<9,>=8.1
|
|
28
|
+
Requires-Dist: rich<16,>=13.0
|
|
29
|
+
Requires-Dist: questionary<3,>=2.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
32
|
+
Requires-Dist: build>=1.0; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# Rouint
|
|
36
|
+
|
|
37
|
+
A CLI-based API endpoint management and testing tool that wraps `curl`. Define endpoints once, organize them locally, and test them against any environment directly from the terminal — no GUI required.
|
|
38
|
+
|
|
39
|
+
Rouint stores endpoint configurations (method, path, headers, auth, body, files) in a local `.rouint-data/` directory and executes requests through the system's `curl` installation, giving you the transparency of a raw shell command with the organization of a professional API client.
|
|
40
|
+
|
|
41
|
+
## Features
|
|
42
|
+
|
|
43
|
+
- Define reusable API endpoint templates with `{placeholder}` parameters
|
|
44
|
+
- Interactive endpoint creation wizard with step-back navigation (Esc to go back)
|
|
45
|
+
- Support for GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS methods
|
|
46
|
+
- Custom headers with method-aware defaults
|
|
47
|
+
- Authentication — Bearer Token (with temp token reuse) and Custom header auth
|
|
48
|
+
- JSON request body with inline validation
|
|
49
|
+
- **File attachment support** — multipart/form-data via `curl -F`
|
|
50
|
+
- **Multi-environment support** — add local, staging, and production URLs; choose at test time
|
|
51
|
+
- Automatic URL encoding of placeholder values
|
|
52
|
+
- Pretty-printed JSON in both REQUEST and RESPONSE boxes
|
|
53
|
+
- Full-width terminal panels that adapt to your terminal size
|
|
54
|
+
- Input validation — base URLs, JSON bodies, and file paths checked on entry
|
|
55
|
+
- Local-first storage — all data stays in your project directory
|
|
56
|
+
- `.gitignore` auto-generated to keep environments and tokens out of version control
|
|
57
|
+
|
|
58
|
+
## Requirements
|
|
59
|
+
|
|
60
|
+
- Python 3.9 or higher
|
|
61
|
+
- `curl` installed and available on your `PATH`
|
|
62
|
+
|
|
63
|
+
## Installation
|
|
64
|
+
|
|
65
|
+
### From PyPI
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install rouint
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### From source (for development)
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git clone https://github.com/KavimugilRajasekar/Rouint.git
|
|
75
|
+
cd Rouint
|
|
76
|
+
pip install -e ".[dev]"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Quick Start
|
|
80
|
+
|
|
81
|
+
### 1. Initialize your workspace
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
rouint init
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Creates `.rouint-data/` in your current directory:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
.rouint-data/
|
|
91
|
+
├── .gitignore # Keeps environments, tokens, and bodies out of git
|
|
92
|
+
├── config.json # Workspace configuration
|
|
93
|
+
├── registry.json # Endpoint registry (maps IDs to slugs)
|
|
94
|
+
├── endpoints/ # Endpoint configuration files
|
|
95
|
+
├── environments/ # Base URLs (gitignored)
|
|
96
|
+
└── bodies/ # Request body files (gitignored)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 2. Add your base URLs
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
rouint add-base-url
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Choose **Add a new base URL**, enter the URL and a label:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
local → http://127.0.0.1:8080
|
|
109
|
+
staging → https://staging.myapp.com
|
|
110
|
+
production → https://api.myapp.com
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
To remove a URL, choose **Delete an environment**.
|
|
114
|
+
|
|
115
|
+
### 3. Create an endpoint
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
rouint add-new-api
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
A 7-step wizard — press **Esc** at any step to go back to the previous one:
|
|
122
|
+
|
|
123
|
+
| Step | What you set |
|
|
124
|
+
|------|-------------|
|
|
125
|
+
| 1 | HTTP method — GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
|
|
126
|
+
| 2 | Path — with optional `{placeholder}` syntax |
|
|
127
|
+
| 3 | Headers — method-aware defaults, add/edit freely |
|
|
128
|
+
| 4 | Auth — None, Bearer Token, or Custom header |
|
|
129
|
+
| 5 | Body — JSON, validated on entry (POST/PUT/PATCH/DELETE) |
|
|
130
|
+
| 6 | Files — multipart attachments (POST/PUT/PATCH/DELETE) |
|
|
131
|
+
| 7 | Name — a memorable label |
|
|
132
|
+
|
|
133
|
+
The endpoint is saved without a base URL — you choose the environment at test time.
|
|
134
|
+
|
|
135
|
+
### 4. Test an endpoint
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
rouint start-test
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Flow: **Select endpoint → Select base URL → Fill placeholders → Execute**
|
|
142
|
+
|
|
143
|
+
Displays three panels:
|
|
144
|
+
|
|
145
|
+
- **REQUEST** — method, path, headers, body (pretty-printed JSON)
|
|
146
|
+
- **RESPONSE** — status, headers, body (pretty-printed JSON)
|
|
147
|
+
- **METRICS** — HTTP status, response time, response size
|
|
148
|
+
|
|
149
|
+
Use `--no-metrics` to hide the metrics panel:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
rouint start-test --no-metrics
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
If a token is detected in the response (Bearer/JWT), Rouint offers to save it as a temp token and automatically reuses it on subsequent Bearer-auth requests.
|
|
156
|
+
|
|
157
|
+
### 5. Manage your collection
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
rouint list-api
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Select any endpoint to:
|
|
164
|
+
- **Edit** — re-run the wizard with existing values pre-filled; Esc steps back
|
|
165
|
+
- **View Configuration** — print the raw JSON
|
|
166
|
+
- **Delete** — remove permanently after confirmation
|
|
167
|
+
|
|
168
|
+
## Placeholder System
|
|
169
|
+
|
|
170
|
+
Use `{name}` syntax anywhere in the path or query string:
|
|
171
|
+
|
|
172
|
+
| Path | Placeholders | Example input |
|
|
173
|
+
|------|-------------|---------------|
|
|
174
|
+
| `/users/{id}` | `id` | `usr-101` |
|
|
175
|
+
| `/search?q={query}` | `query` | `hello world` → URL-encoded |
|
|
176
|
+
| `/users/{id}/posts/{post_id}` | `id`, `post_id` | `123`, `456` |
|
|
177
|
+
|
|
178
|
+
Rules:
|
|
179
|
+
- Names must match `[a-zA-Z0-9_]`
|
|
180
|
+
- Names must be unique within an endpoint
|
|
181
|
+
- Braces must be balanced
|
|
182
|
+
- Values are URL-encoded automatically at test time
|
|
183
|
+
|
|
184
|
+
## File Attachments
|
|
185
|
+
|
|
186
|
+
For POST/PUT/PATCH/DELETE endpoints, you can attach files during creation:
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
File path: /home/user/photo.jpg
|
|
190
|
+
Form field name: avatar
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
At test time, Rouint sends the request as `multipart/form-data` via `curl -F`. The `Content-Type` header is removed automatically — curl sets the correct boundary.
|
|
194
|
+
|
|
195
|
+
## Authentication
|
|
196
|
+
|
|
197
|
+
| Type | Behaviour |
|
|
198
|
+
|------|-----------|
|
|
199
|
+
| None | No auth header added |
|
|
200
|
+
| Bearer Token | Prompts for token; offers saved temp token if available |
|
|
201
|
+
| Custom | Prompts for header name and value; saved in endpoint config |
|
|
202
|
+
|
|
203
|
+
**Temp token workflow:**
|
|
204
|
+
1. Login endpoint returns a token → Rouint detects it
|
|
205
|
+
2. "Save as temp token?" → saved to `.rouint-data/.temp_token` (chmod 0600)
|
|
206
|
+
3. Next Bearer-auth request → "Use saved temp token?" → auto-filled
|
|
207
|
+
4. `rouint clear-token` → removes it
|
|
208
|
+
|
|
209
|
+
## Git Safety
|
|
210
|
+
|
|
211
|
+
`rouint init` creates `.rouint-data/.gitignore` that protects:
|
|
212
|
+
|
|
213
|
+
```gitignore
|
|
214
|
+
environments/ # real base URLs
|
|
215
|
+
.temp_token # live Bearer tokens
|
|
216
|
+
bodies/ # may contain credentials
|
|
217
|
+
*.secret.json # explicitly sensitive files
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Safe to commit: `endpoints/`, `registry.json`, `config.json`
|
|
221
|
+
|
|
222
|
+
## Commands Reference
|
|
223
|
+
|
|
224
|
+
| Command | Description |
|
|
225
|
+
|---------|-------------|
|
|
226
|
+
| `rouint init` | Initialize the Rouint workspace |
|
|
227
|
+
| `rouint add-base-url` | Add or delete a base URL environment |
|
|
228
|
+
| `rouint add-new-api` | Define a new API endpoint interactively |
|
|
229
|
+
| `rouint start-test` | Select an endpoint + base URL and run the test |
|
|
230
|
+
| `rouint list-api` | List, inspect, edit, or delete saved endpoints |
|
|
231
|
+
| `rouint clear-token` | Clear the saved temp Bearer token |
|
|
232
|
+
|
|
233
|
+
## Workflow at a Glance
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
rouint init # set up workspace (once per project)
|
|
237
|
+
rouint add-base-url # register: local → http://127.0.0.1:8080
|
|
238
|
+
rouint add-new-api # define: POST /api/v1/auth/login
|
|
239
|
+
rouint start-test # pick endpoint → pick URL → test!
|
|
240
|
+
rouint list-api # manage saved endpoints
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Project Structure
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
Rouint/
|
|
247
|
+
├── pyproject.toml
|
|
248
|
+
├── LICENSE
|
|
249
|
+
├── README.md
|
|
250
|
+
├── rouint/
|
|
251
|
+
│ ├── __init__.py # Package init, exposes __version__
|
|
252
|
+
│ ├── cli.py # Click CLI commands and interactive flows
|
|
253
|
+
│ ├── core/
|
|
254
|
+
│ │ ├── executor.py # curl wrapper, file upload, URL/file validation
|
|
255
|
+
│ │ ├── manager.py # Endpoint CRUD (save, list, delete)
|
|
256
|
+
│ │ └── parser.py # Placeholder extraction, resolution, validation
|
|
257
|
+
│ ├── utils/
|
|
258
|
+
│ │ └── config.py # Workspace init, data paths, .gitignore generation
|
|
259
|
+
│ └── ui/
|
|
260
|
+
│ └── components.py # Banner, header, box_width
|
|
261
|
+
└── tests/
|
|
262
|
+
├── test_executor.py
|
|
263
|
+
├── test_parser.py
|
|
264
|
+
└── test_manager.py
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
## Development
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
git clone https://github.com/KavimugilRajasekar/Rouint.git
|
|
271
|
+
cd Rouint
|
|
272
|
+
python -m venv .venv
|
|
273
|
+
source .venv/bin/activate
|
|
274
|
+
pip install -e ".[dev]"
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
pytest tests/ -v # run tests
|
|
279
|
+
python -m build # build wheel + sdist
|
|
280
|
+
twine upload dist/* # publish to PyPI
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## License
|
|
284
|
+
|
|
285
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
286
|
+
|
|
287
|
+
## Author
|
|
288
|
+
|
|
289
|
+
Kavimugil Rajasekar (kavimugil28@gmail.com)
|
rouint-1.0.0/README.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
# Rouint
|
|
2
|
+
|
|
3
|
+
A CLI-based API endpoint management and testing tool that wraps `curl`. Define endpoints once, organize them locally, and test them against any environment directly from the terminal — no GUI required.
|
|
4
|
+
|
|
5
|
+
Rouint stores endpoint configurations (method, path, headers, auth, body, files) in a local `.rouint-data/` directory and executes requests through the system's `curl` installation, giving you the transparency of a raw shell command with the organization of a professional API client.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- Define reusable API endpoint templates with `{placeholder}` parameters
|
|
10
|
+
- Interactive endpoint creation wizard with step-back navigation (Esc to go back)
|
|
11
|
+
- Support for GET, POST, PUT, PATCH, DELETE, HEAD, and OPTIONS methods
|
|
12
|
+
- Custom headers with method-aware defaults
|
|
13
|
+
- Authentication — Bearer Token (with temp token reuse) and Custom header auth
|
|
14
|
+
- JSON request body with inline validation
|
|
15
|
+
- **File attachment support** — multipart/form-data via `curl -F`
|
|
16
|
+
- **Multi-environment support** — add local, staging, and production URLs; choose at test time
|
|
17
|
+
- Automatic URL encoding of placeholder values
|
|
18
|
+
- Pretty-printed JSON in both REQUEST and RESPONSE boxes
|
|
19
|
+
- Full-width terminal panels that adapt to your terminal size
|
|
20
|
+
- Input validation — base URLs, JSON bodies, and file paths checked on entry
|
|
21
|
+
- Local-first storage — all data stays in your project directory
|
|
22
|
+
- `.gitignore` auto-generated to keep environments and tokens out of version control
|
|
23
|
+
|
|
24
|
+
## Requirements
|
|
25
|
+
|
|
26
|
+
- Python 3.9 or higher
|
|
27
|
+
- `curl` installed and available on your `PATH`
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
### From PyPI
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install rouint
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### From source (for development)
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/KavimugilRajasekar/Rouint.git
|
|
41
|
+
cd Rouint
|
|
42
|
+
pip install -e ".[dev]"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Quick Start
|
|
46
|
+
|
|
47
|
+
### 1. Initialize your workspace
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
rouint init
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Creates `.rouint-data/` in your current directory:
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
.rouint-data/
|
|
57
|
+
├── .gitignore # Keeps environments, tokens, and bodies out of git
|
|
58
|
+
├── config.json # Workspace configuration
|
|
59
|
+
├── registry.json # Endpoint registry (maps IDs to slugs)
|
|
60
|
+
├── endpoints/ # Endpoint configuration files
|
|
61
|
+
├── environments/ # Base URLs (gitignored)
|
|
62
|
+
└── bodies/ # Request body files (gitignored)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 2. Add your base URLs
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
rouint add-base-url
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Choose **Add a new base URL**, enter the URL and a label:
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
local → http://127.0.0.1:8080
|
|
75
|
+
staging → https://staging.myapp.com
|
|
76
|
+
production → https://api.myapp.com
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
To remove a URL, choose **Delete an environment**.
|
|
80
|
+
|
|
81
|
+
### 3. Create an endpoint
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
rouint add-new-api
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
A 7-step wizard — press **Esc** at any step to go back to the previous one:
|
|
88
|
+
|
|
89
|
+
| Step | What you set |
|
|
90
|
+
|------|-------------|
|
|
91
|
+
| 1 | HTTP method — GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS |
|
|
92
|
+
| 2 | Path — with optional `{placeholder}` syntax |
|
|
93
|
+
| 3 | Headers — method-aware defaults, add/edit freely |
|
|
94
|
+
| 4 | Auth — None, Bearer Token, or Custom header |
|
|
95
|
+
| 5 | Body — JSON, validated on entry (POST/PUT/PATCH/DELETE) |
|
|
96
|
+
| 6 | Files — multipart attachments (POST/PUT/PATCH/DELETE) |
|
|
97
|
+
| 7 | Name — a memorable label |
|
|
98
|
+
|
|
99
|
+
The endpoint is saved without a base URL — you choose the environment at test time.
|
|
100
|
+
|
|
101
|
+
### 4. Test an endpoint
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
rouint start-test
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Flow: **Select endpoint → Select base URL → Fill placeholders → Execute**
|
|
108
|
+
|
|
109
|
+
Displays three panels:
|
|
110
|
+
|
|
111
|
+
- **REQUEST** — method, path, headers, body (pretty-printed JSON)
|
|
112
|
+
- **RESPONSE** — status, headers, body (pretty-printed JSON)
|
|
113
|
+
- **METRICS** — HTTP status, response time, response size
|
|
114
|
+
|
|
115
|
+
Use `--no-metrics` to hide the metrics panel:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
rouint start-test --no-metrics
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If a token is detected in the response (Bearer/JWT), Rouint offers to save it as a temp token and automatically reuses it on subsequent Bearer-auth requests.
|
|
122
|
+
|
|
123
|
+
### 5. Manage your collection
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
rouint list-api
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Select any endpoint to:
|
|
130
|
+
- **Edit** — re-run the wizard with existing values pre-filled; Esc steps back
|
|
131
|
+
- **View Configuration** — print the raw JSON
|
|
132
|
+
- **Delete** — remove permanently after confirmation
|
|
133
|
+
|
|
134
|
+
## Placeholder System
|
|
135
|
+
|
|
136
|
+
Use `{name}` syntax anywhere in the path or query string:
|
|
137
|
+
|
|
138
|
+
| Path | Placeholders | Example input |
|
|
139
|
+
|------|-------------|---------------|
|
|
140
|
+
| `/users/{id}` | `id` | `usr-101` |
|
|
141
|
+
| `/search?q={query}` | `query` | `hello world` → URL-encoded |
|
|
142
|
+
| `/users/{id}/posts/{post_id}` | `id`, `post_id` | `123`, `456` |
|
|
143
|
+
|
|
144
|
+
Rules:
|
|
145
|
+
- Names must match `[a-zA-Z0-9_]`
|
|
146
|
+
- Names must be unique within an endpoint
|
|
147
|
+
- Braces must be balanced
|
|
148
|
+
- Values are URL-encoded automatically at test time
|
|
149
|
+
|
|
150
|
+
## File Attachments
|
|
151
|
+
|
|
152
|
+
For POST/PUT/PATCH/DELETE endpoints, you can attach files during creation:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
File path: /home/user/photo.jpg
|
|
156
|
+
Form field name: avatar
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
At test time, Rouint sends the request as `multipart/form-data` via `curl -F`. The `Content-Type` header is removed automatically — curl sets the correct boundary.
|
|
160
|
+
|
|
161
|
+
## Authentication
|
|
162
|
+
|
|
163
|
+
| Type | Behaviour |
|
|
164
|
+
|------|-----------|
|
|
165
|
+
| None | No auth header added |
|
|
166
|
+
| Bearer Token | Prompts for token; offers saved temp token if available |
|
|
167
|
+
| Custom | Prompts for header name and value; saved in endpoint config |
|
|
168
|
+
|
|
169
|
+
**Temp token workflow:**
|
|
170
|
+
1. Login endpoint returns a token → Rouint detects it
|
|
171
|
+
2. "Save as temp token?" → saved to `.rouint-data/.temp_token` (chmod 0600)
|
|
172
|
+
3. Next Bearer-auth request → "Use saved temp token?" → auto-filled
|
|
173
|
+
4. `rouint clear-token` → removes it
|
|
174
|
+
|
|
175
|
+
## Git Safety
|
|
176
|
+
|
|
177
|
+
`rouint init` creates `.rouint-data/.gitignore` that protects:
|
|
178
|
+
|
|
179
|
+
```gitignore
|
|
180
|
+
environments/ # real base URLs
|
|
181
|
+
.temp_token # live Bearer tokens
|
|
182
|
+
bodies/ # may contain credentials
|
|
183
|
+
*.secret.json # explicitly sensitive files
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Safe to commit: `endpoints/`, `registry.json`, `config.json`
|
|
187
|
+
|
|
188
|
+
## Commands Reference
|
|
189
|
+
|
|
190
|
+
| Command | Description |
|
|
191
|
+
|---------|-------------|
|
|
192
|
+
| `rouint init` | Initialize the Rouint workspace |
|
|
193
|
+
| `rouint add-base-url` | Add or delete a base URL environment |
|
|
194
|
+
| `rouint add-new-api` | Define a new API endpoint interactively |
|
|
195
|
+
| `rouint start-test` | Select an endpoint + base URL and run the test |
|
|
196
|
+
| `rouint list-api` | List, inspect, edit, or delete saved endpoints |
|
|
197
|
+
| `rouint clear-token` | Clear the saved temp Bearer token |
|
|
198
|
+
|
|
199
|
+
## Workflow at a Glance
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
rouint init # set up workspace (once per project)
|
|
203
|
+
rouint add-base-url # register: local → http://127.0.0.1:8080
|
|
204
|
+
rouint add-new-api # define: POST /api/v1/auth/login
|
|
205
|
+
rouint start-test # pick endpoint → pick URL → test!
|
|
206
|
+
rouint list-api # manage saved endpoints
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## Project Structure
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
Rouint/
|
|
213
|
+
├── pyproject.toml
|
|
214
|
+
├── LICENSE
|
|
215
|
+
├── README.md
|
|
216
|
+
├── rouint/
|
|
217
|
+
│ ├── __init__.py # Package init, exposes __version__
|
|
218
|
+
│ ├── cli.py # Click CLI commands and interactive flows
|
|
219
|
+
│ ├── core/
|
|
220
|
+
│ │ ├── executor.py # curl wrapper, file upload, URL/file validation
|
|
221
|
+
│ │ ├── manager.py # Endpoint CRUD (save, list, delete)
|
|
222
|
+
│ │ └── parser.py # Placeholder extraction, resolution, validation
|
|
223
|
+
│ ├── utils/
|
|
224
|
+
│ │ └── config.py # Workspace init, data paths, .gitignore generation
|
|
225
|
+
│ └── ui/
|
|
226
|
+
│ └── components.py # Banner, header, box_width
|
|
227
|
+
└── tests/
|
|
228
|
+
├── test_executor.py
|
|
229
|
+
├── test_parser.py
|
|
230
|
+
└── test_manager.py
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
## Development
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
git clone https://github.com/KavimugilRajasekar/Rouint.git
|
|
237
|
+
cd Rouint
|
|
238
|
+
python -m venv .venv
|
|
239
|
+
source .venv/bin/activate
|
|
240
|
+
pip install -e ".[dev]"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
pytest tests/ -v # run tests
|
|
245
|
+
python -m build # build wheel + sdist
|
|
246
|
+
twine upload dist/* # publish to PyPI
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## License
|
|
250
|
+
|
|
251
|
+
MIT License — see [LICENSE](LICENSE) for details.
|
|
252
|
+
|
|
253
|
+
## Author
|
|
254
|
+
|
|
255
|
+
Kavimugil Rajasekar (kavimugil28@gmail.com)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "rouint"
|
|
3
|
+
version = "1.0.0"
|
|
4
|
+
description = "CLI-Based API Endpoint Management and Testing Tool"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.9"
|
|
7
|
+
authors = [
|
|
8
|
+
{name = "Kavimugil Rajasekar", email = "kavimugil28@gmail.com"}
|
|
9
|
+
]
|
|
10
|
+
license = "MIT"
|
|
11
|
+
keywords = ["api", "testing", "curl", "cli", "tui", "endpoint-management"]
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 3 - Alpha",
|
|
14
|
+
"Programming Language :: Python :: 3",
|
|
15
|
+
"Programming Language :: Python :: 3.9",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Environment :: Console",
|
|
22
|
+
"Intended Audience :: Developers",
|
|
23
|
+
"Topic :: Utilities",
|
|
24
|
+
"Topic :: Internet :: WWW/HTTP",
|
|
25
|
+
"Topic :: Software Development :: Testing",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"click>=8.1,<9",
|
|
29
|
+
"rich>=13.0,<16",
|
|
30
|
+
"questionary>=2.0,<3",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/KavimugilRajasekar/Rouint"
|
|
35
|
+
Repository = "https://github.com/KavimugilRajasekar/Rouint"
|
|
36
|
+
Issues = "https://github.com/KavimugilRajasekar/Rouint/issues"
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
dev = [
|
|
40
|
+
"pytest>=8.0",
|
|
41
|
+
"build>=1.0",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
rouint = "rouint.cli:cli"
|
|
46
|
+
|
|
47
|
+
[build-system]
|
|
48
|
+
requires = ["setuptools>=64", "wheel"]
|
|
49
|
+
build-backend = "setuptools.build_meta"
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.packages.find]
|
|
52
|
+
where = ["."]
|
|
53
|
+
include = ["rouint*"]
|