@databuddy/scan 0.1.0 → 0.1.1
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 +41 -29
- package/dist/cli.js +477 -311
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,49 +1,61 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @databuddy/scan
|
|
2
2
|
|
|
3
|
-
Find places
|
|
3
|
+
Find the places in your codebase where a product analytics event is missing.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
npx @databuddy/scan
|
|
7
|
-
# or
|
|
8
|
-
bunx @databuddy/scan --run
|
|
6
|
+
npx @databuddy/scan
|
|
9
7
|
```
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
Run it inside a Git repository, or pass a folder to scan only that folder. No account or key. Node.js 22+, or `bunx @databuddy/scan`.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
```
|
|
12
|
+
databuddy. / event scan
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
npx @databuddy/scan --run --no-actions # Review whole files instead of grouped actions
|
|
21
|
-
npx @databuddy/scan --help # All options
|
|
14
|
+
Scan complete · 9 files to review · 13 findings · 14s
|
|
15
|
+
|
|
16
|
+
app/api/stripe/checkout/route.ts:9 · GET · missing · Payments
|
|
17
|
+
app/(dashboard)/pricing/page.tsx:88 · form.action checkoutAction · missing · Payments
|
|
18
|
+
app/(dashboard)/dashboard/page.tsx:204 · form.action inviteAction · missing · Setup & onboarding
|
|
22
19
|
```
|
|
23
20
|
|
|
24
|
-
|
|
21
|
+
## Where your code goes
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
The scan sends code to Databuddy's scan API (`api.databuddy.cc`), which classifies it with the Jev model on Vercel AI Gateway under **zero data retention**. For JavaScript and TypeScript it sends only the user actions it finds and the functions they call, not whole files. **Your source is never stored or logged.** The API only counts scans, using a random run ID, the CLI version and request sizes; nothing identifies you or your repository. The CLI prints where the source is going, with the number of files, before it sends anything.
|
|
27
24
|
|
|
28
|
-
|
|
25
|
+
- `--dry-run` lists every file and line range that would be sent, and sends nothing. `--dry-run --json` prints the exact payload.
|
|
26
|
+
- `databuddy-scan <folder>` reads and sends nothing outside that folder.
|
|
27
|
+
- To keep source off Databuddy entirely, set `AI_GATEWAY_API_KEY` to your own [Vercel AI Gateway](https://vercel.com/docs/ai-gateway) key. Requests then go straight to your account and Databuddy receives nothing.
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
Only Git-tracked files are read. See the [privacy policy](https://www.databuddy.cc/privacy). Tests, examples, symlinks and files that look like they contain secrets are skipped.
|
|
31
30
|
|
|
32
|
-
For
|
|
31
|
+
## For agents
|
|
33
32
|
|
|
34
33
|
```sh
|
|
35
|
-
|
|
36
|
-
bun run --cwd packages/scan build
|
|
37
|
-
bun run --cwd packages/scan check-types
|
|
38
|
-
bun run --cwd packages/scan test
|
|
39
|
-
bun run --cwd packages/scan eval:quality # Offline extraction report
|
|
40
|
-
bun run --cwd packages/scan eval:quality --run # Bounded live comparison
|
|
34
|
+
npx @databuddy/scan --json
|
|
41
35
|
```
|
|
42
36
|
|
|
43
|
-
|
|
37
|
+
Prints every finding with its file, line, coverage (`missing`, `partial`, `covered`), product area and priority, most important first. `summary.destination` and `summary.zeroDataRetention` state where the source went. The privacy notice goes to stderr, so stdout is always one JSON document, including `{"error": ...}` on failure.
|
|
38
|
+
|
|
39
|
+
## Options
|
|
40
|
+
|
|
41
|
+
| | |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `[path]` | Folder or file to scan. Defaults to the current folder. |
|
|
44
|
+
| `--dry-run` | List the lines that would be sent. Sends nothing. |
|
|
45
|
+
| `--json` | Print results as JSON. |
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
Running again is fast: results are cached in `~/.cache/databuddy/scan`, unchanged code is not sent again, and an interrupted scan resumes where it stopped. Findings are suggestions to review; the scanner never edits your code.
|
|
48
|
+
|
|
49
|
+
## Contributing
|
|
50
|
+
|
|
51
|
+
From the Databuddy monorepo root:
|
|
52
|
+
|
|
53
|
+
```sh
|
|
54
|
+
bun ./scan.ts # Run from source
|
|
55
|
+
bun run --cwd packages/scan test # Build and test
|
|
56
|
+
bun run --cwd packages/scan eval:quality # Extraction audit against reviewed cases
|
|
57
|
+
```
|
|
46
58
|
|
|
47
|
-
|
|
59
|
+
## License
|
|
48
60
|
|
|
49
|
-
|
|
61
|
+
MIT
|