create-canary 0.1.0 → 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 +43 -10
- package/dist/cli.js +50 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,26 +1,59 @@
|
|
|
1
1
|
# create-canary
|
|
2
2
|
|
|
3
|
-
The setup wizard for [
|
|
4
|
-
drives real browsers, records QA sessions (Playwright trace, video, network HAR, console), and
|
|
5
|
-
renders self-contained verification reports.
|
|
3
|
+
> The guided setup wizard for [Canary](https://github.com/usecanary/canary) — an AI-agent QA toolkit
|
|
4
|
+
> that drives real browsers, records QA sessions (Playwright trace, video, network HAR, console), and
|
|
5
|
+
> renders self-contained verification reports.
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/create-canary)
|
|
8
|
+
[](https://github.com/usecanary/canary)
|
|
9
|
+
|
|
10
|
+
One command to get Canary, its browser runtime, and the agent integration set up — no flags to
|
|
11
|
+
remember. Every step just shells out to the same published commands you could run by hand, so there's
|
|
12
|
+
no magic and nothing bespoke to uninstall.
|
|
6
13
|
|
|
7
14
|
## Use
|
|
8
15
|
|
|
9
16
|
```bash
|
|
10
17
|
npm create canary
|
|
11
|
-
# or:
|
|
18
|
+
# or: npm init canary · pnpm create canary · yarn create canary
|
|
12
19
|
```
|
|
13
20
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
21
|
+
You'll get a checklist (space toggles, enter confirms). Recommended items are pre-selected:
|
|
22
|
+
|
|
23
|
+
| Step | Default | What it runs |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| Install the `canary` command globally | ✓ | `npm i -g @usecanary/cli` |
|
|
26
|
+
| Install the browser runtime (Chromium) | ✓ | `canary install` |
|
|
27
|
+
| Install the agent skills (any tool) | ✓ | `npx skills add usecanary/canary` |
|
|
28
|
+
| Install the Claude Code plugin (slash commands) | ✓ | `claude plugin marketplace add …` + `plugin install …` |
|
|
29
|
+
| Also install `canary-browser` globally | — | `npm i -g @usecanary/browser` |
|
|
30
|
+
| Also install the `canary-viewer` viewer globally | — | `npm i -g @usecanary/ui` |
|
|
31
|
+
|
|
32
|
+
Installing the CLIs globally puts `canary`, `canary-browser`, and `canary-viewer` on your `PATH` so
|
|
33
|
+
day-to-day use drops the `npx` prefix. If the Claude Code CLI isn't found, the wizard prints the
|
|
34
|
+
in-app `/plugin …` commands to run instead.
|
|
35
|
+
|
|
36
|
+
### Non-interactive
|
|
37
|
+
|
|
38
|
+
In a pipe or CI (no TTY), the wizard prints the exact commands to run instead of prompting — safe to
|
|
39
|
+
inspect before executing.
|
|
17
40
|
|
|
18
41
|
## After setup
|
|
19
42
|
|
|
20
43
|
```bash
|
|
21
|
-
canary
|
|
22
|
-
canary session
|
|
23
|
-
|
|
44
|
+
canary session start --name "checkout" # start a recorded session (prints an id)
|
|
45
|
+
canary run ./step.js --session <id> --step "open"
|
|
46
|
+
canary session end <id> # -> ~/.canary/sessions/<id>/report.html
|
|
47
|
+
canary-viewer # browse recorded sessions
|
|
24
48
|
```
|
|
25
49
|
|
|
50
|
+
Using a coding agent? Try `/canary:verify` (plan QA for your changes) or `/canary:session` (record a
|
|
51
|
+
flow) in Claude Code / Cursor / Codex. See `examples/` in the repo for runnable demos.
|
|
52
|
+
|
|
53
|
+
## Related packages
|
|
54
|
+
|
|
55
|
+
- [`@usecanary/cli`](https://www.npmjs.com/package/@usecanary/cli) — the `canary` session orchestrator.
|
|
56
|
+
- [`@usecanary/browser`](https://www.npmjs.com/package/@usecanary/browser) — one-off automation engine.
|
|
57
|
+
- [`@usecanary/ui`](https://www.npmjs.com/package/@usecanary/ui) — the `canary-viewer` session browser.
|
|
58
|
+
|
|
26
59
|
MIT · [source](https://github.com/usecanary/canary)
|
package/dist/cli.js
CHANGED
|
@@ -36377,17 +36377,37 @@ function claudeAvailable() {
|
|
|
36377
36377
|
function buildSteps() {
|
|
36378
36378
|
const hasClaude = claudeAvailable();
|
|
36379
36379
|
return [
|
|
36380
|
+
{
|
|
36381
|
+
id: "cli-global",
|
|
36382
|
+
label: "Install the `canary` command globally (so you can skip npx)",
|
|
36383
|
+
commands: [{ file: "npm", args: ["i", "-g", "@usecanary/cli"] }],
|
|
36384
|
+
defaultSelected: true
|
|
36385
|
+
},
|
|
36380
36386
|
{
|
|
36381
36387
|
id: "runtime",
|
|
36382
36388
|
label: "Install the browser runtime (downloads Chromium)",
|
|
36383
|
-
commands: [{ file: "npx", args: ["-y", "@usecanary/cli", "install"] }]
|
|
36389
|
+
commands: [{ file: "npx", args: ["-y", "@usecanary/cli", "install"] }],
|
|
36390
|
+
defaultSelected: true
|
|
36391
|
+
},
|
|
36392
|
+
{
|
|
36393
|
+
id: "browser-global",
|
|
36394
|
+
label: "Also install `canary-browser` globally (one-off automation)",
|
|
36395
|
+
commands: [{ file: "npm", args: ["i", "-g", "@usecanary/browser"] }],
|
|
36396
|
+
defaultSelected: false
|
|
36397
|
+
},
|
|
36398
|
+
{
|
|
36399
|
+
id: "ui-global",
|
|
36400
|
+
label: "Also install the session viewer `canary-viewer` globally",
|
|
36401
|
+
commands: [{ file: "npm", args: ["i", "-g", "@usecanary/ui"] }],
|
|
36402
|
+
defaultSelected: false
|
|
36384
36403
|
},
|
|
36385
36404
|
{
|
|
36386
36405
|
id: "skills",
|
|
36387
36406
|
label: "Install the agent skills (any tool \u2014 ~/.claude/skills, etc.)",
|
|
36388
36407
|
commands: [
|
|
36389
36408
|
{ file: "npx", args: ["-y", "skills", "add", "usecanary/canary"] }
|
|
36390
|
-
]
|
|
36409
|
+
],
|
|
36410
|
+
defaultSelected: true
|
|
36391
36411
|
},
|
|
36392
36412
|
{
|
|
36393
36413
|
id: "plugin",
|
|
@@ -36402,7 +36422,8 @@ function buildSteps() {
|
|
|
36402
36422
|
args: ["plugin", "install", "canary@canary-marketplace"]
|
|
36403
36423
|
}
|
|
36404
36424
|
] : [],
|
|
36405
|
-
manualHint: "/plugin marketplace add usecanary/canary then /plugin install canary@canary-marketplace"
|
|
36425
|
+
manualHint: "/plugin marketplace add usecanary/canary then /plugin install canary@canary-marketplace",
|
|
36426
|
+
defaultSelected: true
|
|
36406
36427
|
}
|
|
36407
36428
|
];
|
|
36408
36429
|
}
|
|
@@ -36426,7 +36447,7 @@ function SelectStep(props) {
|
|
|
36426
36447
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
36427
36448
|
MultiSelect,
|
|
36428
36449
|
{
|
|
36429
|
-
defaultValue: props.steps.map((s) => s.id),
|
|
36450
|
+
defaultValue: props.steps.filter((s) => s.defaultSelected).map((s) => s.id),
|
|
36430
36451
|
onSubmit: props.onSubmit,
|
|
36431
36452
|
options: props.steps.map((s) => ({ label: s.label, value: s.id }))
|
|
36432
36453
|
}
|
|
@@ -36439,9 +36460,17 @@ function printManual() {
|
|
|
36439
36460
|
"",
|
|
36440
36461
|
"canary setup \u2014 run these:",
|
|
36441
36462
|
"",
|
|
36442
|
-
"
|
|
36463
|
+
" npm i -g @usecanary/cli # adds the `canary` command",
|
|
36464
|
+
" canary install # browser runtime (Chromium)",
|
|
36443
36465
|
" npx skills add usecanary/canary # agent skills (any tool)",
|
|
36444
|
-
"
|
|
36466
|
+
"",
|
|
36467
|
+
"Optional:",
|
|
36468
|
+
" npm i -g @usecanary/browser # canary-browser (one-off automation)",
|
|
36469
|
+
" npm i -g @usecanary/ui # canary-viewer (session viewer)",
|
|
36470
|
+
"",
|
|
36471
|
+
"Then:",
|
|
36472
|
+
" canary session start --name checkout",
|
|
36473
|
+
" canary-viewer # browse recorded sessions",
|
|
36445
36474
|
"",
|
|
36446
36475
|
"Claude Code plugin:",
|
|
36447
36476
|
" /plugin marketplace add usecanary/canary",
|
|
@@ -36451,6 +36480,7 @@ function printManual() {
|
|
|
36451
36480
|
);
|
|
36452
36481
|
}
|
|
36453
36482
|
async function runSelected(steps, selected) {
|
|
36483
|
+
const cliGlobal = selected.includes("cli-global");
|
|
36454
36484
|
for (const step of steps) {
|
|
36455
36485
|
if (!selected.includes(step.id)) {
|
|
36456
36486
|
continue;
|
|
@@ -36458,7 +36488,8 @@ async function runSelected(steps, selected) {
|
|
|
36458
36488
|
process.stdout.write(`
|
|
36459
36489
|
\u25B6 ${step.label}
|
|
36460
36490
|
`);
|
|
36461
|
-
|
|
36491
|
+
const commands = step.id === "runtime" && cliGlobal ? [{ file: "canary", args: ["install"] }] : step.commands;
|
|
36492
|
+
if (commands.length === 0) {
|
|
36462
36493
|
if (step.manualHint) {
|
|
36463
36494
|
process.stdout.write(` ${step.manualHint}
|
|
36464
36495
|
`);
|
|
@@ -36466,7 +36497,7 @@ async function runSelected(steps, selected) {
|
|
|
36466
36497
|
continue;
|
|
36467
36498
|
}
|
|
36468
36499
|
let ok = true;
|
|
36469
|
-
for (const cmd of
|
|
36500
|
+
for (const cmd of commands) {
|
|
36470
36501
|
const code = await runInherit(cmd);
|
|
36471
36502
|
if (code !== 0) {
|
|
36472
36503
|
ok = false;
|
|
@@ -36477,8 +36508,18 @@ async function runSelected(steps, selected) {
|
|
|
36477
36508
|
ok ? " \u2713 done\n" : " \u2717 failed \u2014 you can re-run this step later\n"
|
|
36478
36509
|
);
|
|
36479
36510
|
}
|
|
36511
|
+
const viewer = selected.includes("ui-global") ? "canary-viewer" : "npm i -g @usecanary/ui # then: canary-viewer";
|
|
36480
36512
|
process.stdout.write(
|
|
36481
|
-
|
|
36513
|
+
[
|
|
36514
|
+
"",
|
|
36515
|
+
"\u2713 Setup complete.",
|
|
36516
|
+
"",
|
|
36517
|
+
" Record a session: canary session start --name checkout",
|
|
36518
|
+
` Open the viewer: ${viewer}`,
|
|
36519
|
+
" Demos: see examples/ in the repo",
|
|
36520
|
+
"",
|
|
36521
|
+
""
|
|
36522
|
+
].join("\n")
|
|
36482
36523
|
);
|
|
36483
36524
|
}
|
|
36484
36525
|
async function main() {
|