thief-cli 0.0.0-stage → 0.2.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/README.md +59 -2
- package/dist/LICENSE +21 -0
- package/dist/thief.js +294 -0
- package/dist/thief.js.LEGAL.txt +254 -0
- package/dist/viewer/index.html +58 -0
- package/dist/viewer/viewer.css +1 -0
- package/dist/viewer/viewer.js +4313 -0
- package/package.json +46 -3
package/README.md
CHANGED
|
@@ -1,3 +1,60 @@
|
|
|
1
|
-
#
|
|
1
|
+
# thief-cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Thief explains why a web page is slow. It captures page loads in headless Chrome and ranks their **Bottlenecks** (waiting, too many requests, too heavy, not cached, busy CPU, memory). Each one is charged to the **Entity** behind it: your own code, or a third party like Google Tag Manager, which also pays for everything it injects. Two Runs can be compared, and a **What-if Run** measures what the page costs with a third party, a hostname or a file blocked.
|
|
4
|
+
|
|
5
|
+
It's built for people, for CI and for coding agents.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
You need Node.js 24 or later and Google Chrome.
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g thief-cli
|
|
13
|
+
# or, without installing:
|
|
14
|
+
npx thief-cli --help
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Use
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
# Capture a page: 3 loads, median kept, Fast 4G, CPU ×4, cold cache
|
|
21
|
+
thief capture https://example.com/
|
|
22
|
+
|
|
23
|
+
# What does Google Tag Manager cost? Captures a fresh baseline alongside, alternating the loads
|
|
24
|
+
thief capture https://example.com/ --block="Google Tag Manager"
|
|
25
|
+
|
|
26
|
+
# Read a Recording again, compare two, dig into its requests
|
|
27
|
+
thief analyse example.com-2026-11-20-21-00-00.thief.json
|
|
28
|
+
thief compare before.thief.json after.thief.json
|
|
29
|
+
thief requests run.thief.json --entity="Google Tag Manager" --sort=size
|
|
30
|
+
|
|
31
|
+
# See it in 3D: a self-contained HTML page, opened in your browser
|
|
32
|
+
thief view run.thief.json
|
|
33
|
+
|
|
34
|
+
# Network data for other tools
|
|
35
|
+
thief export run.thief.json --har
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Run `thief --help` for every flag: network and CPU throttling, viewport, `--mobile`, `--warm`, `--overrides`, `-o`.
|
|
39
|
+
|
|
40
|
+
## Capture production builds
|
|
41
|
+
|
|
42
|
+
Capture what your users get: a production build (`build` + `preview`) or a deployed URL. A dev server serves an unbundled page and measures the wrong thing. Thief warns when the URL is local.
|
|
43
|
+
|
|
44
|
+
## JSON for CI and agents
|
|
45
|
+
|
|
46
|
+
Add `--json` to any command to get the `thief.cli/1` contract on stdout: Findings with their **evidence** (request and script URLs, Entity, bytes, timings), key moments, cost per Entity, and Comparisons. See [docs/cli-json.md](https://github.com/GuillaumeAmat/thief/blob/main/docs/cli-json.md).
|
|
47
|
+
|
|
48
|
+
Exit codes: 0 ok, 1 failure, 2 usage. Thief has no scores and no pass/fail on performance. Keep the `.thief.json` Recordings as CI artifacts.
|
|
49
|
+
|
|
50
|
+
## Coding agents
|
|
51
|
+
|
|
52
|
+
The Thief Agent Skill teaches an agent to capture a page, trace each Finding's evidence to the code, fix it, and prove the gain with a Comparison. To install it, copy [`skills/thief`](https://github.com/GuillaumeAmat/thief/tree/main/skills/thief) into your project's `.claude/skills/` folder, or wherever your agent loads skills from:
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
npx degit GuillaumeAmat/thief/skills/thief .claude/skills/thief
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Licence
|
|
59
|
+
|
|
60
|
+
MIT
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Guillaume Amat
|
|
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.
|