@reqray/cli 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 +51 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,12 +1,58 @@
|
|
|
1
1
|
# @reqray/cli
|
|
2
2
|
|
|
3
|
-
Reqray from the terminal: a live
|
|
3
|
+
Reqray from the terminal: a live stream of requests, and one request in full —
|
|
4
|
+
waterfall, findings with the line of code, the response. A client of the same
|
|
5
|
+
API the web panel uses, so there is nothing to configure in the application.
|
|
4
6
|
|
|
5
|
-
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
Part of [Reqray](https://github.com/reqray/reqray) — a dev panel and request inspector for Node.js. It
|
|
8
|
+
instruments HTTP, SQL, outgoing calls and cache on its own, shows every
|
|
9
|
+
request as a waterfall, and finds N+1 down to the file and the line.
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
## Use
|
|
12
|
+
|
|
13
|
+
```console
|
|
14
|
+
$ npx @reqray/cli watch --slower-than 100
|
|
15
|
+
reqray 0.1.0 watching localhost:3000 pid 41822 ctrl-c to stop
|
|
16
|
+
|
|
17
|
+
TIME METHOD ST PATH DUR Q FLAGS
|
|
18
|
+
09:41:03.077 POST 201 /api/orders 118ms 9q
|
|
19
|
+
! 09:42:10.184 GET 200 /api/orders 512ms 51q N+1
|
|
20
|
+
!! 09:43:02.184 POST 500 /api/orders 2.14s 12q ERR
|
|
21
|
+
└ TypeError: Cannot read properties of undefined (reading 'currency')
|
|
22
|
+
services/pricing.js:61
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
reqray show --last --failed # the last request that failed, whole
|
|
27
|
+
reqray show --last --path /orders
|
|
28
|
+
reqray show <id> --sql # every query, wrapped rather than cut
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Commands
|
|
32
|
+
|
|
33
|
+
| | |
|
|
34
|
+
|---|---|
|
|
35
|
+
| `reqray watch` | Follow requests as they happen. `--slower-than <ms>`, `--status`, `--method`, `--path <s>`, `--findings-only`, `--ids` |
|
|
36
|
+
| `reqray show <id>` | One request. Or pick it by question: `--last`, `--last --failed`, `--last --slowest`, `--last --path <s>`. `--sql`, `--body`, `--full`, `--json` |
|
|
37
|
+
|
|
38
|
+
| Flag | |
|
|
39
|
+
|---|---|
|
|
40
|
+
| `--url <address>` | Where the panel is. Default `http://localhost:3000/_reqray`; also `REQRAY_URL` |
|
|
41
|
+
| `--token <token>` | For a collector started with one; also `REQRAY_TOKEN` |
|
|
42
|
+
| `--no-color`, `--ascii` | No escape codes; no box-drawing characters |
|
|
43
|
+
| `--verbose` | Print what actually failed |
|
|
44
|
+
|
|
45
|
+
Severity is a glyph in the first two columns, not a colour, so a pipe, a CI log
|
|
46
|
+
and `NO_COLOR` lose nothing. Exit codes: 0, 1 for a failure or a collector that
|
|
47
|
+
cannot be reached, 2 for bad arguments.
|
|
48
|
+
|
|
49
|
+
A collector on another machine is an ordinary URL: forward its port over ssh
|
|
50
|
+
and pass `--url`.
|
|
51
|
+
|
|
52
|
+
## More
|
|
53
|
+
|
|
54
|
+
Everything else — the detectors, security defaults, measured overhead and a
|
|
55
|
+
demo that runs with one command — is in the
|
|
10
56
|
[main README](https://github.com/reqray/reqray#readme).
|
|
11
57
|
|
|
12
58
|
## License
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reqray/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Reqray from the terminal: a live request stream and a full breakdown of one request.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@reqray/
|
|
51
|
-
"@reqray/
|
|
50
|
+
"@reqray/protocol": "^0.1.1",
|
|
51
|
+
"@reqray/waterfall": "^0.1.1"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^26.2.0",
|