snapfail 0.0.15 → 0.0.17
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 +15 -60
- package/dist/index.js +2320 -397
- package/package.json +17 -13
- package/src/index.ts +95 -0
- package/bin/snapfail.js +0 -5
- package/dist/index.d.ts +0 -15
package/README.md
CHANGED
|
@@ -1,78 +1,33 @@
|
|
|
1
1
|
# snapfail
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
CLI for [snapfail](https://snapfail.com) — automatic error capture and AI diagnostics for your web app.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
**SnapFail CLI** is a terminal-based onboarding utility that automatically configures and integrates SnapFail error tracking and session replays inside your Vite and Astro codebases in seconds.
|
|
9
|
-
|
|
10
|
-
Visit the live telemetry dashboard at [app.snapfail.com](https://app.snapfail.com).
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Getting Started
|
|
15
|
-
|
|
16
|
-
You do not need to install the CLI permanently. You can run it on-demand using standard Node `npx`:
|
|
5
|
+
## Install
|
|
17
6
|
|
|
18
7
|
```bash
|
|
19
|
-
npx snapfail init
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Or, if you prefer, install it globally on your system:
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
# npm
|
|
26
8
|
npm install -g snapfail
|
|
27
|
-
|
|
28
|
-
# pnpm
|
|
29
|
-
pnpm add -g snapfail
|
|
30
|
-
|
|
31
|
-
# Bun
|
|
9
|
+
# or
|
|
32
10
|
bun add -g snapfail
|
|
33
11
|
```
|
|
34
12
|
|
|
35
|
-
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
36
15
|
```bash
|
|
16
|
+
# Set up snapfail in your project (one time)
|
|
37
17
|
snapfail init
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Interactive Onboarding Flow
|
|
43
|
-
|
|
44
|
-
Running `snapfail init` initiates a guided terminal onboarding experience:
|
|
45
|
-
|
|
46
|
-
1. **Dashboard Authentication:** Automatically opens your default web browser to [app.snapfail.com/cli-auth](https://app.snapfail.com/cli-auth), securely performing a local CORS-approved handshake to authorize your CLI session.
|
|
47
|
-
2. **Project Selection:** Fetches your existing projects from the SnapFail dashboard, allowing you to select one or instantly create a new one right from the terminal.
|
|
48
|
-
3. **Session Replay Setup:** Prompts whether you want to enable **rrweb Session Replays** (enables full 60-second DOM playback video captures of browser crashes).
|
|
49
|
-
4. **Codebase Inspection:** Detects your project's build tool configuration:
|
|
50
|
-
* **Astro Project:** Locates `astro.config.mjs` / `astro.config.ts`, automatically installs `@snapfail/sdk` using your project's active package manager (`npm`, `pnpm`, `yarn`, or `bun`), and safely injects the `snapfail` integration.
|
|
51
|
-
* **Vite Project:** Locates `vite.config.js` / `vite.config.ts`, automatically installs `@snapfail/sdk`, and injects the `snapfail` Vite plugin.
|
|
52
|
-
* **Vanilla HTML:** Provides a ready-to-copy custom CDN `<script>` tag snippet pre-configured with your project's API Key and the new `sdk.js` loader.
|
|
53
18
|
|
|
54
|
-
|
|
19
|
+
# View unresolved incidents
|
|
20
|
+
snapfail incidents
|
|
55
21
|
|
|
56
|
-
|
|
22
|
+
# View incident detail
|
|
23
|
+
snapfail incident <id>
|
|
57
24
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
npx snapfail --help
|
|
61
|
-
|
|
62
|
-
# Initialize integration in the current directory
|
|
63
|
-
npx snapfail init
|
|
25
|
+
# Get AI diagnosis
|
|
26
|
+
snapfail explain <id>
|
|
64
27
|
```
|
|
65
28
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
## Advanced Detection Features
|
|
69
|
-
|
|
70
|
-
* 📦 **Dynamic Package Manager Detection:** The CLI automatically inspects lockfiles (`package-lock.json`, `pnpm-lock.yaml`, `bun.lock`, `yarn.lock`) to run the correct installation command natively in your project.
|
|
71
|
-
* 🔐 **Secure Handshake:** The CLI launches a temporary local secure server on port `4321` or random fallback, using full cross-origin headers to safely receive authorization tokens back from the dashboard browser.
|
|
72
|
-
* ⚡ **Node.js Native:** Executable binary runs natively in standard Node.js without requiring third-party runtime dependencies (like Bun or ts-node).
|
|
73
|
-
|
|
74
|
-
---
|
|
29
|
+
`snapfail init` detects your framework, authenticates, lets you pick or create a project, writes `SNAPFAIL_PROJECT_KEY` to `.env`, and injects the browser SDK into your config automatically.
|
|
75
30
|
|
|
76
|
-
##
|
|
31
|
+
## Documentation
|
|
77
32
|
|
|
78
|
-
|
|
33
|
+
Full docs at [snapfail.com](https://snapfail.com)
|