launch-doctor 0.4.1 → 0.4.2
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/CHANGELOG.md +29 -1
- package/README.md +78 -439
- package/dist/src/banner.d.ts +22 -0
- package/dist/src/banner.js +35 -0
- package/dist/src/bin.cjs +35 -0
- package/dist/src/bin.d.cts +2 -0
- package/dist/src/checks/access.js +8 -0
- package/dist/src/checks/costs.js +6 -0
- package/dist/src/checks/database.js +29 -0
- package/dist/src/checks/payments.js +12 -0
- package/dist/src/checks/secrets.d.ts +26 -1
- package/dist/src/checks/secrets.js +245 -5
- package/dist/src/cli.js +212 -9
- package/dist/src/fixes.d.ts +8 -1
- package/dist/src/fixes.js +31 -10
- package/dist/src/grade.d.ts +8 -1
- package/dist/src/grade.js +13 -0
- package/dist/src/history.js +9 -2
- package/dist/src/hooks-setup.d.ts +26 -0
- package/dist/src/hooks-setup.js +115 -1
- package/dist/src/index.js +6 -1
- package/dist/src/live.js +5 -3
- package/dist/src/prompt.d.ts +23 -0
- package/dist/src/prompt.js +88 -0
- package/dist/src/report.d.ts +12 -1
- package/dist/src/report.js +27 -15
- package/dist/src/short-report.d.ts +59 -0
- package/dist/src/short-report.js +241 -0
- package/dist/src/types.d.ts +27 -0
- package/dist/src/util.d.ts +2 -0
- package/dist/src/util.js +2 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -13,6 +13,18 @@
|
|
|
13
13
|
|
|
14
14
|
Launch Doctor scans your project for common problems that hurt apps after launch: leaked API keys, databases anyone can read, endpoints that let one user reach another user's data, payments that can be faked, emails that land in spam, AI endpoints that can run up your bill, missing legal pages, and leftover template defaults. It is built for developers who ship with AI coding tools (Claude Code, Cursor, Lovable, Bolt, Windsurf) and may not read every line of generated code. Every finding is explained in plain English and includes a prompt you can paste straight back into your AI assistant. It has no runtime dependencies, requires no account, sends no telemetry, and your code never leaves your machine.
|
|
15
15
|
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
1. In your app's folder, run `npx launch-doctor` (Node.js 22 or newer). Try `npx launch-doctor --demo` first to see a sample app full of mistakes.
|
|
19
|
+
2. Read the verdict and the two grades: Security, and Launch readiness.
|
|
20
|
+
3. Fix the problems under FIX THESE FIRST, one at a time: `npx launch-doctor prompt 1 --copy` puts the first fix prompt on your clipboard to paste into Claude Code, Cursor, Lovable or Bolt. Every prompt is also in `LAUNCH_FIXES.md`.
|
|
21
|
+
4. If a key leaked, rotate it first: the report says where (a link to the provider's page when it knows one).
|
|
22
|
+
5. Run `npx launch-doctor` again and watch the grade change. `--verbose` shows every finding.
|
|
23
|
+
|
|
24
|
+
On a Node.js version older than 22 it says so, with how to update, and stops. The automated tests run on Node.js 22 and 24.
|
|
25
|
+
|
|
26
|
+
More: [all commands and options](docs/cli.md) · [CI and pull request comments](docs/ci.md) · [hooks and the MCP server](docs/ai-tools.md) · [configuration](docs/configuration.md).
|
|
27
|
+
|
|
16
28
|
## Read this first
|
|
17
29
|
|
|
18
30
|
Launch Doctor is a **quick checklist with teeth, not a security audit**. Please trust it accordingly:
|
|
@@ -24,149 +36,55 @@ Launch Doctor is a **quick checklist with teeth, not a security audit**. Please
|
|
|
24
36
|
|
|
25
37
|
The full list is in [What it cannot do](#what-it-cannot-do).
|
|
26
38
|
|
|
27
|
-
##
|
|
39
|
+
## Example output
|
|
40
|
+
|
|
41
|
+
This is the `--demo` report. It shows the verdict, a Security grade and a Launch readiness grade, the three things to fix first, and what to do next. `--verbose` prints the full report with every category and every finding (`--ci`, `--changed`, `--staged`, `--pr-comment` and `scan <url>` always print the full report). On a real project, the Next lines also point to `LAUNCH_FIXES.md`, which starts with one prompt for all the critical problems. The banner only appears in an interactive terminal; in a pipe, in CI or with `--no-banner` the report starts at the "Launch Doctor" line.
|
|
28
42
|
|
|
29
|
-
```bash
|
|
30
|
-
npx launch-doctor
|
|
31
43
|
```
|
|
44
|
+
██╗ █████╗ ██╗ ██╗███╗ ██╗ ██████╗██╗ ██╗
|
|
45
|
+
██║ ██╔══██╗██║ ██║████╗ ██║██╔════╝██║ ██║
|
|
46
|
+
██║ ███████║██║ ██║██╔██╗ ██║██║ ███████║
|
|
47
|
+
██║ ██╔══██║██║ ██║██║╚██╗██║██║ ██╔══██║
|
|
48
|
+
███████╗██║ ██║╚██████╔╝██║ ╚████║╚██████╗██║ ██║
|
|
49
|
+
╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝╚═╝ ╚═╝
|
|
32
50
|
|
|
33
|
-
|
|
51
|
+
██████╗ ██████╗ ██████╗████████╗ ██████╗ ██████╗
|
|
52
|
+
██╔══██╗██╔═══██╗██╔════╝╚══██╔══╝██╔═══██╗██╔══██╗
|
|
53
|
+
██║ ██║██║ ██║██║ ██║ ██║ ██║██████╔╝
|
|
54
|
+
██║ ██║██║ ██║██║ ██║ ██║ ██║██╔══██╗
|
|
55
|
+
██████╔╝╚██████╔╝╚██████╗ ██║ ╚██████╔╝██║ ██║
|
|
56
|
+
╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
|
57
|
+
Launch Doctor v0.4.2 · my-weekend-saas · 13 files · Vite, React, Supabase +2
|
|
34
58
|
|
|
35
|
-
|
|
36
|
-
npx launch-doctor --demo
|
|
37
|
-
```
|
|
59
|
+
NOT READY TO LAUNCH: 6 critical problems
|
|
38
60
|
|
|
39
|
-
|
|
61
|
+
Security F 6 critical · 3 warnings
|
|
62
|
+
Launch readiness D 13 polish items
|
|
40
63
|
|
|
41
|
-
|
|
42
|
-
npx launch-doctor init
|
|
43
|
-
```
|
|
64
|
+
FIX THESE FIRST
|
|
44
65
|
|
|
45
|
-
|
|
66
|
+
1. Anyone can use your Stripe account: the live secret key is in your code
|
|
67
|
+
src/lib/stripe.ts:1 sent to every visitor's browser
|
|
68
|
+
Rotate the key first: https://dashboard.stripe.com/apikeys
|
|
46
69
|
|
|
47
|
-
|
|
70
|
+
2. Anyone can run up your OpenAI bill: the key is public in your website
|
|
71
|
+
.env:3 VITE_OPENAI_API_KEY is copied into your site's JavaScript
|
|
72
|
+
Rotate the key first: https://platform.openai.com/api-keys
|
|
48
73
|
|
|
49
|
-
|
|
74
|
+
3. Anyone can read, change or delete every row in the profiles table
|
|
75
|
+
supabase/migrations/20260101000000_init.sql:1 Row Level Security is off
|
|
50
76
|
|
|
51
|
-
|
|
52
|
-
Launch Doctor v0.4.1
|
|
53
|
-
Checked my-weekend-saas · 13 files · Vite, React, Supabase, Stripe, OpenAI
|
|
54
|
-
|
|
55
|
-
Overall grade F Not ready to launch: fix 6 critical issues first
|
|
56
|
-
|
|
57
|
-
F Secrets & keys 2 critical · 1 to fix · 1 to check
|
|
58
|
-
F Database & backups 2 critical · 1 to check
|
|
59
|
-
B Access control 1 to fix · 1 to check
|
|
60
|
-
F Payments 1 critical · 2 to check
|
|
61
|
-
F AI & API costs 1 critical · 1 to fix · 1 to check
|
|
62
|
-
B Email delivery 1 to fix · 3 to check
|
|
63
|
-
C Errors & monitoring 2 to fix · 2 to check
|
|
64
|
-
D Legal & trust 5 to fix
|
|
65
|
-
D First impressions 5 to fix · 3 to check
|
|
66
|
-
|
|
67
|
-
MUST FIX BEFORE LAUNCH (6)
|
|
68
|
-
|
|
69
|
-
[CRITICAL] Stripe live secret key is written directly in your code
|
|
70
|
-
src/lib/stripe.ts:1
|
|
71
|
-
This file is sent to every visitor's browser, so anyone can copy the key
|
|
72
|
-
(sk_live_…exe9) and use your account.
|
|
73
|
-
|
|
74
|
-
[CRITICAL] Secret exposed through the public variable VITE_OPENAI_API_KEY
|
|
75
|
-
.env:3
|
|
76
|
-
Anything starting with VITE_ gets copied into your website's JavaScript,
|
|
77
|
-
so every visitor can read it. That prefix is only for values that are safe
|
|
78
|
-
to be public.
|
|
79
|
-
...
|
|
80
|
-
```
|
|
77
|
+
Also: 3 more critical · 3 warnings · 13 polish items · 14 to check yourself
|
|
81
78
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
### 1. Internal analysis pipeline
|
|
87
|
-
|
|
88
|
-
The following diagram outlines the multi-stage static analysis pipeline executed on every scan:
|
|
89
|
-
|
|
90
|
-
```mermaid
|
|
91
|
-
flowchart TD
|
|
92
|
-
Start["User / CI triggers: launch-doctor"] --> ParseArgs["1. Argument & Option Parsing"]
|
|
93
|
-
ParseArgs --> LoadContext["2. Project Ingestion & File Discovery"]
|
|
94
|
-
LoadContext --> DetectStack["3. Technology Stack & Environment Detection"]
|
|
95
|
-
DetectStack --> ChecksSuite
|
|
96
|
-
|
|
97
|
-
subgraph ChecksSuite["4. Evaluation across 9 Check Modules"]
|
|
98
|
-
direction TB
|
|
99
|
-
C1["Secrets & Keys Scan"]
|
|
100
|
-
C2["Database Security & RLS"]
|
|
101
|
-
C2b["Access Control & Ownership"]
|
|
102
|
-
C3["Payment Webhooks & Verification"]
|
|
103
|
-
C4["AI Endpoints & Cost Controls"]
|
|
104
|
-
C5["Email DNS & Configuration"]
|
|
105
|
-
C6["Error Boundaries & Monitoring"]
|
|
106
|
-
C7["Legal & Compliance Pages"]
|
|
107
|
-
C8["First Impressions & Defaults"]
|
|
108
|
-
C_Hist["Optional: Git History Commit Walk"]
|
|
109
|
-
end
|
|
110
|
-
|
|
111
|
-
ChecksSuite --> FilterIgnore["5. Suppression & Baseline Filtering"]
|
|
112
|
-
FilterIgnore --> ScoringEngine["6. Scoring & Grading Engine"]
|
|
113
|
-
ScoringEngine --> OutputDispatch
|
|
114
|
-
|
|
115
|
-
subgraph OutputDispatch["7. Multi-Target Outputs"]
|
|
116
|
-
direction TB
|
|
117
|
-
Out1["Terminal Dashboard Output"]
|
|
118
|
-
Out2["LAUNCH_FIXES.md Prompt Catalog"]
|
|
119
|
-
Out3["JSON / SARIF 2.1.0 Reports"]
|
|
120
|
-
Out4["GitHub Actions Step Summary"]
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
OutputDispatch --> ExitEval["8. Exit Code Evaluation (0, 1, or 2)"]
|
|
124
|
-
```
|
|
79
|
+
Next
|
|
80
|
+
npx launch-doctor prompt 1 --demo --copy copy the fix prompt for 1
|
|
81
|
+
npx launch-doctor --demo --verbose the full report
|
|
82
|
+
On your own project, every fix prompt is saved to LAUNCH_FIXES.md.
|
|
125
83
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
1. **Argument parsing and validation (`src/cli.ts`):**
|
|
129
|
-
Evaluates CLI flags, path arguments, targeted categories (`--only`, `--skip`), severity thresholds (`--fail-on`), output destinations (`--out`, `--sarif`), and runtime modifiers (`--ci`, `--offline`, `--history`, `--demo`).
|
|
130
|
-
2. **Project ingestion and tree traversal (`src/project.ts`):**
|
|
131
|
-
Walks the project root, automatically skipping `node_modules`, build artifacts (`dist`, `build`, `.next`), binary formats, and hidden folders (except `.github`). Ingests package manifests (`package.json`, `requirements.txt`, `pyproject.toml`), git status, and `.launchdoctorignore` patterns. Limits: files over 1 MB are skipped, at most 20,000 files are read, and reading stops after 128 MB of text in total; the report says when either limit is hit (`truncated` and `byteLimitReached` in `--json`).
|
|
132
|
-
3. **Stack and environment detection (`src/detect.ts`, `src/comments.ts`):**
|
|
133
|
-
Identifies frameworks (Next.js, Vite, React, Vue, Express, FastAPI, Flask, Django), server routes, database configurations (Supabase, Firebase, Prisma), payment gateways (Stripe, Razorpay), error trackers (Sentry, PostHog), and email services. Prepares a comment-stripped view of source files so commented-out code is not mistaken for active protection.
|
|
134
|
-
4. **Multi-category check execution (`src/checks/`):**
|
|
135
|
-
Runs audits across all 9 categories. If `--history` is enabled, an incremental git commit walker inspects the last `n` commits (default 500) for secrets that were removed from HEAD but remain exposed in commit history.
|
|
136
|
-
5. **Suppression and baseline matching (`src/baseline.ts`):**
|
|
137
|
-
Applies inline `launch-doctor-ignore <id>` comments and `.launchdoctorignore` path or id rules. If `.launchdoctor-baseline.json` is present and baseline mode is active, matches existing findings by ID, relative file path, and line content fingerprint.
|
|
138
|
-
6. **Scoring and grading engine (`src/grade.ts`):**
|
|
139
|
-
Calculates category and overall scores from weighted deductions. Strict scoring ceilings ensure that any critical finding caps both the category score and the overall score at 39 (grade F).
|
|
140
|
-
7. **Multi-target reporting and artifact generation (`src/report.ts`, `src/fixes.ts`, `src/sarif.ts`, `src/summary.ts`):**
|
|
141
|
-
Renders the CLI terminal dashboard, generates `LAUNCH_FIXES.md` with copy-paste prompts for AI models, outputs structured JSON or SARIF 2.1.0 files when requested, and populates GitHub Actions job summaries via `GITHUB_STEP_SUMMARY`.
|
|
142
|
-
8. **Process exit resolution (`src/cli.ts`):**
|
|
143
|
-
Returns exit code 0 whenever the scan finishes (with `--ci`, only when nothing is at or above `--fail-on`), code 1 for CI gate failures, and code 2 for invalid arguments or unexpected runtime errors.
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
### 2. Developer and AI remediation lifecycle
|
|
148
|
-
|
|
149
|
-
Launch Doctor is built to fit directly into your daily development cycle, especially when pairing with AI assistants:
|
|
150
|
-
|
|
151
|
-
```mermaid
|
|
152
|
-
flowchart LR
|
|
153
|
-
Dev["1. Local Development (AI / Human)"] --> Scan["2. Run npx launch-doctor"]
|
|
154
|
-
Scan --> Check{"Grade & Findings?"}
|
|
155
|
-
Check -- "Issues Found (Grade < A)" --> ReadFixes["3. Open LAUNCH_FIXES.md"]
|
|
156
|
-
ReadFixes --> PastePrompt["4. Paste Prompts to AI Tool"]
|
|
157
|
-
PastePrompt --> ReScan["5. Re-run Scan to Verify"]
|
|
158
|
-
ReScan --> Check
|
|
159
|
-
Check -- "Clean (Grade A or Baseline)" --> Commit["6. Commit & Push Code"]
|
|
160
|
-
Commit --> CI["7. CI/CD PR Gate (--ci)"]
|
|
161
|
-
CI --> Deploy["8. Deploy (and check the manual checklist)"]
|
|
84
|
+
Wrong finding? https://github.com/SHARAJ379/Launch-Doctor/issues
|
|
162
85
|
```
|
|
163
86
|
|
|
164
|
-
1.
|
|
165
|
-
2. **Review findings:** Check your letter grade (A-F), category breakdown, and critical blockers in the terminal.
|
|
166
|
-
3. **Copy prompts to AI tools:** Open `LAUNCH_FIXES.md`. Copy the specific problem prompt or the single batch prompt and paste it into Claude Code, Cursor, Windsurf, Lovable, or Bolt.
|
|
167
|
-
4. **Verify remediation:** Re-run `npx launch-doctor` to verify the fixes and watch your grade increase.
|
|
168
|
-
5. **Establish baseline for legacy debt:** If you are adopting Launch Doctor on an existing project, run `npx launch-doctor --update-baseline` so CI only reports new issues.
|
|
169
|
-
6. **Automate CI gating:** Add `npx launch-doctor --ci` to your pull request workflow to catch regressions before they merge.
|
|
87
|
+
`npx launch-doctor prompt 1 --copy` puts fix prompt 1 on the clipboard and tells you which finding it is for. In an empty folder, or in a project in a language the checks don't read (Rust, Java, .NET and so on), Launch Doctor explains that instead of showing a grade.
|
|
170
88
|
|
|
171
89
|
## What it checks
|
|
172
90
|
|
|
@@ -188,20 +106,12 @@ Monitoring, legal, and first impressions checks run on web apps (a frontend fram
|
|
|
188
106
|
|
|
189
107
|
## Live site scan
|
|
190
108
|
|
|
191
|
-
`npx launch-doctor scan https://myapp.com` checks your deployed site from the outside
|
|
192
|
-
|
|
193
|
-
What it looks at: your home page, up to 20 JavaScript files that page loads, their source maps, a fixed list of file paths (`/.env`, `/.git/...`, `backup.sql` and similar), and Supabase tables named in that JavaScript. It does not crawl other pages, log in, fill in forms, or call your API, and it only tests whether Supabase tables can be **read**, not written.
|
|
194
|
-
|
|
195
|
-
| Category | What it catches | Severity range |
|
|
196
|
-
|---|---|---|
|
|
197
|
-
| Exposed files & keys (`live-exposure`) | `/.env`, `/.git` and SQL backups that can be downloaded (the content is verified, so single-page apps that answer 200 for every path are not flagged); public source maps; API keys inside the JavaScript every visitor downloads | Warning to critical |
|
|
198
|
-
| Open database (`live-database`) | Supabase `service_role` key in the page; tables that return rows to anyone holding the public anon key (only `GET`, one row per table, and rows are never saved or shown) | Critical |
|
|
199
|
-
| HTTPS & headers (`live-headers`) | Plain http; http that doesn't redirect to https; missing HSTS, Content-Security-Policy, `X-Content-Type-Options`, frame protection and `Referrer-Policy` | Warning to critical |
|
|
200
|
-
|
|
201
|
-
The report uses the same grades and `--json`, `--ci`, `--fail-on`, `--out` and `--no-file` options. Fix prompts go to `LAUNCH_FIXES_LIVE.md` in the current folder. Run `npx launch-doctor scan --help` for the options.
|
|
109
|
+
`npx launch-doctor scan https://myapp.com` checks your deployed site from the outside: files that should not be public (`/.env`, `/.git`, SQL backups), source maps, API keys in the JavaScript every visitor downloads, Supabase tables anyone can read, and HTTPS and security headers. It makes a few dozen ordinary `GET` requests and never changes anything. Only scan sites you own or are allowed to test. Details: [docs/live-scan.md](docs/live-scan.md).
|
|
202
110
|
|
|
203
111
|
## Grading
|
|
204
112
|
|
|
113
|
+
The report shows two grades: **Security** (secrets, database, access control, payments, AI costs) and **Launch readiness** (email, monitoring, legal, first impressions). Each is worked out from its categories with the same rules as the overall grade below, which `--verbose` and `--json` still show.
|
|
114
|
+
|
|
205
115
|
- **Category score** = 100 − 50 per critical finding − 15 per warning.
|
|
206
116
|
- Any critical finding caps the category at 39, which is an F.
|
|
207
117
|
- Without a critical finding the score never drops below 40, so warnings alone cannot produce an F.
|
|
@@ -214,290 +124,35 @@ The report uses the same grades and `--json`, `--ci`, `--fail-on`, `--out` and `
|
|
|
214
124
|
- **Grade tiers:** A ≥ 90, B ≥ 75, C ≥ 60, D ≥ 40, F < 40.
|
|
215
125
|
- "Check yourself" items do not alter the numerical grade. Baseline findings count toward the grade for awareness, but are ignored by the `--ci` exit code.
|
|
216
126
|
|
|
217
|
-
##
|
|
127
|
+
## Commands
|
|
218
128
|
|
|
219
|
-
|
|
220
|
-
npx launch-doctor [folder] [options]
|
|
221
|
-
npx launch-doctor init [folder] [--hooks | --monitor]
|
|
222
|
-
npx launch-doctor grades [folder] [--json]
|
|
223
|
-
npx launch-doctor scan <url> [options]
|
|
224
|
-
npx launch-doctor mcp
|
|
225
|
-
npx launch-doctor hook <claude|cursor>
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
| Flag | Default | Description |
|
|
229
|
-
|---|---|---|
|
|
230
|
-
| `[folder]` | `.` | Project folder to check |
|
|
231
|
-
| `--domain <domain>` | auto-detected | Domain you send email from; checks SPF, DKIM and DMARC |
|
|
232
|
-
| `--out <file>` | `LAUNCH_FIXES.md` in the project | Where to save the fix prompts |
|
|
233
|
-
| `--no-file` | off | Don't write the fix prompts file |
|
|
234
|
-
| `--json` | off | Print the full report as JSON (no fix file unless `--out` is given) |
|
|
235
|
-
| `--sarif <file>` | off | Also write a SARIF 2.1.0 file for GitHub code scanning |
|
|
236
|
-
| `--pr-comment` | off | On a GitHub pull request, post a summary comment and inline fix prompts (see [Pull request comments](#pull-request-comments)) |
|
|
237
|
-
| `--offline` | off | Skip network checks (email DNS) |
|
|
238
|
-
| `--ci` | off | Exit with code 1 on findings at or above `--fail-on` (no fix file unless `--out`) |
|
|
239
|
-
| `--fail-on <level>` | `critical` | With `--ci`, the lowest severity that fails: `critical` or `warning` |
|
|
240
|
-
| `--only <ids>` | all | Run only these categories (comma-separated) |
|
|
241
|
-
| `--skip <ids>` | none | Skip these categories (comma-separated) |
|
|
242
|
-
| `--history` | off | Also look for keys still in git history |
|
|
243
|
-
| `--history-depth <n>` | `500` | How many commits `--history` reads |
|
|
244
|
-
| `--update-baseline` | off | Save today's findings to `.launchdoctor-baseline.json` as accepted |
|
|
245
|
-
| `--no-baseline` | off | Ignore `.launchdoctor-baseline.json` and show every finding |
|
|
246
|
-
| `--record` | off | Save the grade to `.launchdoctor/grades.json` and redraw `.launchdoctor/badge.svg` (see [Grade history and badge](#grade-history-and-badge)). Not with `--changed`, `--staged`, `--only`, `--skip` or `--demo` |
|
|
247
|
-
| `--config-from <ref>` | off | Read `.launchdoctorignore` and `.launchdoctor-baseline.json` from this git ref (branch, tag or commit) instead of the folder, and ignore inline `launch-doctor-ignore` comments on lines changed since that ref. The GitHub Action passes the pull request's base commit |
|
|
248
|
-
| `--changed` | off | Only report on files changed since the last commit (edited, staged or new). Fast, for hooks. See [Hooks and fast mode](#hooks-and-fast-mode) |
|
|
249
|
-
| `--staged` | off | Only report on files staged for the next commit. For a pre-commit hook |
|
|
250
|
-
| `--demo` | off | Scan a built-in sample app full of mistakes |
|
|
251
|
-
| `-h`, `--help` | | Show help |
|
|
252
|
-
| `-v`, `--version` | | Show the version |
|
|
253
|
-
| `init [folder]` | `.` | Create `.launchdoctorignore` and `.github/workflows/launch-doctor.yml` (never overwrites) |
|
|
254
|
-
| `init --hooks` | `.` | Set up the Claude Code, Cursor and git pre-commit hooks (merges into existing files, never overwrites) |
|
|
255
|
-
| `init --monitor` | `.` | Create `.github/workflows/launch-doctor-monitor.yml`, which re-checks the project every week (see [Scheduled monitoring](#scheduled-monitoring)). Never overwrites |
|
|
256
|
-
| `grades [folder]` | `.` | Show the grades saved with `--record`, newest first (`--json` for the raw list) |
|
|
257
|
-
| `hook <claude|cursor>` | | What the Claude Code and Cursor hooks run. Reads the tool's JSON from stdin; you don't run it yourself |
|
|
258
|
-
| `scan <url>` | | Check your deployed site from the outside (see [Live site scan](#live-site-scan)) |
|
|
259
|
-
| `mcp` | | Start an MCP server so AI coding tools can run checks themselves (see [MCP server](#mcp-server)) |
|
|
260
|
-
| `--no-db` | off | With `scan`, don't test Supabase tables with the public key found in the page |
|
|
261
|
-
|
|
262
|
-
Category ids for `--only` and `--skip`: `secrets`, `database`, `access`, `payments`, `costs`, `email`, `monitoring`, `legal`, `first-impressions`. Skipped categories show as "skipped" and don't count toward the grade.
|
|
263
|
-
|
|
264
|
-
**Exit codes**
|
|
265
|
-
|
|
266
|
-
| Code | Meaning |
|
|
129
|
+
| Command | What it does |
|
|
267
130
|
|---|---|
|
|
268
|
-
| `
|
|
269
|
-
| `
|
|
270
|
-
| `
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
One entry per line. Run `npx launch-doctor init` to generate a starter template.
|
|
277
|
-
|
|
278
|
-
```
|
|
279
|
-
no-error-tracking
|
|
280
|
-
no-account-deletion
|
|
281
|
-
legacy/
|
|
282
|
-
scripts/seed.ts
|
|
283
|
-
**/*.fixture.ts
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
A plain word without path characters represents a finding id. Anything containing `/`, `*`, or `.`, or matching an existing file or folder on disk, is treated as a path pattern. Finding ids that do not correspond to any known check produce a warning to catch typos. Only the first 1,000 entries are used; if the file has more, the report says how many were skipped (and `--json` has `ignoreLinesSkipped`). The file is read only when it is a regular file in the project, not a symlink.
|
|
287
|
-
|
|
288
|
-
### Inline ignores
|
|
289
|
-
|
|
290
|
-
To silence a specific finding at a single line, place a `launch-doctor-ignore <id>` directive on that line or the line directly above it. All directive styles are supported (`//`, `#`, `/* */`, `<!-- -->`, SQL `--`), and multiple ids can be separated by commas:
|
|
291
|
-
|
|
292
|
-
```ts
|
|
293
|
-
// launch-doctor-ignore stripe-test-key
|
|
294
|
-
const STRIPE_TEST_KEY = 'sk_test_...';
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
### Baseline
|
|
298
|
-
|
|
299
|
-
When adding Launch Doctor to an existing codebase, record current findings so CI checks focus exclusively on new issues:
|
|
300
|
-
|
|
301
|
-
```bash
|
|
302
|
-
npx launch-doctor --update-baseline
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
On subsequent runs:
|
|
306
|
-
- Matching findings are tagged with `baseline: true` in JSON output.
|
|
307
|
-
- They are summarized in terminal output as a single "N existing issues (baseline)" line.
|
|
308
|
-
- They are excluded from `--ci` / `--fail-on` failure checks.
|
|
309
|
-
|
|
310
|
-
Findings are tracked by check ID, file path, and a fingerprint of the offending line, preserving baseline matches even as line numbers shift. Run with `--no-baseline` to display all suppressed findings.
|
|
311
|
-
|
|
312
|
-
### Grade history and badge
|
|
313
|
-
|
|
314
|
-
`--record` saves the grade of a full scan so you can see whether the project is getting better or worse:
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
npx launch-doctor --record
|
|
318
|
-
npx launch-doctor grades # the saved grades, newest first
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
- **History:** each run adds one entry to `.launchdoctor/grades.json`: the date, grade, score, the number of critical issues, warnings and things to check yourself, the Launch Doctor version, and the commit that was scanned. Nothing else is saved (no finding text, file names or keys), and only the newest 200 entries are kept.
|
|
322
|
-
- **Comparison:** once a grade is saved, every full scan shows it under the overall grade ("Last recorded grade: B (82) on 30 Nov 2026").
|
|
323
|
-
- **Badge:** `--record` also redraws `.launchdoctor/badge.svg`. It is drawn locally, not by a badge service.
|
|
324
|
-
|
|
325
|
-
`--record` only works on a full scan of a real project: it is refused with `--changed`, `--staged`, `--only`, `--skip` and `--demo`, because their grades aren't comparable. Like other hidden folders, `.launchdoctor/` is never scanned.
|
|
326
|
-
|
|
327
|
-
**On GitHub, let [scheduled monitoring](#scheduled-monitoring) keep the history.** It stores `grades.json` and `badge.svg` on a separate `launch-doctor-grades` branch, never on your default branch, so you don't need to commit `.launchdoctor/` yourself (you can add it to `.gitignore`). Point your README badge at the file on that branch, replacing `<owner>/<repo>` with your repository (`init --monitor` prints the line with them filled in):
|
|
328
|
-
|
|
329
|
-
```markdown
|
|
330
|
-

|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
The badge shows the grade from the last monitoring run. In a private repository, `raw.githubusercontent.com` addresses need a sign-in, so the badge may not show for visitors.
|
|
334
|
-
|
|
335
|
-
## CI integration
|
|
131
|
+
| `npx launch-doctor [folder]` | Check a project: the short report, and `LAUNCH_FIXES.md` with a fix prompt for every problem |
|
|
132
|
+
| `npx launch-doctor --verbose` | The full report: every category and every finding |
|
|
133
|
+
| `npx launch-doctor --demo` | Check a built-in sample app full of mistakes |
|
|
134
|
+
| `npx launch-doctor prompt <n> --copy` | Copy fix prompt n to the clipboard |
|
|
135
|
+
| `npx launch-doctor --ci` | Exit with code 1 on critical problems, for CI |
|
|
136
|
+
| `npx launch-doctor scan <url>` | Check your deployed site from the outside |
|
|
137
|
+
| `npx launch-doctor init` | Create `.launchdoctorignore` and a GitHub Actions workflow |
|
|
138
|
+
| `npx launch-doctor init --hooks` | Check every AI edit and every commit (`--upgrade` moves them to a new version) |
|
|
336
139
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```yaml
|
|
340
|
-
name: Launch Doctor
|
|
341
|
-
on: [pull_request]
|
|
342
|
-
jobs:
|
|
343
|
-
check:
|
|
344
|
-
runs-on: ubuntu-latest
|
|
345
|
-
steps:
|
|
346
|
-
- uses: actions/checkout@v7
|
|
347
|
-
- uses: actions/setup-node@v7
|
|
348
|
-
with:
|
|
349
|
-
node-version: 22
|
|
350
|
-
- run: npx launch-doctor --ci
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
- **Severity gating:** By default, `--ci` exits with code 1 only on critical findings. Add `--fail-on warning` to fail builds on warnings as well.
|
|
354
|
-
- **Job summaries:** When running in GitHub Actions, Launch Doctor automatically writes a markdown summary (including overall grade, category scorecard, and itemized issues with their file and line) to the GitHub Actions job summary tab via `GITHUB_STEP_SUMMARY`.
|
|
355
|
-
- **Step outputs:** When `GITHUB_OUTPUT` is set, the `grade`, `score`, `critical` and `warnings` values are saved as step outputs.
|
|
356
|
-
- **Code scanning alerts:** Export findings to SARIF 2.1.0 format to populate alerts directly in your repository Security tab. The upload step needs permission to write security events, so add it to the job:
|
|
357
|
-
|
|
358
|
-
```yaml
|
|
359
|
-
permissions:
|
|
360
|
-
contents: read
|
|
361
|
-
security-events: write
|
|
362
|
-
steps:
|
|
363
|
-
# ...checkout and setup-node as above...
|
|
364
|
-
- run: npx launch-doctor --sarif launch-doctor.sarif --no-file
|
|
365
|
-
- uses: github/codeql-action/upload-sarif@v3
|
|
366
|
-
if: always()
|
|
367
|
-
with:
|
|
368
|
-
sarif_file: launch-doctor.sarif
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
### Scheduled monitoring
|
|
372
|
-
|
|
373
|
-
A project can get worse without anyone opening a pull request. `npx launch-doctor init --monitor` adds `.github/workflows/launch-doctor-monitor.yml`, which every Monday (and whenever you start it from the Actions tab):
|
|
374
|
-
|
|
375
|
-
1. reads the grade history from the `launch-doctor-grades` branch, if it exists;
|
|
376
|
-
2. scans the project with `--record --ci`, so a critical problem fails the run and GitHub emails you;
|
|
377
|
-
3. if you have set a repository variable named `LAUNCH_DOCTOR_URL` (Settings → Secrets and variables → Actions → Variables), also runs `scan` on that address;
|
|
378
|
-
4. commits the updated `grades.json` and `badge.svg` to the `launch-doctor-grades` branch, also after a failed check, so the history shows the bad weeks too.
|
|
379
|
-
|
|
380
|
-
`launch-doctor-grades` is created on the first run as an orphan branch: it shares no history with your code and holds only those two files. Nothing is ever committed to your default branch, so the monitor works when `main` is protected and doesn't add weekly commits to it. The workflow needs `contents: write` to push to the grades branch; if a branch rule (for example one matching every branch) stops the workflow's token from pushing there, the save step fails and the checks still run. The workflow runs Launch Doctor pinned to the version that created it, like the hooks (see [Hooks and fast mode](#hooks-and-fast-mode)).
|
|
381
|
-
|
|
382
|
-
### Pull request comments
|
|
383
|
-
|
|
384
|
-
The Launch Doctor GitHub Action reviews each pull request like a teammate would:
|
|
385
|
-
|
|
386
|
-
- **Inline comments** on the lines the pull request adds, each with the plain-English risk, a fix prompt you can paste into your AI tool, and the `launch-doctor-ignore` comment that silences it.
|
|
387
|
-
- **One summary comment** with the grade, what this pull request added, what was already in the project, and the category scorecard. It is edited in place on every push, not posted again.
|
|
388
|
-
- Findings that were already commented on are not repeated, findings in `.launchdoctor-baseline.json` are left out, and each run posts at most 20 inline comments (the rest are listed in the summary).
|
|
389
|
-
- `.launchdoctorignore` and `.launchdoctor-baseline.json` are read from the base branch (with `--config-from`), not from the pull request, so a pull request can't silence its own findings by adding lines to them. An ignore or baseline change takes effect once it is merged. Inline `launch-doctor-ignore` comments on lines the pull request adds or changes are ignored too (so are all comments in files it adds); comments that were already on the base branch keep working, even if the pull request moves them down the file. To accept a finding, merge the comment (or the ignore line) first.
|
|
390
|
-
|
|
391
|
-
```yaml
|
|
392
|
-
name: Launch Doctor
|
|
393
|
-
on: [pull_request]
|
|
394
|
-
permissions:
|
|
395
|
-
contents: read
|
|
396
|
-
pull-requests: write
|
|
397
|
-
jobs:
|
|
398
|
-
check:
|
|
399
|
-
runs-on: ubuntu-latest
|
|
400
|
-
steps:
|
|
401
|
-
- uses: actions/checkout@v7
|
|
402
|
-
- uses: SHARAJ379/Launch-Doctor@v0
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
| Input | Default | Description |
|
|
406
|
-
|---|---|---|
|
|
407
|
-
| `path` | `.` | Folder to check, relative to the repository root |
|
|
408
|
-
| `fail-on` | `critical` | Lowest severity that fails the check: `critical`, `warning` or `never` |
|
|
409
|
-
| `comment` | `true` | Post the summary and inline comments on pull requests |
|
|
410
|
-
| `args` | | Extra options, for example `--offline --skip legal` |
|
|
411
|
-
| `github-token` | `${{ github.token }}` | Token used for the comments |
|
|
412
|
-
|
|
413
|
-
The action also sets the `grade`, `score`, `critical` and `warnings` outputs. Pull requests from forks get a read-only token, so they can't be commented on; the check still runs and the job summary still has the results.
|
|
414
|
-
|
|
415
|
-
Using the CLI directly instead? Add `--pr-comment` and pass the token: `npx launch-doctor --ci --pr-comment` with `env: GITHUB_TOKEN: ${{ github.token }}`.
|
|
140
|
+
Every option, the exit codes and the rarely used flags (`--history-depth`, `--config-from`, `--sarif` and others) are in [docs/cli.md](docs/cli.md).
|
|
416
141
|
|
|
417
142
|
## Using with AI coding tools
|
|
418
143
|
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
### With Claude Code
|
|
422
|
-
|
|
423
|
-
```bash
|
|
424
|
-
! npx launch-doctor
|
|
425
|
-
Fix the issues in LAUNCH_FIXES.md one at a time, starting with the critical ones. Explain each change before making it.
|
|
426
|
-
```
|
|
427
|
-
|
|
428
|
-
### With Cursor, Windsurf, Lovable, or Bolt
|
|
429
|
-
|
|
430
|
-
1. Run `npx launch-doctor` in your integrated terminal.
|
|
431
|
-
2. Open `LAUNCH_FIXES.md`.
|
|
432
|
-
3. Copy one fix prompt into the chat window.
|
|
433
|
-
4. Review and accept the code edit.
|
|
434
|
-
5. Re-run `npx launch-doctor` to observe your score improve.
|
|
435
|
-
|
|
436
|
-
### Hooks and fast mode
|
|
437
|
-
|
|
438
|
-
An MCP tool only runs when the AI decides to call it. Hooks run every time, so problems are caught while the AI is still working on the file:
|
|
439
|
-
|
|
440
|
-
```bash
|
|
441
|
-
npx launch-doctor init --hooks
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
This sets up three things, merging into files you already have (it never replaces them, and a settings file that isn't valid JSON is left alone):
|
|
445
|
-
|
|
446
|
-
| Where | What it does |
|
|
447
|
-
|---|---|
|
|
448
|
-
| `.claude/settings.json` | A Claude Code `PostToolUse` hook. After Claude writes or edits a file, Launch Doctor checks that one file. If it finds a problem, Claude gets the problem and the fix prompt straight away (exit code 2), so it can fix it in the same turn. |
|
|
449
|
-
| `.cursor/hooks.json` | A Cursor `stop` hook. When the agent finishes, Launch Doctor checks the files changed since the last commit and, if it finds problems, sends them back to the agent as a follow-up message. (Cursor's `afterFileEdit` hook is not used: its documentation doesn't say that its output reaches the agent.) |
|
|
450
|
-
| `.git/hooks/pre-commit` (or wherever `core.hooksPath` points) | Checks the staged files before each commit. Only critical problems stop the commit; it prints nothing when all is well. Skip it once with `git commit --no-verify`. If the tool itself fails (for example npx can't reach npm), you see the error and the commit goes ahead. An existing shell hook keeps its content and the check is added at the top; a hook written in another language is left alone. |
|
|
451
|
-
|
|
452
|
-
The hooks run `npx --yes "launch-doctor@^X.Y.0"`, pinned to the minor version that wrote them (for example `launch-doctor@^0.4.0`), so a hook never silently starts running a newer minor or major release. npx uses your installed copy if it matches, and otherwise downloads it from npm the first time. To move to a newer version, edit the version in the hook files or delete the Launch Doctor entries and run `init --hooks` again. Everything else stays local.
|
|
453
|
-
|
|
454
|
-
**`--changed` and `--staged`** are the fast mode the hooks use. You can run them yourself too:
|
|
455
|
-
|
|
456
|
-
```bash
|
|
457
|
-
npx launch-doctor --changed # edited, staged and new files since the last commit
|
|
458
|
-
npx launch-doctor --staged --ci # what the next commit will contain; exit code 1 on critical problems
|
|
459
|
-
```
|
|
460
|
-
|
|
461
|
-
The whole project is still read, so checks that look across files (is there a middleware, does this route check who is calling) keep working. Then only findings *in the changed files* are reported. The email DNS lookups are skipped, `LAUNCH_FIXES.md` is not written (unless you pass `--out`), and the report says that it covers only some files. The grade is for those files, not for the project. `--changed` and `--staged` can't be combined with `--update-baseline`, `--pr-comment` or `--history`.
|
|
462
|
-
|
|
463
|
-
**What fast mode can miss compared with a full scan:**
|
|
464
|
-
- Problems with no single file: no error tracking, no privacy policy, no rate limiting, a missing `.env` entry in `.gitignore`, and the "check yourself" list.
|
|
465
|
-
- Problems that appear in a file you didn't touch because of a change elsewhere. If you delete the middleware that protected your API routes, the routes are reported as unprotected only when they are in the changed set.
|
|
466
|
-
- The Claude Code hook checks one file at a time, so it won't mention an older problem in another file.
|
|
467
|
-
- `--staged` reads the files as they are on disk. If you staged only part of a file (`git add -p`), the unstaged part is checked too.
|
|
468
|
-
- Deleted files are not checked, and files git ignores are not reported.
|
|
469
|
-
|
|
470
|
-
Run a full `npx launch-doctor` before you launch, and keep `--ci` on pull requests (see [CI integration](#ci-integration)).
|
|
471
|
-
|
|
472
|
-
### MCP server
|
|
473
|
-
|
|
474
|
-
`launch-doctor mcp` starts a [Model Context Protocol](https://modelcontextprotocol.io) server, so your AI assistant can run the checkup itself, read the findings and fix them without you copying anything.
|
|
475
|
-
|
|
476
|
-
**Claude Code:**
|
|
144
|
+
`LAUNCH_FIXES.md` starts with one prompt for all the critical problems, then has one prompt per problem with the file, the line and the risk in plain English. Paste them one at a time into Claude Code, Cursor, Windsurf, Lovable or Bolt, or copy one with `npx launch-doctor prompt <n> --copy`. `npx launch-doctor init --hooks` makes Claude Code and Cursor run the check after every edit, and `npx launch-doctor mcp` lets your AI tool run it itself. Details: [docs/ai-tools.md](docs/ai-tools.md).
|
|
477
145
|
|
|
478
|
-
|
|
479
|
-
claude mcp add launch-doctor -- npx -y launch-doctor mcp
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
**Cursor** (`.cursor/mcp.json`) and other tools that use the same format:
|
|
483
|
-
|
|
484
|
-
```json
|
|
485
|
-
{
|
|
486
|
-
"mcpServers": {
|
|
487
|
-
"launch-doctor": { "command": "npx", "args": ["-y", "launch-doctor", "mcp"] }
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
```
|
|
491
|
-
|
|
492
|
-
Then ask: *"Run Launch Doctor on this project and fix the critical findings one at a time."*
|
|
493
|
-
|
|
494
|
-
| Tool | What it does |
|
|
495
|
-
|---|---|
|
|
496
|
-
| `scan_project` | Checks a folder (default: the one the assistant works in). Returns the grade, every finding with its file, line, explanation and fix prompt, and the checklist of things to verify by hand. Options: `path`, `only`, `skip`, `offline`, `domain`, `history`, `includeBaseline`. |
|
|
497
|
-
| `scan_url` | Checks a deployed site from the outside, like `launch-doctor scan <url>`. Options: `url`, `skipDatabase`. |
|
|
498
|
-
| `list_checks` | Lists the categories and every finding id, for `only`, `skip` and `.launchdoctorignore`. |
|
|
146
|
+
## Documentation
|
|
499
147
|
|
|
500
|
-
|
|
148
|
+
- [CLI reference](docs/cli.md): every command, option and exit code
|
|
149
|
+
- [Configuration](docs/configuration.md): `.launchdoctorignore`, inline ignores, the baseline, grade history and the badge
|
|
150
|
+
- [CI integration](docs/ci.md): GitHub Actions, SARIF code scanning, scheduled monitoring and pull request comments
|
|
151
|
+
- [AI coding tools](docs/ai-tools.md): Claude Code, Cursor and others, hooks and fast mode, the MCP server
|
|
152
|
+
- [Live site scan](docs/live-scan.md): what `scan <url>` checks
|
|
153
|
+
- [How it works](docs/how-it-works.md): the analysis pipeline and the fix loop
|
|
154
|
+
- [Using it as a library](docs/library.md) (experimental)
|
|
155
|
+
- [Coverage](docs/coverage.md), [roadmap](docs/roadmap.md) and [architecture](docs/architecture.md)
|
|
501
156
|
|
|
502
157
|
## Privacy and network use
|
|
503
158
|
|
|
@@ -519,7 +174,7 @@ Launch Doctor analyzes your codebase locally on your device. Your source code, f
|
|
|
519
174
|
Launch Doctor is useful because it is fast and specific. That also means it has clear blind spots. If any of these matter for your app, use another tool or a human review as well.
|
|
520
175
|
|
|
521
176
|
**Fast mode and hooks check less than a full scan**
|
|
522
|
-
- `--changed`, `--staged` and the hooks report only on the files that changed, so project-wide problems and anything caused by a change in another file are missed. See [Hooks and fast mode](#hooks-and-fast-mode) for the list. They are a safety net while you work, not a replacement for a full run before launch.
|
|
177
|
+
- `--changed`, `--staged` and the hooks report only on the files that changed, so project-wide problems and anything caused by a change in another file are missed. See [Hooks and fast mode](docs/ai-tools.md#hooks-and-fast-mode) for the list. They are a safety net while you work, not a replacement for a full run before launch.
|
|
523
178
|
|
|
524
179
|
**It doesn't see your running app or your production settings**
|
|
525
180
|
- Production environment variables (Vercel, Netlify, Render and others) are invisible. A malformed URL, a wrong key or a bad model name in production will not be caught.
|
|
@@ -554,7 +209,7 @@ For apps that handle significant money or sensitive personal or health data, use
|
|
|
554
209
|
|
|
555
210
|
## How it is tested
|
|
556
211
|
|
|
557
|
-
-
|
|
212
|
+
- 386 automated tests run on every change, on Windows, macOS and Linux, with Node.js 22 and 24.
|
|
558
213
|
- A stress-test harness (`scripts/stress/`, see [CONTRIBUTING.md](CONTRIBUTING.md#stress-tests)) runs Launch Doctor against hostile inputs: repositories whose git settings try to run programs, symlink loops and FIFOs, files built to make a regular expression backtrack, terminal escape sequences, hostile servers for `scan`, and MCP requests to private addresses. Before 0.4.0 it found 10 security problems; each is fixed and has a regression test, and the whole suite now passes on Windows and Linux.
|
|
559
214
|
- Every check that existed in 0.2 has been confirmed against a small project (or fake site) that contains exactly that problem, and every command in this README has been run (the `scan` examples against a local test site rather than a real one).
|
|
560
215
|
- The features new in 0.3.0 (the GitHub Action, the MCP server, mobile apps, and Clerk, Convex, Appwrite, Paddle and Lemon Squeezy) have their own tests and were spot-checked by hand, which found and fixed two bugs before release. They have been tried less than the older checks. Posting pull request comments is tested against a fake GitHub API; it has not yet run on many real pull requests.
|
|
@@ -567,34 +222,18 @@ For apps that handle significant money or sensitive personal or health data, use
|
|
|
567
222
|
|
|
568
223
|
If Launch Doctor reports something that is fine, misses a real problem, or crashes, please open an issue: [report a false alarm](https://github.com/SHARAJ379/Launch-Doctor/issues/new?template=false_positive.yml) or [report a bug](https://github.com/SHARAJ379/Launch-Doctor/issues/new?template=bug_report.yml). A short code snippet that reproduces it (with any keys removed) is the most helpful thing you can include. Fixes are released as small patch versions.
|
|
569
224
|
|
|
570
|
-
Meanwhile you can silence a finding with `.launchdoctorignore` or an inline `launch-doctor-ignore` comment (see [Configuration](
|
|
225
|
+
Meanwhile you can silence a finding with `.launchdoctorignore` or an inline `launch-doctor-ignore` comment (see [Configuration](docs/configuration.md)).
|
|
571
226
|
|
|
572
227
|
## Roadmap
|
|
573
228
|
|
|
574
|
-
What comes next (the 0.5.0 engine rewrite, then milestones such as coverage reporting, more rules for the mistakes AI tools make, opt-in supply-chain and production-settings checks), and what is deliberately not planned, is in [docs/roadmap.md](docs/roadmap.md). Done so far:
|
|
229
|
+
What comes next (the 0.5.0 engine rewrite, then milestones such as coverage reporting, more rules for the mistakes AI tools make, opt-in supply-chain and production-settings checks), and what is deliberately not planned, is in [docs/roadmap.md](docs/roadmap.md). What is checked today, mapped to the OWASP Top 10, and what is not covered, is in [docs/coverage.md](docs/coverage.md). Done so far:
|
|
575
230
|
|
|
576
231
|
- [x] Live URL inspection (`launch-doctor scan <url>`: exposed `.env`, source maps, security headers, open Supabase tables via anonymous key)
|
|
577
|
-
- [x] GitHub Action that posts a summary and inline fix prompts on pull requests ([Pull request comments](#pull-request-comments))
|
|
578
|
-
- [x] Model Context Protocol (MCP) server for direct Claude Code and Cursor integration ([MCP server](#mcp-server))
|
|
232
|
+
- [x] GitHub Action that posts a summary and inline fix prompts on pull requests ([Pull request comments](docs/ci.md#pull-request-comments))
|
|
233
|
+
- [x] Model Context Protocol (MCP) server for direct Claude Code and Cursor integration ([MCP server](docs/ai-tools.md#mcp-server))
|
|
579
234
|
- [x] Extended provider coverage (Clerk, Convex, Appwrite, Lemon Squeezy, Paddle)
|
|
580
235
|
- [x] Mobile framework support (Expo, React Native)
|
|
581
|
-
- [x] Grade history, a README badge and weekly monitoring ([Grade history and badge](#grade-history-and-badge), [Scheduled monitoring](#scheduled-monitoring))
|
|
582
|
-
|
|
583
|
-
## Using it as a library (experimental)
|
|
584
|
-
|
|
585
|
-
The package can also be imported. This API is **experimental**: the names and signatures below keep working through 0.5.0, and any change after that is announced in the changelog first.
|
|
586
|
-
|
|
587
|
-
```ts
|
|
588
|
-
import { runDoctor, renderReport, renderFixes } from 'launch-doctor';
|
|
589
|
-
|
|
590
|
-
const report = await runDoctor('./my-app', { offline: true });
|
|
591
|
-
console.log(report.grade, report.counts);
|
|
592
|
-
process.stdout.write(renderReport(report));
|
|
593
|
-
```
|
|
594
|
-
|
|
595
|
-
- `runDoctor(folder, options)` returns the same report as `--json`. The options include `offline`, `only`, `skip`, `onlyFiles`, `configFrom`, `history`, `baseline`, `maxFiles` and `maxBytes`.
|
|
596
|
-
- `renderReport(report)`, `renderFixes(report)` (the text of `LAUNCH_FIXES.md`), `renderPrComment(...)`, `postPrFeedback(...)` and `prContextFromEnv(...)` are the renderers the CLI and the GitHub Action use.
|
|
597
|
-
- `ProjectContext`, `CHECKS`, `CATEGORY_IDS()` and `isInlineIgnored()` give lower-level access, and the report types are exported too.
|
|
236
|
+
- [x] Grade history, a README badge and weekly monitoring ([Grade history and badge](docs/configuration.md#grade-history-and-badge), [Scheduled monitoring](docs/ci.md#scheduled-monitoring))
|
|
598
237
|
|
|
599
238
|
## Contributing
|
|
600
239
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ASCII banner shown at the top of an interactive full scan.
|
|
3
|
+
*
|
|
4
|
+
* Pre-rendered in the "ANSI Shadow" figlet font (two lines, because one line would be about 100
|
|
5
|
+
* columns wide and wrap in an 80-column terminal). It is a plain string constant on purpose: no
|
|
6
|
+
* figlet dependency. The test suite checks the shape (width, line count); the letters were checked
|
|
7
|
+
* against the real font when it was added.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BANNER: readonly string[];
|
|
10
|
+
/** Spaces in front of every banner line (the same indent as the rest of the report). */
|
|
11
|
+
export declare const BANNER_INDENT = " ";
|
|
12
|
+
/** Columns the terminal needs to show the banner without wrapping. */
|
|
13
|
+
export declare const BANNER_WIDTH: number;
|
|
14
|
+
export interface BannerContext {
|
|
15
|
+
/** The caller's say-so: this is a full scan with none of --json, --ci, --sarif, --out, --changed, --staged, --pr-comment or --no-banner. */
|
|
16
|
+
wanted: boolean;
|
|
17
|
+
isTTY: boolean;
|
|
18
|
+
columns: number | undefined;
|
|
19
|
+
env: NodeJS.ProcessEnv;
|
|
20
|
+
}
|
|
21
|
+
/** Show the banner only on an interactive terminal that is wide enough, and never in CI. */
|
|
22
|
+
export declare function shouldShowBanner(ctx: BannerContext): boolean;
|