@kamrankhan027/probe-ai 1.0.3 → 1.1.0
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 +128 -0
- package/dist/index.js +497 -278
- package/package.json +5 -1
package/README.md
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# 🔍 ProbeAI — Autonomous API Reliability & Postman Suite Generator
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
**An autonomous developer CLI agent that inspects OpenAPI specs, synthesizes multi-scenario test suites, executes real-time HTTP calls, and auto-exports ready-to-import Postman collections.**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@kamrankhan027/probe-ai)
|
|
8
|
+
[](https://opensource.org/licenses/MIT)
|
|
9
|
+
[](https://langchain-ai.github.io/langgraphjs/)
|
|
10
|
+
[](https://ai.google.dev/)
|
|
11
|
+
[](https://www.typescriptlang.org/)
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## ⚡ Quickstart
|
|
18
|
+
|
|
19
|
+
### Option 1: Run Instantly via `npx` (Zero Installation Required)
|
|
20
|
+
```bash
|
|
21
|
+
npx @kamrankhan027/probe-ai
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### Option 2: Install Globally
|
|
27
|
+
|
|
28
|
+
**Using npm:**
|
|
29
|
+
```bash
|
|
30
|
+
npm install -g @kamrankhan027/probe-ai
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Using pnpm:**
|
|
34
|
+
```bash
|
|
35
|
+
pnpm add -g @kamrankhan027/probe-ai
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Using yarn:**
|
|
39
|
+
```bash
|
|
40
|
+
yarn global add @kamrankhan027/probe-ai
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Then run ProbeAI from **any directory** on your machine:
|
|
44
|
+
```bash
|
|
45
|
+
probe-ai
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## 🔑 API Key Setup
|
|
51
|
+
|
|
52
|
+
ProbeAI uses Google Gemini for fast, structured reasoning.
|
|
53
|
+
* **If you have a `.env` file**: Add `GEMINI_API_KEY=your_key_here`
|
|
54
|
+
* **If running via `npx` without a `.env`**: ProbeAI will interactively prompt you to paste your free Gemini API key on startup.
|
|
55
|
+
|
|
56
|
+
*(Get a free key in 10 seconds at [aistudio.google.com](https://aistudio.google.com/)).*
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🌟 Key Superpowers
|
|
61
|
+
|
|
62
|
+
* **🔍 Auto-Discovery via OpenAPI**: Probes any API base URL (e.g. `http://localhost:8000`) and parses `/openapi.json` to map all routes, parameters, and security schemas.
|
|
63
|
+
* **📦 1-Click Postman Collection Export**: Eliminates 30+ minutes of manual route recreation by generating ready-to-import **Postman Collection v2.1** files (`reports/probe_collection.json`).
|
|
64
|
+
* **🔐 Smart Auth Detective**: Supports direct token injection (`Bearer ...` or `X-API-Key`) **AND** autonomous login flows (executing `POST /auth/login`, extracting the JWT token, and binding it to subsequent requests).
|
|
65
|
+
* **⚡ Real-Time HTTP Latency Profiling**: Fires live requests, catches `422/404/401` edge cases, and logs latency in milliseconds.
|
|
66
|
+
* **📊 Standalone HTML & Terminal Reports**: Generates interactive single-page HTML audit dashboards with health scores and payload replays.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 💡 Example Prompts to Try
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
You: Inspect https://bookmark-agent-backend.onrender.com and export a Postman collection
|
|
74
|
+
```
|
|
75
|
+
*Auto-maps all endpoints and creates `reports/postman_collection.json`.*
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
You: Test all endpoints on https://bookmark-agent-backend.onrender.com and save an HTML report
|
|
79
|
+
```
|
|
80
|
+
*Executes Happy Path, Query Filter, and Error test cases and saves `reports/audit_report.html`.*
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
You: Set auth Bearer my_jwt_token_123 and test protected endpoints
|
|
84
|
+
```
|
|
85
|
+
*Injects your authorization header into session memory for all subsequent calls.*
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
You: Authenticate via POST https://api.example.com/login with {"email":"dev@example.com","password":"secret"}, then test /api/dashboard
|
|
89
|
+
```
|
|
90
|
+
*Extracts the JWT from the login response and tests the protected dashboard route automatically.*
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## 🏗️ Repository Architecture
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
probe-ai/
|
|
98
|
+
├── cli/ # 🚀 Native TypeScript NPM Package (@kamrankhan027/probe-ai)
|
|
99
|
+
│ ├── src/
|
|
100
|
+
│ │ ├── index.ts # Interactive CLI loop & Marked terminal styling
|
|
101
|
+
│ │ ├── agent.ts # @langchain/langgraph ReAct workflow
|
|
102
|
+
│ │ └── tools/ # OpenAPI, HTTP, Auth, Postman & Report tools
|
|
103
|
+
│ ├── dist/
|
|
104
|
+
│ │ └── index.js # ⚡ Single zero-dependency bundled executable (tsup)
|
|
105
|
+
│ └── package.json
|
|
106
|
+
├── python/ # Python implementation (LangGraph + Rich)
|
|
107
|
+
│ ├── agent.py
|
|
108
|
+
│ └── requirements.txt
|
|
109
|
+
└── reports/ # Shared output directory
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## 🛠️ Local Development
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git clone https://github.com/kamran-027/probe-ai.git
|
|
118
|
+
cd probe-ai/cli
|
|
119
|
+
npm install
|
|
120
|
+
npm run build
|
|
121
|
+
npm start
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
<div align="center">
|
|
127
|
+
Built by <b>Kamran Khan</b> as part of <b>Cadence Labs</b>.
|
|
128
|
+
</div>
|