@agent-scope/cli 1.20.0 → 1.20.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 +59 -8
- package/dist/cli.js +1928 -404
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +1736 -239
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -3
- package/dist/index.d.ts +12 -3
- package/dist/index.js +1738 -241
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@ CLI for Scope — capture, replay, and analyze React components from the command
|
|
|
8
8
|
- [Quick Start](#quick-start)
|
|
9
9
|
- [Commands Reference](#commands-reference)
|
|
10
10
|
- [scope init](#scope-init)
|
|
11
|
+
- [scope doctor](#scope-doctor)
|
|
11
12
|
- [scope capture](#scope-capture)
|
|
12
13
|
- [scope tree](#scope-tree)
|
|
13
14
|
- [scope report](#scope-report)
|
|
@@ -40,10 +41,12 @@ npx scope --help
|
|
|
40
41
|
|
|
41
42
|
```bash
|
|
42
43
|
# 1. Scaffold configuration in your React project
|
|
44
|
+
# Auto-detects Tailwind tokens + CSS entry file, then generates the manifest automatically
|
|
43
45
|
scope init
|
|
44
46
|
|
|
45
|
-
# 2.
|
|
46
|
-
scope
|
|
47
|
+
# 2. Validate your setup (recommended before first render)
|
|
48
|
+
scope doctor --json
|
|
49
|
+
scope doctor --print-fix-commands
|
|
47
50
|
|
|
48
51
|
# 3. Render all components to screenshots
|
|
49
52
|
scope render all
|
|
@@ -68,7 +71,9 @@ Scaffold a Scope project — creates `reactscope.config.json`, an empty `reactsc
|
|
|
68
71
|
| `-y, --yes` | boolean | `false` | Accept all detected defaults without prompting |
|
|
69
72
|
| `--force` | boolean | `false` | Overwrite existing `reactscope.config.json` |
|
|
70
73
|
|
|
71
|
-
**Auto-detection:** Scope detects your framework (Next.js, Vite, Create React App, etc.), TypeScript support,
|
|
74
|
+
**Auto-detection:** Scope detects your framework (Next.js, Vite, Create React App, etc.), TypeScript support, likely component file patterns, Tailwind design tokens, and your CSS entry file (`src/index.css`, `src/styles.css`, etc.) before prompting.
|
|
75
|
+
|
|
76
|
+
After scaffolding, `scope init` automatically runs `scope manifest generate` so you can start rendering immediately.
|
|
72
77
|
|
|
73
78
|
**Example:**
|
|
74
79
|
|
|
@@ -98,7 +103,10 @@ scope init --force # overwrite existing config
|
|
|
98
103
|
/home/user/project/reactscope.tokens.json
|
|
99
104
|
/home/user/project/.reactscope/
|
|
100
105
|
|
|
101
|
-
|
|
106
|
+
Scanning components...
|
|
107
|
+
Found 12 component(s) — manifest written to .reactscope/manifest.json
|
|
108
|
+
|
|
109
|
+
Next steps: run `scope render all` to generate screenshots.
|
|
102
110
|
```
|
|
103
111
|
|
|
104
112
|
**Files written:**
|
|
@@ -112,6 +120,45 @@ scope init --force # overwrite existing config
|
|
|
112
120
|
|
|
113
121
|
---
|
|
114
122
|
|
|
123
|
+
### `scope doctor`
|
|
124
|
+
|
|
125
|
+
Validate your Scope project configuration. Checks config validity, token file, globalCSS paths, manifest freshness, target-project dependencies, and Playwright Chromium availability.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
scope doctor --json
|
|
129
|
+
scope doctor --print-fix-commands
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
| Flag | Type | Default | Description |
|
|
133
|
+
|------|------|---------|-------------|
|
|
134
|
+
| `--json` | boolean | `false` | Emit structured JSON (for CI integration) |
|
|
135
|
+
| `--print-fix-commands` | boolean | `false` | Print deduplicated remediation commands for failing checks |
|
|
136
|
+
|
|
137
|
+
**Example output:**
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
Scope Doctor
|
|
141
|
+
────────────────────────────────────────
|
|
142
|
+
[✓] config reactscope.config.json valid
|
|
143
|
+
[✓] tokens Token file valid
|
|
144
|
+
[!] globalCSS No globalCSS configured — Tailwind styles won't apply to renders
|
|
145
|
+
[✓] manifest Manifest present and up to date
|
|
146
|
+
[✓] dependencies node_modules present
|
|
147
|
+
[✓] playwright Playwright package available
|
|
148
|
+
────────────────────────────────────────
|
|
149
|
+
1 warning(s) — everything works but could be better
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Exits `0` when clean (warnings are non-fatal), `1` on any error.
|
|
153
|
+
|
|
154
|
+
If `dependencies` fails, run your package manager install command in the target project root (for Bun projects: `bun install`), then rerun `scope doctor --json`.
|
|
155
|
+
|
|
156
|
+
If `playwright` fails, run `PLAYWRIGHT_BROWSERS_PATH=/home/user/.cache/ms-playwright bunx playwright install chromium`, then rerun `scope doctor --json` before retrying `scope render component`, `scope render all`, `scope site build`, or `scope instrument ...`.
|
|
157
|
+
|
|
158
|
+
Use `scope doctor --print-fix-commands` to emit copy/paste-ready remediation commands for the current project.
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
115
162
|
### `scope capture`
|
|
116
163
|
|
|
117
164
|
Capture a React component tree from a live URL and output raw JSON.
|
|
@@ -351,10 +398,10 @@ Render a single component.
|
|
|
351
398
|
| `--manifest <path>` | string | `.reactscope/manifest.json` | Path to manifest |
|
|
352
399
|
|
|
353
400
|
```bash
|
|
354
|
-
scope render Button
|
|
355
|
-
scope render Button --props '{"variant":"primary","size":"lg"}'
|
|
356
|
-
scope render Button --viewport 1280x800 --format json
|
|
357
|
-
scope render Button -o screenshots/button.png
|
|
401
|
+
scope render component Button
|
|
402
|
+
scope render component Button --props '{"variant":"primary","size":"lg"}'
|
|
403
|
+
scope render component Button --viewport 1280x800 --format json
|
|
404
|
+
scope render component Button -o screenshots/button.png
|
|
358
405
|
```
|
|
359
406
|
|
|
360
407
|
**JSON output:**
|
|
@@ -420,6 +467,10 @@ scope render all
|
|
|
420
467
|
scope render all --concurrency 8 --output-dir ./screenshots
|
|
421
468
|
```
|
|
422
469
|
|
|
470
|
+
If a component's `.scope.tsx` file defines 2 or more scenarios, `render all` automatically runs a matrix render and merges the cells into the component's JSON output. No separate `scope render matrix` step needed.
|
|
471
|
+
|
|
472
|
+
After all renders complete, `.reactscope/compliance-styles.json` is written with aggregated computed styles across every component.
|
|
473
|
+
|
|
423
474
|
**Progress output (stderr):**
|
|
424
475
|
|
|
425
476
|
```
|