@react-grab/cli 0.1.44 → 0.1.45-dev.b85b9b1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-grab/cli",
3
- "version": "0.1.44",
3
+ "version": "0.1.45-dev.b85b9b1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/aidenybai/react-grab.git"
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "agent-install": "^0.0.5",
25
+ "agent-install": "^0.0.6",
26
26
  "commander": "^14.0.3",
27
27
  "ignore": "^7.0.5",
28
28
  "ora": "^9.4.0",
@@ -11,9 +11,9 @@ description: >-
11
11
  # React Grab
12
12
 
13
13
  The user selects UI elements in their browser and copies them with React Grab.
14
- `npx grab pull` waits for new grabs and prints each as one line of JSON (usually
15
- one, sometimes a few if several were copied), starting the background watcher
16
- automatically the first time. Run it in a loop.
14
+ `npx react-grab@latest pull` waits for new grabs and prints each as one line of
15
+ JSON (usually one, sometimes a few if several were copied), starting the
16
+ background watcher automatically the first time. Run it in a loop.
17
17
 
18
18
  ## The loop
19
19
 
@@ -22,17 +22,40 @@ Repeat until the user says stop:
22
22
  1. Wait for the next grab:
23
23
 
24
24
  ```bash
25
- npx grab pull
25
+ npx react-grab@latest pull --max-age 0
26
26
  ```
27
27
 
28
28
  It blocks until the user grabs something, then prints the new grab(s) — one JSON
29
- object per line. Act on every line. If your shell cancels the command before a
30
- grab arrives, just run it again nothing is lost; the watcher keeps capturing in
31
- the background and `pull` resumes where it left off.
29
+ object per line. `--max-age 0` is important: it delivers every grab regardless of
30
+ age, so a comment the user added while you were busy on the previous task isn't
31
+ silently dropped (the default skips grabs older than ~5 min as stale). Act on
32
+ every line. If your shell cancels the command before a grab arrives, just run it
33
+ again — nothing is lost; the watcher keeps capturing in the background and `pull`
34
+ resumes where it left off.
32
35
 
33
36
  2. Act on the grab (below).
34
37
  3. Go back to step 1.
35
38
 
39
+ ## A new grab while you're working wins
40
+
41
+ The watcher never stops capturing — including while you're mid-task. A grab the
42
+ user makes before you finish is them redirecting you, so it supersedes whatever
43
+ you're doing. Don't make them wait for the old task to finish.
44
+
45
+ While acting on a grab:
46
+
47
+ - Run anything slow (dev servers, builds, installs, test runs) as a background
48
+ process, never a blocking foreground call, so you stay free to notice new grabs.
49
+ - Between steps, peek without blocking:
50
+
51
+ ```bash
52
+ npx react-grab@latest pull --max-age 0 --wait 0
53
+ ```
54
+
55
+ Empty output means nothing new — keep going. If it prints a grab, the user has
56
+ moved on: stop the current task, cancel any background processes you started for
57
+ it, and act on the newest grab instead.
58
+
36
59
  ## Acting on a grab
37
60
 
38
61
  Each grab JSON has `content` (the element's source references) and, in prompt
@@ -50,12 +73,10 @@ mode, `prompt` (the user's typed instruction):
50
73
  When the user says stop, run this and don't pull again:
51
74
 
52
75
  ```bash
53
- npx grab stop
76
+ npx react-grab@latest stop
54
77
  ```
55
78
 
56
79
  ## Notes
57
80
 
58
81
  - The watcher reads the clipboard on the machine it runs on — run it on the same
59
82
  machine as the browser, not over SSH or in a remote container.
60
- - Grabs older than ~5 minutes are skipped as stale; use `npx grab pull --max-age 0`
61
- to deliver every grab regardless of age.