@questpie/probe 0.1.0 → 0.1.2

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 ADDED
@@ -0,0 +1,111 @@
1
+ # QUESTPIE Probe
2
+
3
+ Dev testing CLI for AI coding agents. Orchestrates dev servers, aggregates logs, controls browsers, sends HTTP requests, records and replays tests.
4
+
5
+ **[Documentation](https://probe.questpie.com/docs)** | **[GitHub](https://github.com/questpie/probe)**
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ # Install the CLI
11
+ bun add -g @questpie/probe
12
+
13
+ # Install the AI skill (for Claude Code, Cursor, Windsurf)
14
+ bunx skills add questpie/probe
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # Initialize config
21
+ qprobe init
22
+
23
+ # Start a server with ready detection
24
+ qprobe start server "bun dev" --ready "ready on" --port 3000
25
+
26
+ # Check health
27
+ qprobe health http://localhost:3000/api/health
28
+
29
+ # Make HTTP requests
30
+ qprobe http GET /api/users --status 200
31
+ qprobe http POST /api/users -d '{"name":"test"}' --jq ".id"
32
+
33
+ # Read logs
34
+ qprobe logs server --grep "ERROR"
35
+ qprobe logs --all --level error
36
+
37
+ # Browser control
38
+ qprobe browser open http://localhost:3000
39
+ qprobe browser snapshot -i
40
+ qprobe browser click @e1
41
+ qprobe browser fill @e2 "hello"
42
+
43
+ # Record & replay
44
+ qprobe record start "login-flow"
45
+ qprobe record stop
46
+ qprobe replay "login-flow"
47
+
48
+ # Compose (from qprobe.config.ts)
49
+ qprobe compose up
50
+ qprobe compose status
51
+ qprobe compose down
52
+
53
+ # Assertions
54
+ qprobe assert status 200 /api/health
55
+ qprobe assert no-errors
56
+ ```
57
+
58
+ ## Commands
59
+
60
+ | Command | Description |
61
+ |---------|-------------|
62
+ | `qprobe start` | Start a background process with ready detection |
63
+ | `qprobe stop` | Stop a process (SIGTERM → SIGKILL) |
64
+ | `qprobe restart` | Restart with saved config |
65
+ | `qprobe ps` | List running processes |
66
+ | `qprobe health` | Poll URL until it responds |
67
+ | `qprobe logs` | Read logs with grep, level, follow |
68
+ | `qprobe http` | HTTP requests with assertions |
69
+ | `qprobe check` | Quick health + status overview |
70
+ | `qprobe compose` | Manage service stack from config |
71
+ | `qprobe browser` | 27 browser control subcommands |
72
+ | `qprobe record` | Record browser actions |
73
+ | `qprobe replay` | Replay as Playwright tests |
74
+ | `qprobe recordings` | Manage recordings |
75
+ | `qprobe assert` | Run assertions |
76
+ | `qprobe init` | Scaffold config |
77
+
78
+ ## Config
79
+
80
+ ```typescript
81
+ // qprobe.config.ts
82
+ import { defineConfig } from '@questpie/probe'
83
+
84
+ export default defineConfig({
85
+ services: {
86
+ db: {
87
+ cmd: 'docker compose up postgres',
88
+ ready: 'ready to accept connections',
89
+ health: 'http://localhost:5432',
90
+ },
91
+ server: {
92
+ cmd: 'bun dev',
93
+ ready: 'ready on http://localhost:3000',
94
+ port: 3000,
95
+ health: '/api/health',
96
+ depends: ['db'],
97
+ },
98
+ },
99
+ browser: {
100
+ driver: 'agent-browser',
101
+ baseUrl: 'http://localhost:3000',
102
+ },
103
+ http: {
104
+ baseUrl: 'http://localhost:3000',
105
+ },
106
+ })
107
+ ```
108
+
109
+ ## License
110
+
111
+ MIT
@@ -2,7 +2,7 @@ import "./duration-DUrbfMLK.js";
2
2
  import { loadProbeConfig, resolveBaseUrl } from "./config-BUEMgFYN.js";
3
3
  import { error, info, success, warn } from "./output-CHUjdVDf.js";
4
4
  import "./state-DRTSIt_r.js";
5
- import { listProcesses } from "./process-manager-CzexpFO4.js";
5
+ import { listProcesses } from "./process-manager-CITbaM9X.js";
6
6
  import { defineCommand } from "citty";
7
7
  import { ofetch } from "ofetch";
8
8
 
package/dist/cli.js CHANGED
@@ -1,28 +1,55 @@
1
- import { defineCommand, runMain } from "citty";
1
+ #!/usr/bin/env node
2
+ import { existsSync } from "node:fs";
3
+ import { defineCommand, runMain, showUsage } from "citty";
4
+ import { consola } from "consola";
2
5
 
3
6
  //#region src/cli.ts
4
7
  const main = defineCommand({
5
8
  meta: {
6
9
  name: "qprobe",
7
- version: "0.1.0",
10
+ version: "0.1.2",
8
11
  description: "Dev testing CLI for AI coding agents"
9
12
  },
10
13
  subCommands: {
11
- start: () => import("./start-BClY6oJq.js").then((m) => m.default),
12
- stop: () => import("./stop-QAP6gbDe.js").then((m) => m.default),
13
- restart: () => import("./restart-By3Edj5X.js").then((m) => m.default),
14
- ps: () => import("./ps-DuHF7vmE.js").then((m) => m.default),
14
+ start: () => import("./start-BJnzhZp9.js").then((m) => m.default),
15
+ stop: () => import("./stop-C0xDWnnB.js").then((m) => m.default),
16
+ restart: () => import("./restart-CEzd2Mgn.js").then((m) => m.default),
17
+ ps: () => import("./ps-UFZx0jy0.js").then((m) => m.default),
15
18
  health: () => import("./health-B36ufFzJ.js").then((m) => m.default),
16
- compose: () => import("./compose-D5a8qHkg.js").then((m) => m.default),
17
- logs: () => import("./logs-BCgur07G.js").then((m) => m.default),
19
+ compose: () => import("./compose-1CYahcRa.js").then((m) => m.default),
20
+ logs: () => import("./logs-BIt5sCky.js").then((m) => m.default),
18
21
  http: () => import("./http-BZouO1Cj.js").then((m) => m.default),
19
- check: () => import("./check-Cny-3lkZ.js").then((m) => m.default),
22
+ check: () => import("./check-1Y6cPMkN.js").then((m) => m.default),
20
23
  browser: () => import("./browser-DoCXU5Bs.js").then((m) => m.default),
21
24
  record: () => import("./record-C4SmoPsT.js").then((m) => m.default),
22
25
  replay: () => import("./replay-Dg9PHNrg.js").then((m) => m.default),
23
26
  recordings: () => import("./recordings-Cb31alos.js").then((m) => m.default),
24
27
  assert: () => import("./assert-BLP5_JwC.js").then((m) => m.default),
25
28
  init: () => import("./init-BjTfn_-A.js").then((m) => m.default)
29
+ },
30
+ async run({ cmd }) {
31
+ const hasConfig = existsSync("qprobe.config.ts") || existsSync("qprobe.config.js") || existsSync("qprobe.config.mjs");
32
+ if (hasConfig) {
33
+ await showUsage(cmd);
34
+ return;
35
+ }
36
+ consola.log("");
37
+ consola.log("\x1B[1m\x1B[38;2;183;0;255m QUESTPIE Probe\x1B[0m \x1B[2mv0.1.2\x1B[0m");
38
+ consola.log(" Dev testing CLI for AI coding agents");
39
+ consola.log("");
40
+ consola.log(" \x1B[1mGet started:\x1B[0m");
41
+ consola.log("");
42
+ consola.log(" \x1B[36mqprobe init\x1B[0m Scaffold qprobe.config.ts");
43
+ consola.log(" \x1B[36mbunx skills add questpie/probe\x1B[0m Teach your AI agent to use Probe");
44
+ consola.log("");
45
+ consola.log(" \x1B[2mOr skip the config and start using it:\x1B[0m");
46
+ consola.log("");
47
+ consola.log(" \x1B[36mqprobe start server \"bun dev\" --ready \"ready on\" --port 3000\x1B[0m");
48
+ consola.log(" \x1B[36mqprobe http GET /api/health --status 200\x1B[0m");
49
+ consola.log(" \x1B[36mqprobe logs server --grep \"ERROR\"\x1B[0m");
50
+ consola.log("");
51
+ consola.log(" \x1B[2mDocs:\x1B[0m \x1B[4mhttps://probe.questpie.com/docs\x1B[0m");
52
+ consola.log("");
26
53
  }
27
54
  });
28
55
  runMain(main);
@@ -2,7 +2,7 @@ import "./duration-DUrbfMLK.js";
2
2
  import { loadProbeConfig } from "./config-BUEMgFYN.js";
3
3
  import { error, info, json, success, table } from "./output-CHUjdVDf.js";
4
4
  import "./state-DRTSIt_r.js";
5
- import { listProcesses, startProcess, stopProcess } from "./process-manager-CzexpFO4.js";
5
+ import { listProcesses, startProcess, stopProcess } from "./process-manager-CITbaM9X.js";
6
6
  import { defineCommand } from "citty";
7
7
  import { ofetch } from "ofetch";
8
8
 
@@ -163,7 +163,7 @@ const restart = defineCommand({
163
163
  error(`Unknown service: "${args.name}"`);
164
164
  process.exit(1);
165
165
  }
166
- const { stopProcess: stopProcess$1, startProcess: startProcess$1 } = await import("./process-manager-zzltWvZ0.js");
166
+ const { stopProcess: stopProcess$1, startProcess: startProcess$1 } = await import("./process-manager-BVSQm3gK.js");
167
167
  try {
168
168
  await stopProcess$1(args.name);
169
169
  } catch {}
@@ -2,8 +2,8 @@ import { parseDuration } from "./duration-DUrbfMLK.js";
2
2
  import { error, info, json, log } from "./output-CHUjdVDf.js";
3
3
  import { getLogPath, listProcessNames } from "./state-DRTSIt_r.js";
4
4
  import { defineCommand } from "citty";
5
- import { readFile, stat } from "node:fs/promises";
6
5
  import { consola } from "consola";
6
+ import { readFile, stat } from "node:fs/promises";
7
7
  import { watch } from "chokidar";
8
8
 
9
9
  //#region src/core/log-reader.ts
@@ -1,4 +1,4 @@
1
1
  import "./state-DRTSIt_r.js";
2
- import { getProcessState, listProcesses, startProcess, stopAll, stopProcess } from "./process-manager-CzexpFO4.js";
2
+ import { getProcessState, listProcesses, startProcess, stopAll, stopProcess } from "./process-manager-CITbaM9X.js";
3
3
 
4
4
  export { startProcess, stopProcess };
@@ -1,7 +1,7 @@
1
1
  import { ensureLogsDir, getLogPath, listProcessNames, readPid, readState, removePid, removeState, savePid, saveState } from "./state-DRTSIt_r.js";
2
+ import { openSync } from "node:fs";
2
3
  import { appendFile } from "node:fs/promises";
3
4
  import { spawn } from "node:child_process";
4
- import { openSync } from "node:fs";
5
5
 
6
6
  //#region src/core/log-writer.ts
7
7
  function timestamp() {
@@ -1,6 +1,6 @@
1
1
  import { info, json, table } from "./output-CHUjdVDf.js";
2
2
  import "./state-DRTSIt_r.js";
3
- import { listProcesses } from "./process-manager-CzexpFO4.js";
3
+ import { listProcesses } from "./process-manager-CITbaM9X.js";
4
4
  import { defineCommand } from "citty";
5
5
 
6
6
  //#region src/commands/ps.ts
@@ -1,6 +1,6 @@
1
1
  import { error, success } from "./output-CHUjdVDf.js";
2
2
  import "./state-DRTSIt_r.js";
3
- import { getProcessState, startProcess, stopProcess } from "./process-manager-CzexpFO4.js";
3
+ import { getProcessState, startProcess, stopProcess } from "./process-manager-CITbaM9X.js";
4
4
  import { defineCommand } from "citty";
5
5
 
6
6
  //#region src/commands/restart.ts
@@ -1,7 +1,7 @@
1
1
  import { parseDuration } from "./duration-DUrbfMLK.js";
2
2
  import { error, success } from "./output-CHUjdVDf.js";
3
3
  import "./state-DRTSIt_r.js";
4
- import { startProcess } from "./process-manager-CzexpFO4.js";
4
+ import { startProcess } from "./process-manager-CITbaM9X.js";
5
5
  import { defineCommand } from "citty";
6
6
 
7
7
  //#region src/commands/start.ts
@@ -1,6 +1,6 @@
1
1
  import { error, success } from "./output-CHUjdVDf.js";
2
2
  import "./state-DRTSIt_r.js";
3
- import { stopAll, stopProcess } from "./process-manager-CzexpFO4.js";
3
+ import { stopAll, stopProcess } from "./process-manager-CITbaM9X.js";
4
4
  import { defineCommand } from "citty";
5
5
 
6
6
  //#region src/commands/stop.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@questpie/probe",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Dev testing CLI for AI coding agents",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -50,7 +50,7 @@
50
50
  "optional": false
51
51
  },
52
52
  "@playwright/test": {
53
- "optional": true
53
+ "optional": false
54
54
  }
55
55
  },
56
56
  "keywords": [
@@ -7,7 +7,8 @@ description: "QUESTPIE Probe — dev testing CLI for AI coding agents. Orchestra
7
7
 
8
8
  Dev testing CLI. Manages dev servers, reads logs, controls browsers, sends HTTP requests, records and replays tests.
9
9
 
10
- **Install:** `npm install -g @questpie/probe`
10
+ **Install CLI:** `bun add -g @questpie/probe`
11
+ **Install skill:** `bunx skills add questpie/probe`
11
12
 
12
13
  ## Core Principle
13
14
 
@@ -1,7 +1,3 @@
1
- ---
2
- name: qprobe-ux
3
- description: "UX testing and evaluation using QUESTPIE Probe. Run heuristic evaluations, task completion tests, navigation audits, accessibility checks, and A/B comparisons on running web apps. Use when: evaluating usability, checking UX quality, auditing user flows, comparing two versions, finding UX issues, testing if users can complete tasks. Triggers: 'review the UX', 'is this usable', 'can a user find X', 'compare these two versions', 'UX audit', 'heuristic evaluation', 'test the onboarding flow', 'is the checkout intuitive', 'find usability problems', 'accessibility check'. Use even for 'does this make sense' or 'is this confusing' in context of a web UI."
4
- ---
5
1
 
6
2
  # qprobe-ux — UX Testing Skill
7
3
 
@@ -1,87 +0,0 @@
1
- ---
2
- name: qprobe-browser
3
- description: "QUESTPIE Probe browser control. Accessibility tree snapshots with @e refs, click, fill, screenshot, console logs, network monitoring, JS errors, snapshot diffs. Powered by agent-browser. Use when: testing web UI, checking browser console, inspecting network requests, taking screenshots, filling forms, clicking buttons, checking for JS errors. Triggers: 'open the browser', 'check the page', 'click the button', 'fill the form', 'any console errors', 'network tab', 'screenshot', 'what does the page look like'. Use even for 'check if the UI works' or 'test the frontend'."
4
- ---
5
-
6
- # qprobe — Browser Control
7
-
8
- Token-efficient browser automation via accessibility tree snapshots and `@e` refs.
9
-
10
- **Install:** `npm install -g @questpie/probe`
11
-
12
- ## Core Workflow
13
-
14
- ```bash
15
- qprobe browser open http://localhost:3000/login
16
- qprobe browser snapshot -i # interactive elements only (~200 tokens)
17
- # - textbox "Email" [@e1]
18
- # - textbox "Password" [@e2]
19
- # - button "Sign In" [@e3]
20
-
21
- qprobe browser fill @e1 "admin@test.com"
22
- qprobe browser fill @e2 "password123"
23
- qprobe browser click @e3
24
- qprobe browser wait --url "/dashboard"
25
- qprobe browser snapshot --diff # only what changed
26
- ```
27
-
28
- ## Snapshot Flags
29
-
30
- | Flag | Short | Effect |
31
- |------|-------|--------|
32
- | `--interactive` | `-i` | Only buttons, inputs, links (recommended) |
33
- | `--compact` | `-c` | Remove empty structural elements |
34
- | `--depth <n>` | `-d` | Limit tree depth |
35
- | `--selector <css>` | `-s` | Scope to element |
36
- | `--diff` | | Show changes since last snapshot |
37
-
38
- **Always use `-i` by default.** Full snapshots waste tokens on decorative elements.
39
-
40
- ## Interaction (via @e refs or CSS selectors)
41
-
42
- ```bash
43
- qprobe browser click @e3
44
- qprobe browser fill @e1 "text"
45
- qprobe browser select @e4 "value"
46
- qprobe browser check @e5
47
- qprobe browser press Enter
48
- qprobe browser type "hello"
49
- qprobe browser hover @e2
50
- qprobe browser scroll down 500
51
- ```
52
-
53
- ## Inspection (NO BROWSER WINDOW NEEDED)
54
-
55
- ```bash
56
- qprobe browser console # console messages (log, warn, error)
57
- qprobe browser console --level error # only errors
58
- qprobe browser errors # uncaught JS exceptions
59
- qprobe browser network # HTTP request log
60
- qprobe browser network --failed # only 4xx/5xx
61
- qprobe browser eval "document.title" # execute JS
62
- qprobe browser text "#main" # extract text content
63
- ```
64
-
65
- ## Screenshots
66
-
67
- ```bash
68
- qprobe browser screenshot # basic
69
- qprobe browser screenshot --annotate # with @e labels overlaid
70
- qprobe browser screenshot --full # full page scroll
71
- ```
72
-
73
- ## Waiting
74
-
75
- ```bash
76
- qprobe browser wait @e1 # element exists
77
- qprobe browser wait --url "/dashboard" # URL changed
78
- qprobe browser wait --text "Welcome" # text appeared
79
- qprobe browser wait --network idle # no pending requests
80
- ```
81
-
82
- ## Tips for Agents
83
-
84
- - `snapshot -i` saves tokens — use it always
85
- - `snapshot --diff` after actions — see only changes
86
- - Check `console --level error` and `network --failed` before visual debugging
87
- - `screenshot --annotate` is useful when you need visual context
@@ -1,81 +0,0 @@
1
- ---
2
- name: qprobe-compose
3
- description: "QUESTPIE Probe compose — multi-service orchestration with dependency graphs. Start DB, server, admin, workers in correct order with health checks. Config via qprobe.config.ts. Use when: starting a full dev stack, managing multiple services, need database + server + frontend running together. Triggers: 'start everything', 'compose up', 'start the stack', 'bring up the dev environment', 'start db and server'. Use when project has multiple services that need to start in order."
4
- ---
5
-
6
- # qprobe — Compose
7
-
8
- Multi-service orchestration with dependency resolution and health checks.
9
-
10
- **Install:** `npm install -g @questpie/probe`
11
-
12
- ## Usage
13
-
14
- ```bash
15
- qprobe compose up # start all services in dependency order
16
- qprobe compose down # stop all in reverse order
17
- qprobe compose restart # restart all
18
- qprobe compose status # show service states
19
- ```
20
-
21
- ## Config (`qprobe.config.ts`)
22
-
23
- ```typescript
24
- import { defineConfig } from '@questpie/probe'
25
-
26
- export default defineConfig({
27
- services: {
28
- db: {
29
- cmd: 'docker compose up postgres',
30
- ready: 'ready to accept connections',
31
- },
32
- server: {
33
- cmd: 'bun dev',
34
- ready: 'ready on http://localhost:3000',
35
- port: 3000,
36
- health: '/api/health',
37
- depends: ['db'],
38
- },
39
- admin: {
40
- cmd: 'bun run admin:dev',
41
- ready: 'ready on http://localhost:3001',
42
- port: 3001,
43
- depends: ['server'],
44
- },
45
- },
46
- })
47
- ```
48
-
49
- ## What Happens
50
-
51
- ```bash
52
- qprobe compose up
53
- # ⏳ Starting db... ready (2.3s)
54
- # ⏳ Starting server... ready (4.1s) ← waited for db first
55
- # ⏳ Starting admin... ready (3.5s) ← waited for server first
56
- # ✅ All 3 services ready (9.9s)
57
- ```
58
-
59
- Dependency graph resolved automatically. Parallel start where possible.
60
-
61
- ## Flags
62
-
63
- | Flag | Description |
64
- |------|-------------|
65
- | `--only <names>` | Start only these (+ dependencies) |
66
- | `--skip <names>` | Skip these services |
67
- | `--no-health` | Don't wait for health checks |
68
-
69
- ```bash
70
- qprobe compose up --only server # starts db (dep) + server
71
- qprobe compose up --skip admin # starts db + server, skips admin
72
- ```
73
-
74
- ## Inline (No Config File)
75
-
76
- ```bash
77
- qprobe compose up \
78
- --service "db: docker compose up postgres | ready to accept" \
79
- --service "server: bun dev | ready on" \
80
- --depends "server:db"
81
- ```
@@ -1,67 +0,0 @@
1
- ---
2
- name: qprobe-http
3
- description: "QUESTPIE Probe HTTP requests. Send API requests against running dev servers with auto baseUrl, Bearer auth, status assertions, JQ filtering, verbose mode. Cheaper than browser for API testing. Use when: testing API endpoints, checking server responses, CRUD operations, verifying auth, debugging 500 errors. Triggers: 'call the API', 'test the endpoint', 'POST to /api/users', 'check if the API works', 'what does the server return', 'send a request'. Prefer this over browser for any API-only testing."
4
- ---
5
-
6
- # qprobe — HTTP Requests
7
-
8
- API testing with auto-resolved baseUrl. Cheaper than browser for backend testing.
9
-
10
- **Install:** `npm install -g @questpie/probe`
11
-
12
- ## Usage
13
-
14
- ```bash
15
- qprobe http <METHOD> <path> [flags]
16
- ```
17
-
18
- Path is relative — baseUrl auto-resolved from config or running services.
19
-
20
- ## Examples
21
-
22
- ```bash
23
- # Basic
24
- qprobe http GET /api/users
25
- qprobe http GET /api/users/1
26
-
27
- # POST with body
28
- qprobe http POST /api/users -d '{"name":"New","email":"new@test.com"}'
29
-
30
- # Auth
31
- qprobe http GET /api/admin/stats --token "eyJhbGci..."
32
- qprobe http GET /api/data -H "X-API-Key: abc123"
33
-
34
- # Assert status (exit 1 if different)
35
- qprobe http GET /api/health --status 200
36
- qprobe http DELETE /api/users/1 --status 204
37
-
38
- # Filter response
39
- qprobe http GET /api/users --jq ".[0].name"
40
- qprobe http GET /api/stats --jq ".revenue.total"
41
-
42
- # Verbose (show headers)
43
- qprobe http POST /api/login -d '{"email":"a@b.com","pass":"123"}' -v
44
-
45
- # Raw output (for piping)
46
- qprobe http GET /api/users --raw | jq '.[].email'
47
- ```
48
-
49
- ## Flags
50
-
51
- | Flag | Short | Description |
52
- |------|-------|-------------|
53
- | `--data <json>` | `-d` | JSON request body |
54
- | `--header <k:v>` | `-H` | Header (repeatable) |
55
- | `--token <jwt>` | | Bearer auth shortcut |
56
- | `--status <code>` | | Assert expected status |
57
- | `--jq <expr>` | | JQ filter on response |
58
- | `--raw` | | No formatting (for pipes) |
59
- | `--verbose` | `-v` | Full request/response headers |
60
- | `--base <url>` | | Override baseUrl |
61
-
62
- ## Tips
63
-
64
- - **Use `qprobe http` instead of browser** for API testing — much cheaper on tokens
65
- - **`--status` for assertions** — `qprobe http GET /api/health --status 200`
66
- - **`--jq` for extraction** — `qprobe http GET /api/me --jq ".user.role"`
67
- - **Chain with login** — extract token, use in subsequent requests
@@ -1,58 +0,0 @@
1
- ---
2
- name: qprobe-process
3
- description: "QUESTPIE Probe process management. Start dev servers with ready-pattern detection, stop, restart, health checks, list running processes. Use when: starting a dev server, checking if server is running, waiting for service to be ready, restarting after code change. Triggers: 'start the server', 'bun dev', 'is it running', 'restart', 'health check', 'wait for ready', 'server crashed'. Use even when user just says 'run it' or 'start it up' in context of a dev project."
4
- ---
5
-
6
- # qprobe — Process Management
7
-
8
- Start dev servers with ready-pattern detection, health checks, and lifecycle management.
9
-
10
- **Install:** `npm install -g @questpie/probe`
11
-
12
- ## Commands
13
-
14
- ```bash
15
- # Start with ready detection
16
- qprobe start <n> "<cmd>" --ready "<pattern>" [--port <n>] [--timeout 60s]
17
-
18
- # Examples
19
- qprobe start server "bun dev" --ready "ready on" --port 3000
20
- qprobe start db "docker compose up postgres" --ready "ready to accept"
21
-
22
- # Lifecycle
23
- qprobe stop <n|--all>
24
- qprobe restart <n>
25
- qprobe ps # list running processes
26
- qprobe ps --json # machine-readable
27
-
28
- # Health check — poll URL until 200
29
- qprobe health http://localhost:3000/api/health --timeout 30s
30
-
31
- # Read logs
32
- qprobe logs <n> # last 50 lines
33
- qprobe logs <n> --follow # tail -f
34
- qprobe logs <n> --grep "ERROR"
35
- qprobe logs --all # all processes merged
36
- ```
37
-
38
- ## How It Works
39
-
40
- - Spawns child process as daemon (survives between CLI calls)
41
- - Pipes stdout/stderr to `tmp/qprobe/logs/<n>.log` (timestamped)
42
- - Monitors output for `--ready` pattern, returns when matched
43
- - PID saved to `tmp/qprobe/pids/<n>.pid`
44
- - `qprobe stop` sends SIGTERM → SIGKILL after 5s
45
-
46
- ## Common Patterns
47
-
48
- ```bash
49
- # Start, wait, test
50
- qprobe start server "bun dev" --ready "ready on" --port 3000
51
- qprobe health http://localhost:3000/api/health
52
- qprobe http GET /api/users
53
-
54
- # Check what crashed
55
- qprobe ps
56
- qprobe logs server --lines 100 --grep "ERROR"
57
- qprobe restart server
58
- ```
@@ -1,63 +0,0 @@
1
- ---
2
- name: qprobe-recording
3
- description: "QUESTPIE Probe test recording and replay. Record browser interactions, auto-generate Playwright tests, replay without AI tokens for regression testing. Use when: recording a test flow, creating regression tests, replaying tests, running test suite, checking for regressions after code changes. Triggers: 'record a test', 'save this as a test', 'replay tests', 'run regression', 'check if it still works', 'run all tests'. Use whenever user wants to capture a flow for future verification."
4
- ---
5
-
6
- # qprobe — Recording & Replay
7
-
8
- Record browser flows → generate Playwright tests → replay with zero AI tokens.
9
-
10
- **Install:** `npm install -g @questpie/probe`
11
-
12
- ## Record
13
-
14
- ```bash
15
- qprobe record start "login-flow"
16
- # ... do browser actions (they're automatically captured) ...
17
- qprobe browser open /login
18
- qprobe browser fill @e1 "admin@test.com"
19
- qprobe browser fill @e2 "password123"
20
- qprobe browser click @e3
21
- qprobe browser wait --url "/dashboard"
22
- qprobe assert text "Dashboard"
23
- qprobe record stop
24
- # ✅ Recording saved: tests/qprobe/recordings/login-flow.json
25
- # ✅ Playwright test: tests/qprobe/recordings/login-flow.spec.ts
26
- ```
27
-
28
- ## Replay (Zero AI Tokens)
29
-
30
- ```bash
31
- qprobe replay "login-flow" # run one test
32
- qprobe replay --all # run all recordings
33
- qprobe replay --all --headed # visible browser
34
- qprobe replay --all --browser firefox # cross-browser
35
- qprobe replay --all --report # HTML report
36
- qprobe replay --all --retries 2 # retry flaky tests
37
- qprobe replay --all --base https://staging.myapp.com # against staging
38
- ```
39
-
40
- ## Manage Recordings
41
-
42
- ```bash
43
- qprobe recordings list # list all
44
- qprobe recordings show "login-flow" # show steps
45
- qprobe recordings delete "old-test" # delete
46
- qprobe recordings export "login-flow" # standalone Playwright project
47
- ```
48
-
49
- ## How It Works
50
-
51
- 1. `record start` activates capture mode
52
- 2. Every `qprobe browser` command is recorded with both `@e` ref AND CSS selector
53
- 3. `record stop` saves JSON recording + generates `.spec.ts` Playwright test
54
- 4. `replay` runs the Playwright test directly — no AI, no LLM, no tokens
55
- 5. Tests are committed to repo in `tests/qprobe/recordings/`
56
-
57
- ## Tips
58
-
59
- - **Record early** — capture login, CRUD, critical paths as you build them
60
- - **Replay after every change** — `qprobe replay --all` catches regressions instantly
61
- - **Replay is free** — pure Playwright, runs in <5s per test
62
- - **Edit `.spec.ts`** to add custom assertions beyond what was recorded
63
- - **Export for CI** — `qprobe recordings export` creates standalone test project