shotsweep 0.0.0-stage → 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DHANUSH G
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,3 +1,163 @@
1
- # Temporary Holding Version
1
+ # shotsweep
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Capture every screen of your web app with one command, then give the batch to any AI for review.
4
+
5
+ Apps built with AI coding tools often ship before anyone has looked at every screen. shotsweep visits your running app, finds the pages, closes the onboarding popups, logs in for you, and bundles labeled, compressed screenshots with a ready-made review prompt. Capturing uses plain code, so it costs **zero AI credits**. You spend tokens once, when you upload the finished batch to ChatGPT, Claude, Gemini, or a human reviewer.
6
+
7
+ <!-- Add a demo GIF here: ![shotsweep demo](docs/demo.gif) -->
8
+
9
+ ## Quick start
10
+
11
+ Start your app (for example `npm run dev`), then in another terminal:
12
+
13
+ ```bash
14
+ npx shotsweep http://localhost:3000
15
+ ```
16
+
17
+ The first run downloads the Chromium browser used for screenshots (about 150 MB, one time). You get:
18
+
19
+ ```
20
+ shotsweep-export/
21
+ ├── manifest.md routes, viewports and a review prompt to paste into the AI
22
+ ├── 01-home-desktop.jpg
23
+ ├── 01-home-mobile.jpg
24
+ ├── 02-dashboard-desktop.jpg
25
+ └── ...
26
+ shotsweep-export.zip the same, zipped
27
+ ```
28
+
29
+ Requires Node.js 18 or newer.
30
+
31
+ ## What it does
32
+
33
+ - **Finds your pages by itself.** It reads your source code (`-p ./my-app`), `sitemap.xml`, links on the page, `#hash` routes, and menus that switch screens without changing the URL.
34
+ - **Gets past popups.** It clicks through onboarding tours and modals, however many steps they have, then captures the real page. Add `--capture-popups` to photograph each step too.
35
+ - **Works behind a login.** Log in by hand once (`--login`), or let it sign in with a test account from your config. Capture the logged-out login page with `--logged-out "/login"`.
36
+ - **Makes uploads cheap and readable.** Images are resized, converted to JPEG, and very tall pages are split into parts so text stays legible when an AI shrinks the image.
37
+ - **Stays safe.** It never clicks Log out, and it skips buttons that look like actions (Generate, Save, Export, Delete, Pay, Upload ...).
38
+ - **Runs locally.** Nothing is sent anywhere. Files leave your machine only when you upload them.
39
+
40
+ ## Common commands
41
+
42
+ ```bash
43
+ npx shotsweep http://localhost:3000 # discover and capture everything
44
+ npx shotsweep http://localhost:3000 -p ./my-app # also read routes from your source code
45
+ npx shotsweep http://localhost:3000 -v desktop # desktop only (half the images)
46
+ npx shotsweep http://localhost:3000 -r /,/pricing # only these routes
47
+ npx shotsweep http://localhost:3000 -x "/admin/*" # skip routes
48
+ npx shotsweep --init # create shotsweep.config.json
49
+ npx shotsweep # run with settings from shotsweep.config.json
50
+ ```
51
+
52
+ ## Login
53
+
54
+ **Log in by hand once** (works with Google login and 2FA):
55
+
56
+ ```bash
57
+ npx shotsweep http://localhost:3000 --login
58
+ ```
59
+
60
+ A browser window opens. Log in, then press Enter in the terminal. The session is saved to `.shotsweep/auth.json` and reused automatically.
61
+
62
+ **Or sign in automatically with a test account**, in `shotsweep.config.json`:
63
+
64
+ ```json
65
+ {
66
+ "login": {
67
+ "url": "/login",
68
+ "email": "${SHOTSWEEP_EMAIL}",
69
+ "password": "${SHOTSWEEP_PASSWORD}"
70
+ }
71
+ }
72
+ ```
73
+
74
+ Set the variables first. Windows cmd: `set SHOTSWEEP_EMAIL=test@example.com`. PowerShell: `$env:SHOTSWEEP_EMAIL="test@example.com"`. macOS/Linux: `export SHOTSWEEP_EMAIL=test@example.com`. For unusual forms you can give your own `steps` (fill, click, press, waitFor, goto, wait).
75
+
76
+ Use a test account on a dev site. `.shotsweep/auth.json` holds live session tokens, so never commit or share it.
77
+
78
+ ## Config file
79
+
80
+ Keep settings per site in `shotsweep.config.json` (see `examples/`). Priority: command-line flag, then config file, then default.
81
+
82
+ ```json
83
+ {
84
+ "url": "http://localhost:3000",
85
+ "project": "./my-app",
86
+ "viewports": ["desktop", "mobile"],
87
+ "popupButtons": ["Launch Studio"],
88
+ "skipLabels": ["Need help? Chat with us"],
89
+ "exclude": ["/admin/*"],
90
+ "loggedOutRoutes": ["/login"],
91
+ "capturePopups": false,
92
+ "maxWidth": 1280,
93
+ "imageFormat": "jpeg",
94
+ "quality": 80
95
+ }
96
+ ```
97
+
98
+ Use `-c other.json` to pick a different config file.
99
+
100
+ ## All options
101
+
102
+ | Option | Meaning | Default |
103
+ |---|---|---|
104
+ | `-c, --config <file>` | config file | `shotsweep.config.json` |
105
+ | `--init` | create a config template and exit | |
106
+ | `-o, --out <dir>` | output folder | `shotsweep-export` |
107
+ | `-v, --viewports <list>` | `desktop`, `tablet`, `mobile` | `desktop,mobile` |
108
+ | `-m, --max-pages <n>` | max pages to discover | `30` |
109
+ | `-r, --routes <list>` | skip discovery, use these routes | |
110
+ | `-p, --project <dir>` | read routes from your source folder | |
111
+ | `-x, --exclude <list>` | route patterns to skip | |
112
+ | `-s, --skip-labels <list>` | buttons never to click (exact label) | |
113
+ | `--popup-buttons <list>` | extra popup button labels to click | |
114
+ | `--capture-popups` | also screenshot each popup step | off |
115
+ | `--login` | log in by hand and save the session | |
116
+ | `--auth <file>` | saved login file | `.shotsweep/auth.json` |
117
+ | `--logged-out <list>` | capture these routes without the saved login | |
118
+ | `--no-click` | do not click menus to find screens | |
119
+ | `--no-session` | do not reuse browser storage between pages | |
120
+ | `-d, --delay <ms>` | extra wait after load | `500` |
121
+ | `--no-optimize` | keep full-size PNGs | |
122
+ | `--max-width <px>` | shrink wider images | `1280` |
123
+ | `--slice-height <px>` | split taller pages into parts (0 = never) | `1400` |
124
+ | `--format <fmt>` | `jpeg`, `webp`, `png` | `jpeg` |
125
+ | `--quality <n>` | JPEG/WebP quality | `80` |
126
+ | `--keep-originals` | keep PNGs in `<out>-originals` | |
127
+ | `--no-zip` | do not create the ZIP | |
128
+ | `-V, --version` | print the version | |
129
+
130
+ ## Troubleshooting
131
+
132
+ - **"Cannot reach ..."**: your dev server is not running, or the port is different.
133
+ - **Only the home page is found**: pass your source folder with `-p`, or list routes with `-r /,/about,/pricing`.
134
+ - **A popup is still on screen**: the output lists the button names it saw. Add the right one with `--popup-buttons "Button text"`.
135
+ - **Blank or half-loaded screenshots**: add wait time with `-d 1500`.
136
+ - **Screens behind a login look like the login page**: run `--login` again, the session may have expired.
137
+
138
+ ## Limits
139
+
140
+ - State kept only in `sessionStorage` is not saved with the login.
141
+ - Modals that add only a few words to a page count as the same screen as the page.
142
+ - Sites that block automated browsers (strict bot protection) may not load.
143
+
144
+ ## Try it without a project
145
+
146
+ `examples/landing-test/` is a small demo site with a landing page, a login (any email and password works) and a dashboard.
147
+
148
+ ```bash
149
+ cd examples/landing-test && npx serve -l 3000 . # terminal 1
150
+ npx shotsweep -c examples/shotsweep.landing-test.json # terminal 2
151
+ ```
152
+
153
+ ## Development
154
+
155
+ ```bash
156
+ npm install
157
+ npm run dev -- http://localhost:3000 # run from source
158
+ npm run build # compile to dist/
159
+ ```
160
+
161
+ ## License
162
+
163
+ MIT