@api-doctor/cli 0.0.1 → 0.0.3
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/LICENSE.md +21 -0
- package/README.md +102 -6
- package/dist/cli.cjs +6686 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +2 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +6667 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/plugin.d.ts +1316 -0
- package/dist/plugin.js +4812 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +64 -15
- package/skills/api-doctor/SKILL.md +113 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Qualty
|
|
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 THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,15 +1,111 @@
|
|
|
1
|
-
#
|
|
1
|
+
# api-doctor
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@api-doctor/cli)
|
|
4
|
+
[](https://www.npmjs.com/package/@api-doctor/cli)
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
**AI writes code that compiles and passes review — but still hallucinates API integrations.** api-doctor catches those mistakes before you ship.
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
Claude, Cursor, and Codex generate integrations that look finished. api-doctor runs deterministic checks against provider docs so missing webhook verification, hardcoded keys, and silent mutation failures surface before merge.
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
## Install
|
|
9
11
|
|
|
12
|
+
```bash
|
|
10
13
|
npx @api-doctor/cli .
|
|
14
|
+
```
|
|
11
15
|
|
|
16
|
+
https://github.com/user-attachments/assets/53dab24f-528b-4f1b-87a9-8870002053d8
|
|
12
17
|
|
|
13
|
-
|
|
18
|
+
## Supported providers
|
|
14
19
|
|
|
15
|
-
|
|
20
|
+
| Provider | Rules |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| [Resend](https://resend.com/docs) | [13 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/resend/README.md) |
|
|
23
|
+
| [Supabase](https://supabase.com/docs) | [12 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/supabase/README.md) |
|
|
24
|
+
| [Auth0](https://auth0.com/docs) | [4 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/auth0/README.md) |
|
|
25
|
+
| [Firebase](https://firebase.google.com/docs) | [8 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/firebase/README.md) |
|
|
26
|
+
| [Lovable](https://docs.lovable.dev) | [4 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/lovable/README.md) |
|
|
27
|
+
| [Browserbase](https://docs.browserbase.com) | [11 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/browserbase/README.md) |
|
|
28
|
+
| [OpenAI Computer Use](https://developers.openai.com/api/docs/guides/tools-computer-use) | [7 rules](https://github.com/qualtyco/api-doctor/blob/main/src/providers/openai-cua/README.md) |
|
|
29
|
+
|
|
30
|
+
Full rule catalogs live in the [GitHub repo](https://github.com/qualtyco/api-doctor/tree/main/src/providers) under `src/providers/<name>/README.md`.
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## What it catches
|
|
35
|
+
|
|
36
|
+
| Category | What it means | Examples |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| **Security** | Issues that expose you to compromise. Mapped to CWE and OWASP audits. | Hardcoded API keys, secrets in the client bundle, webhooks read before signature verification |
|
|
39
|
+
| **Correctness** | Wrong endpoint or API for the job. | Marketing email via batch send, missing unsubscribe links, test domain in production |
|
|
40
|
+
| **Reliability** | Production failure modes the provider docs warn about. | Missing idempotency keys, batch limits not enforced, error codes not mapped |
|
|
41
|
+
| **Integration** | Wiring gaps your agent won't add on its own. | No tags, no request ID logging, bare `from` address instead of `"Name <email>"` |
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Getting results to your agent
|
|
46
|
+
|
|
47
|
+
Run a scan. Read the report. Fix findings.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx @api-doctor/cli .
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Prints a score to the terminal and writes `.api-doctor/report.json` in the project you scanned.
|
|
54
|
+
|
|
55
|
+
Install the agent skill once so your coding agent knows how to read the report and fix issues:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx @api-doctor/cli install
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Works with Claude Code, Cursor, Codex, OpenCode, and other agents that read project skills. No model calls. **100% deterministic rules.**
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Not a confidence score
|
|
66
|
+
|
|
67
|
+
Asking a model how confident it is doesn't work. api-doctor runs fixed AST rules against your code — same input, same output, every time.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Telemetry
|
|
72
|
+
|
|
73
|
+
api-doctor sends anonymous usage data to PostHog so we can see whether the tool is helping developers catch real bugs.
|
|
74
|
+
|
|
75
|
+
**What we collect:**
|
|
76
|
+
|
|
77
|
+
- CLI version, Node.js version, platform
|
|
78
|
+
- Run context: local, CI, or agent
|
|
79
|
+
- Which API SDKs were detected (e.g. `resend`, `supabase`) — provider names only
|
|
80
|
+
- Which rules fired — rule names only, no code
|
|
81
|
+
- Score and finding counts
|
|
82
|
+
- Score delta between runs on the same project (stored locally in that project's `.api-doctor/run-history.json`)
|
|
83
|
+
- A hashed project identifier (`project_hash`) — SHA-256 of the scanned directory path, not the path itself
|
|
84
|
+
- Sanitized error messages and stack traces on unexpected crashes (paths redacted)
|
|
85
|
+
|
|
86
|
+
**What we never collect:**
|
|
87
|
+
|
|
88
|
+
- Your code or file contents
|
|
89
|
+
- Raw file paths or project names
|
|
90
|
+
- Email, name, or any personally identifying information
|
|
91
|
+
|
|
92
|
+
A random anonymous ID is stored at `~/.api-doctor/install-id`. Per-project run history is stored at `<project>/.api-doctor/run-history.json`. Both stay on your machine — only the event data above is sent to PostHog.
|
|
93
|
+
|
|
94
|
+
**Opt out:**
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
npx @api-doctor/cli . --no-telemetry
|
|
98
|
+
npx @api-doctor/cli install --no-telemetry
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Or set `API_DOCTOR_TELEMETRY=0` or `DO_NOT_TRACK=1` in your environment.
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Contributing
|
|
106
|
+
|
|
107
|
+
Found a bug or want a new provider? [Open an issue](https://github.com/qualtyco/api-doctor/issues).
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
[MIT](LICENSE.md) © Qualty Co
|