pi-ui-extend 1.0.41 → 1.0.45

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.
Files changed (236) hide show
  1. package/README.md +50 -13
  2. package/dist/app/app.d.ts +13 -0
  3. package/dist/app/app.js +158 -8
  4. package/dist/app/cli/install.js +2 -2
  5. package/dist/app/commands/command-controller.d.ts +4 -0
  6. package/dist/app/commands/command-controller.js +11 -0
  7. package/dist/app/commands/command-git-actions.d.ts +25 -0
  8. package/dist/app/commands/command-git-actions.js +381 -0
  9. package/dist/app/commands/command-host.d.ts +4 -0
  10. package/dist/app/commands/command-host.js +5 -2
  11. package/dist/app/commands/command-model-actions.d.ts +1 -0
  12. package/dist/app/commands/command-model-actions.js +57 -35
  13. package/dist/app/commands/command-navigation-actions.d.ts +1 -0
  14. package/dist/app/commands/command-navigation-actions.js +16 -3
  15. package/dist/app/commands/command-registry.d.ts +2 -0
  16. package/dist/app/commands/command-registry.js +15 -1
  17. package/dist/app/commands/command-session-actions.js +9 -3
  18. package/dist/app/commands/reload-context-inventory.d.ts +11 -0
  19. package/dist/app/commands/reload-context-inventory.js +70 -0
  20. package/dist/app/extensions/extension-actions-controller.d.ts +1 -0
  21. package/dist/app/extensions/extension-actions-controller.js +6 -0
  22. package/dist/app/extensions/subagent-catalog-state.d.ts +9 -0
  23. package/dist/app/extensions/subagent-catalog-state.js +23 -0
  24. package/dist/app/input/autocomplete-controller.js +61 -34
  25. package/dist/app/input/input-action-controller.d.ts +2 -0
  26. package/dist/app/input/input-action-controller.js +8 -1
  27. package/dist/app/input/input-controller.d.ts +2 -1
  28. package/dist/app/input/input-controller.js +7 -2
  29. package/dist/app/input/prompt-enhancer-controller.js +53 -35
  30. package/dist/app/input/voice-controller.d.ts +41 -45
  31. package/dist/app/input/voice-controller.js +351 -419
  32. package/dist/app/model/model-usage-controller.js +17 -7
  33. package/dist/app/model/model-usage-status.d.ts +4 -1
  34. package/dist/app/model/model-usage-status.js +270 -46
  35. package/dist/app/popup/menu-items-controller.d.ts +13 -3
  36. package/dist/app/popup/menu-items-controller.js +37 -21
  37. package/dist/app/popup/popup-action-controller.d.ts +12 -2
  38. package/dist/app/popup/popup-action-controller.js +77 -24
  39. package/dist/app/popup/popup-menu-controller.d.ts +36 -14
  40. package/dist/app/popup/popup-menu-controller.js +239 -69
  41. package/dist/app/rendering/dcp-stats.d.ts +9 -4
  42. package/dist/app/rendering/dcp-stats.js +40 -425
  43. package/dist/app/rendering/editor-panels.js +10 -4
  44. package/dist/app/rendering/popup-menu-renderer.d.ts +3 -5
  45. package/dist/app/rendering/popup-menu-renderer.js +42 -37
  46. package/dist/app/rendering/render-controller.js +23 -2
  47. package/dist/app/rendering/status-line-renderer.d.ts +5 -0
  48. package/dist/app/rendering/status-line-renderer.js +41 -5
  49. package/dist/app/rendering/tab-line-renderer.js +26 -20
  50. package/dist/app/runtime.d.ts +12 -1
  51. package/dist/app/runtime.js +120 -12
  52. package/dist/app/screen/mouse-controller.d.ts +2 -0
  53. package/dist/app/screen/mouse-controller.js +17 -7
  54. package/dist/app/screen/status-controller.d.ts +4 -0
  55. package/dist/app/screen/status-controller.js +5 -0
  56. package/dist/app/session/lazy-session-manager.js +34 -0
  57. package/dist/app/session/session-event-controller.d.ts +1 -0
  58. package/dist/app/session/session-event-controller.js +10 -1
  59. package/dist/app/session/session-history.d.ts +1 -0
  60. package/dist/app/session/session-history.js +12 -1
  61. package/dist/app/session/session-lifecycle-controller.d.ts +7 -1
  62. package/dist/app/session/session-lifecycle-controller.js +16 -1
  63. package/dist/app/session/tabs-controller.d.ts +26 -1
  64. package/dist/app/session/tabs-controller.js +454 -147
  65. package/dist/app/subagents/subagents-files.js +60 -1
  66. package/dist/app/subagents/subagents-model.d.ts +1 -0
  67. package/dist/app/subagents/subagents-model.js +18 -2
  68. package/dist/app/subagents/subagents-widget-controller.d.ts +1 -0
  69. package/dist/app/subagents/subagents-widget-controller.js +6 -0
  70. package/dist/app/types.d.ts +16 -1
  71. package/dist/app/workspace/workspace-actions-controller.js +10 -2
  72. package/dist/app/workspace/workspace-undo.d.ts +1 -0
  73. package/dist/app/workspace/workspace-undo.js +1 -0
  74. package/dist/bundled-extensions/question/index.js +9 -1
  75. package/dist/bundled-extensions/question/remote.d.ts +4 -0
  76. package/dist/bundled-extensions/question/remote.js +33 -0
  77. package/dist/bundled-extensions/telegram-connector/bot.d.ts +43 -0
  78. package/dist/bundled-extensions/telegram-connector/bot.js +166 -0
  79. package/dist/bundled-extensions/telegram-connector/config.d.ts +8 -0
  80. package/dist/bundled-extensions/telegram-connector/config.js +87 -0
  81. package/dist/bundled-extensions/telegram-connector/coordinator.d.ts +66 -0
  82. package/dist/bundled-extensions/telegram-connector/coordinator.js +413 -0
  83. package/dist/bundled-extensions/telegram-connector/index.d.ts +3 -0
  84. package/dist/bundled-extensions/telegram-connector/index.js +195 -0
  85. package/dist/bundled-extensions/terminal-bell/index.d.ts +0 -8
  86. package/dist/bundled-extensions/terminal-bell/index.js +0 -76
  87. package/dist/bundled-extensions/workspace-undo/index.d.ts +26 -0
  88. package/dist/bundled-extensions/workspace-undo/index.js +191 -0
  89. package/dist/config.d.ts +21 -2
  90. package/dist/config.js +159 -32
  91. package/dist/default-pix-config.js +25 -5
  92. package/dist/schemas/index.d.ts +1 -0
  93. package/dist/schemas/index.js +1 -0
  94. package/dist/schemas/pi-tools-suite-schema.d.ts +88 -62
  95. package/dist/schemas/pi-tools-suite-schema.js +54 -83
  96. package/dist/schemas/pix-schema.d.ts +19 -2
  97. package/dist/schemas/pix-schema.js +47 -5
  98. package/dist/schemas/tasks-schema.d.ts +18 -0
  99. package/dist/schemas/tasks-schema.js +41 -0
  100. package/docs/concurrency.md +9 -1
  101. package/docs/desktop-mvp.md +22 -6
  102. package/docs/desktop-task-manager.md +148 -84
  103. package/docs/release.md +30 -6
  104. package/external/pi-tools-suite/README.md +197 -84
  105. package/external/pi-tools-suite/docs/evals.md +1 -1
  106. package/external/pi-tools-suite/docs/session-recovery.md +47 -14
  107. package/external/pi-tools-suite/docs/subagent-model-pools.md +48 -30
  108. package/external/pi-tools-suite/docs/ui-qa-subagent.md +440 -0
  109. package/external/pi-tools-suite/package.json +6 -1
  110. package/external/pi-tools-suite/src/antigravity-auth/auth-store.ts +2 -1
  111. package/external/pi-tools-suite/src/antigravity-auth/constants.ts +9 -3
  112. package/external/pi-tools-suite/src/antigravity-auth/headers.ts +41 -3
  113. package/external/pi-tools-suite/src/antigravity-auth/models.ts +94 -21
  114. package/external/pi-tools-suite/src/antigravity-auth/oauth.ts +5 -17
  115. package/external/pi-tools-suite/src/antigravity-auth/payload.ts +72 -7
  116. package/external/pi-tools-suite/src/antigravity-auth/stream.ts +13 -1
  117. package/external/pi-tools-suite/src/async-subagents/agents/frontier-review.md +23 -0
  118. package/external/pi-tools-suite/src/async-subagents/agents/implement.md +1 -1
  119. package/external/pi-tools-suite/src/async-subagents/agents/presets.jsonc +16 -0
  120. package/external/pi-tools-suite/src/async-subagents/agents/research.md +5 -3
  121. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/browser.mjs +346 -0
  122. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/desktop.mjs +1038 -0
  123. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/backends/tui.mjs +759 -0
  124. package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/scripts/browser-qa-runner.mjs +32 -23
  125. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/chrome-devtools/chrome-devtools-provider.mjs +895 -0
  126. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/linux/linux-atspi.py +494 -0
  127. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/macos/macos-accessibility.swift +1085 -0
  128. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/bridge-client.mjs +50 -0
  129. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/native-terminal/native-terminal-host.mjs +501 -0
  130. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/drivers/windows/windows-uia.ps1 +454 -0
  131. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-auth.md +114 -0
  132. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-chrome-devtools.md +91 -0
  133. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser-playwright.md +145 -0
  134. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/browser.md +82 -0
  135. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-linux.md +26 -0
  136. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-macos.md +29 -0
  137. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop-windows.md +23 -0
  138. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/desktop.md +54 -0
  139. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-native-terminal.md +59 -0
  140. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui-pty.md +37 -0
  141. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/guides/tui.md +60 -0
  142. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa/scripts/ui-qa-runner.mjs +535 -0
  143. package/external/pi-tools-suite/src/async-subagents/agents/ui-qa.md +75 -0
  144. package/external/pi-tools-suite/src/async-subagents/commands.ts +15 -71
  145. package/external/pi-tools-suite/src/async-subagents/core/activity.ts +33 -0
  146. package/external/pi-tools-suite/src/async-subagents/core/agent-catalog.ts +5 -4
  147. package/external/pi-tools-suite/src/async-subagents/core/agent-strategy.ts +1 -1
  148. package/external/pi-tools-suite/src/async-subagents/core/agents-dir.ts +8 -5
  149. package/external/pi-tools-suite/src/async-subagents/core/browser-qa.ts +16 -2
  150. package/external/pi-tools-suite/src/async-subagents/core/config.ts +160 -327
  151. package/external/pi-tools-suite/src/async-subagents/core/model-selection.ts +2 -1
  152. package/external/pi-tools-suite/src/async-subagents/core/registry.ts +158 -33
  153. package/external/pi-tools-suite/src/async-subagents/core/routing.ts +21 -5
  154. package/external/pi-tools-suite/src/async-subagents/core/spawn.ts +40 -26
  155. package/external/pi-tools-suite/src/async-subagents/core/state.ts +40 -0
  156. package/external/pi-tools-suite/src/async-subagents/core/types.ts +7 -0
  157. package/external/pi-tools-suite/src/async-subagents/core/ultrawork-auto.ts +51 -45
  158. package/external/pi-tools-suite/src/async-subagents/index.ts +69 -5
  159. package/external/pi-tools-suite/src/async-subagents/lib.ts +16 -9
  160. package/external/pi-tools-suite/src/async-subagents/tools/spawn.ts +8 -5
  161. package/external/pi-tools-suite/src/async-subagents/tools/subagents.ts +5 -4
  162. package/external/pi-tools-suite/src/async-subagents/types.ts +1 -0
  163. package/external/pi-tools-suite/src/coding-discipline/index.ts +90 -59
  164. package/external/pi-tools-suite/src/config.ts +55 -1
  165. package/external/pi-tools-suite/src/context-gateway/accounting-log.ts +282 -0
  166. package/external/pi-tools-suite/src/context-gateway/config.ts +77 -3
  167. package/external/pi-tools-suite/src/context-gateway/efficiency.ts +414 -0
  168. package/external/pi-tools-suite/src/context-gateway/enforcement.ts +222 -0
  169. package/external/pi-tools-suite/src/context-gateway/index.ts +206 -19
  170. package/external/pi-tools-suite/src/context-gateway/storeless-capabilities.ts +7 -7
  171. package/external/pi-tools-suite/src/context-gateway/telemetry.ts +101 -28
  172. package/external/pi-tools-suite/src/context-gateway/types.ts +16 -3
  173. package/external/pi-tools-suite/src/context-inventory.ts +99 -0
  174. package/external/pi-tools-suite/src/dcp/auto-compress-budget.ts +39 -4
  175. package/external/pi-tools-suite/src/dcp/auto-compress.ts +128 -49
  176. package/external/pi-tools-suite/src/dcp/commands.ts +32 -156
  177. package/external/pi-tools-suite/src/dcp/compress-tool.ts +177 -46
  178. package/external/pi-tools-suite/src/dcp/compression-blocks.ts +6 -58
  179. package/external/pi-tools-suite/src/dcp/compression-preview.ts +9 -0
  180. package/external/pi-tools-suite/src/dcp/compression-progress.ts +22 -0
  181. package/external/pi-tools-suite/src/dcp/config.ts +114 -17
  182. package/external/pi-tools-suite/src/dcp/conversation-index.ts +36 -9
  183. package/external/pi-tools-suite/src/dcp/diagnostics.ts +41 -0
  184. package/external/pi-tools-suite/src/dcp/fresh-tool-results.ts +38 -0
  185. package/external/pi-tools-suite/src/dcp/index.ts +338 -66
  186. package/external/pi-tools-suite/src/dcp/journal.ts +126 -4
  187. package/external/pi-tools-suite/src/dcp/progress-controller.ts +2 -1
  188. package/external/pi-tools-suite/src/dcp/prompts.ts +83 -192
  189. package/external/pi-tools-suite/src/dcp/protected-continuity.ts +175 -0
  190. package/external/pi-tools-suite/src/dcp/pruner-candidates.ts +93 -3
  191. package/external/pi-tools-suite/src/dcp/pruner-message-ids.ts +6 -10
  192. package/external/pi-tools-suite/src/dcp/pruner-nudge.ts +36 -33
  193. package/external/pi-tools-suite/src/dcp/pruner-tools.ts +6 -3
  194. package/external/pi-tools-suite/src/dcp/pruner.ts +1 -0
  195. package/external/pi-tools-suite/src/dcp/routine-pressure.ts +86 -0
  196. package/external/pi-tools-suite/src/dcp/state.ts +9 -0
  197. package/external/pi-tools-suite/src/dcp/statistics.d.ts +8 -0
  198. package/external/pi-tools-suite/src/dcp/statistics.js +156 -0
  199. package/external/pi-tools-suite/src/default-pi-tools-suite-config.ts +78 -22
  200. package/external/pi-tools-suite/src/index.ts +7 -1
  201. package/external/pi-tools-suite/src/lib/project.ts +36 -1
  202. package/external/pi-tools-suite/src/model-tools/index.ts +10 -7
  203. package/external/pi-tools-suite/src/repo-discovery/index.ts +304 -4
  204. package/external/pi-tools-suite/src/resource-registry/index.ts +2551 -0
  205. package/external/pi-tools-suite/src/session-recovery/index.ts +17 -0
  206. package/external/pi-tools-suite/src/shell-command-policy.ts +219 -0
  207. package/external/pi-tools-suite/src/todo/index.ts +21 -0
  208. package/external/pi-tools-suite/src/todo/todo.ts +19 -1
  209. package/external/pi-tools-suite/src/tool-descriptions.ts +47 -19
  210. package/package.json +10 -9
  211. package/schemas/pi-tools-suite.json +466 -287
  212. package/schemas/pix.json +129 -11
  213. package/schemas/tasks.json +131 -0
  214. package/skills/simplify/SKILL.md +33 -5
  215. package/docs/desktop-markdown-media.md +0 -77
  216. package/external/pi-tools-suite/docs/browser-qa-subagent.md +0 -177
  217. package/external/pi-tools-suite/docs/dcp-emergency-current-turn.md +0 -102
  218. package/external/pi-tools-suite/src/async-subagents/agents/browser-qa.md +0 -598
  219. package/external/pi-tools-suite/src/async-subagents/async-subagents.sample.jsonc +0 -54
  220. package/external/pi-tools-suite/src/skill-installer/index.ts +0 -333
  221. package/skills/playwright-cli/SKILL.md +0 -420
  222. package/skills/playwright-cli/references/element-attributes.md +0 -23
  223. package/skills/playwright-cli/references/playwright-tests.md +0 -50
  224. package/skills/playwright-cli/references/request-mocking.md +0 -87
  225. package/skills/playwright-cli/references/running-code.md +0 -241
  226. package/skills/playwright-cli/references/session-management.md +0 -273
  227. package/skills/playwright-cli/references/spec-driven-testing.md +0 -311
  228. package/skills/playwright-cli/references/storage-state.md +0 -290
  229. package/skills/playwright-cli/references/test-generation.md +0 -142
  230. package/skills/playwright-cli/references/tracing.md +0 -154
  231. package/skills/playwright-cli/references/video-recording.md +0 -147
  232. package/skills/spec-lite/SKILL.md +0 -140
  233. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-auth.example.jsonc +0 -0
  234. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/examples/qa-flow.example.jsonc +0 -0
  235. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.LICENSE +0 -0
  236. /package/external/pi-tools-suite/src/async-subagents/agents/{browser-qa → ui-qa/browser}/vendor/fflate.mjs +0 -0
@@ -1,420 +0,0 @@
1
- ---
2
- name: playwright-cli
3
- description: Automate browser interactions, test web pages and work with Playwright tests.
4
- allowed-tools: Bash(playwright-cli:*) Bash(npx:*) Bash(npm:*)
5
- ---
6
-
7
- # Browser Automation with playwright-cli
8
-
9
- ## Required session lifecycle
10
-
11
- Browser sessions are daemon-backed and can outlive both a command and its task. Treat each session as an owned resource:
12
-
13
- 1. Before the first session-scoped command, choose a unique, task-scoped name (semantic prefix plus timestamp/PID or random suffix), confirm it is not already in `playwright-cli list`, and record the exact name in task state as owned by this task. Do not create automation in the shared `default` session.
14
- 2. Pass that exact name with `-s=<name>` to **every** command. In examples, `$SESSION` is shorthand for the recorded literal; do not assume shell variables persist between tool calls.
15
- 3. As soon as the session is created, plan cleanup for success, failure, cancellation, and timeout. In a shell script, install an `EXIT INT TERM` trap immediately after registering the name.
16
- 4. Before the final response—and on every error path—run `playwright-cli -s=<owned-name> close`. Then run `playwright-cli list` and verify that the exact owned name is absent. If it remains, retry the session-specific close and investigate before finishing.
17
-
18
- Only close sessions registered as owned by the current task. `close-all` and `kill-all` can disrupt other agents or users and are not routine cleanup. Use `kill-all` only as an emergency fallback when session-specific cleanup cannot remove a confirmed stale daemon, after checking `list` and either confirming every listed session is yours or obtaining user approval.
19
-
20
- For sessions attached to an external browser, use a unique name but `detach` instead of `close`; do not close the external browser. Only attach to a user's regular Chrome/Edge when explicitly requested. For `--debug=cli` sessions, also stop the background test process that owns the browser and verify its generated session is gone.
21
-
22
- ## Quick start
23
-
24
- ```bash
25
- # Pick once and record as owned; use this exact value for the whole task.
26
- SESSION="docs-check-$(date +%s)-$$"
27
- # open new browser
28
- playwright-cli -s="$SESSION" open
29
- # navigate to a page
30
- playwright-cli -s="$SESSION" goto https://playwright.dev
31
- # interact with the page using refs from the snapshot
32
- playwright-cli -s="$SESSION" click e15
33
- playwright-cli -s="$SESSION" type "page.click"
34
- playwright-cli -s="$SESSION" press Enter
35
- # take a screenshot (rarely used, as snapshot is more common)
36
- playwright-cli -s="$SESSION" screenshot
37
- # mandatory task cleanup, including error paths
38
- playwright-cli -s="$SESSION" close
39
- playwright-cli list # verify the exact value of $SESSION is absent
40
- ```
41
-
42
- ## Commands
43
-
44
- Most of the command catalog omits `-s="$SESSION"` for readability. When executing it, always target the unique session registered under [Required session lifecycle](#required-session-lifecycle); session creation and cleanup show the option explicitly.
45
-
46
- ### Core
47
-
48
- ```bash
49
- playwright-cli -s="$SESSION" open
50
- # open and navigate right away
51
- playwright-cli -s="$SESSION" open https://example.com/
52
- playwright-cli goto https://playwright.dev
53
- playwright-cli type "search query"
54
- playwright-cli click e3
55
- playwright-cli dblclick e7
56
- # --submit presses Enter after filling the element
57
- playwright-cli fill e5 "user@example.com" --submit
58
- playwright-cli drag e2 e8
59
- # drop files or data onto an element (from outside the page)
60
- playwright-cli drop e4 --path=./image.png
61
- playwright-cli drop e4 --data="text/plain=hello world"
62
- playwright-cli hover e4
63
- playwright-cli select e9 "option-value"
64
- playwright-cli upload ./document.pdf
65
- playwright-cli check e12
66
- playwright-cli uncheck e12
67
- playwright-cli snapshot
68
- playwright-cli eval "document.title"
69
- playwright-cli eval "el => el.textContent" e5
70
- # get element id, class, or any attribute not visible in the snapshot
71
- playwright-cli eval "el => el.id" e5
72
- playwright-cli eval "el => el.getAttribute('data-testid')" e5
73
- playwright-cli dialog-accept
74
- playwright-cli dialog-accept "confirmation text"
75
- playwright-cli dialog-dismiss
76
- playwright-cli resize 1920 1080
77
- playwright-cli -s="$SESSION" close
78
- ```
79
-
80
- ### Navigation
81
-
82
- ```bash
83
- playwright-cli go-back
84
- playwright-cli go-forward
85
- playwright-cli reload
86
- ```
87
-
88
- ### Keyboard
89
-
90
- ```bash
91
- playwright-cli press Enter
92
- playwright-cli press ArrowDown
93
- playwright-cli keydown Shift
94
- playwright-cli keyup Shift
95
- ```
96
-
97
- ### Mouse
98
-
99
- ```bash
100
- playwright-cli mousemove 150 300
101
- playwright-cli mousedown
102
- playwright-cli mousedown right
103
- playwright-cli mouseup
104
- playwright-cli mouseup right
105
- playwright-cli mousewheel 0 100
106
- ```
107
-
108
- ### Save as
109
-
110
- ```bash
111
- playwright-cli screenshot
112
- playwright-cli screenshot e5
113
- playwright-cli screenshot --filename=page.png
114
- playwright-cli pdf --filename=page.pdf
115
- ```
116
-
117
- ### Tabs
118
-
119
- ```bash
120
- playwright-cli tab-list
121
- playwright-cli tab-new
122
- playwright-cli tab-new https://example.com/page
123
- playwright-cli tab-close
124
- playwright-cli tab-close 2
125
- playwright-cli tab-select 0
126
- ```
127
-
128
- ### Storage
129
-
130
- ```bash
131
- playwright-cli state-save
132
- playwright-cli state-save auth.json
133
- playwright-cli state-load auth.json
134
-
135
- # Cookies
136
- playwright-cli cookie-list
137
- playwright-cli cookie-list --domain=example.com
138
- playwright-cli cookie-get session_id
139
- playwright-cli cookie-set session_id abc123
140
- playwright-cli cookie-set session_id abc123 --domain=example.com --httpOnly --secure
141
- playwright-cli cookie-delete session_id
142
- playwright-cli cookie-clear
143
-
144
- # LocalStorage
145
- playwright-cli localstorage-list
146
- playwright-cli localstorage-get theme
147
- playwright-cli localstorage-set theme dark
148
- playwright-cli localstorage-delete theme
149
- playwright-cli localstorage-clear
150
-
151
- # SessionStorage
152
- playwright-cli sessionstorage-list
153
- playwright-cli sessionstorage-get step
154
- playwright-cli sessionstorage-set step 3
155
- playwright-cli sessionstorage-delete step
156
- playwright-cli sessionstorage-clear
157
- ```
158
-
159
- ### Network
160
-
161
- ```bash
162
- playwright-cli route "**/*.jpg" --status=404
163
- playwright-cli route "https://api.example.com/**" --body='{"mock": true}'
164
- playwright-cli route-list
165
- playwright-cli unroute "**/*.jpg"
166
- playwright-cli unroute
167
- ```
168
-
169
- ### DevTools
170
-
171
- ```bash
172
- playwright-cli console
173
- playwright-cli console warning
174
- playwright-cli requests
175
- playwright-cli request 5
176
- playwright-cli run-code "async page => await page.context().grantPermissions(['geolocation'])"
177
- playwright-cli run-code --filename=script.js
178
- playwright-cli tracing-start
179
- playwright-cli tracing-stop
180
- playwright-cli video-start video.webm
181
- playwright-cli video-chapter "Chapter Title" --description="Details" --duration=2000
182
- playwright-cli video-stop
183
-
184
- # launch the dashboard for UI review / design feedback — user annotates the page, you receive the annotated screenshot, snapshot, and notes
185
- playwright-cli show --annotate
186
-
187
- # generate a Playwright locator for an element from its ref or selector
188
- playwright-cli generate-locator e5 --raw
189
-
190
- # show a persistent highlight overlay for an element, optionally with a custom style
191
- playwright-cli highlight e5
192
- playwright-cli highlight e5 --style="outline: 3px dashed red"
193
- # hide a single element highlight, or all page highlights when no target is given
194
- playwright-cli highlight e5 --hide
195
- playwright-cli highlight --hide
196
- ```
197
-
198
- ## Raw output
199
-
200
- The global `--raw` option strips page status, generated code, and snapshot sections from the output, returning only the result value. Use it to pipe command output into other tools. Commands that don't produce output return nothing.
201
-
202
- ```bash
203
- playwright-cli --raw eval "JSON.stringify(performance.timing)" | jq '.loadEventEnd - .navigationStart'
204
- playwright-cli --raw eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))" > links.json
205
- playwright-cli --raw snapshot > before.yml
206
- playwright-cli click e5
207
- playwright-cli --raw snapshot > after.yml
208
- diff before.yml after.yml
209
- TOKEN=$(playwright-cli --raw cookie-get session_id)
210
- playwright-cli --raw localstorage-get theme
211
- ```
212
-
213
- For structured output wrapping every reply as JSON, pass --json
214
- ```bash
215
- playwright-cli list --json
216
- ```
217
-
218
- ## Open parameters
219
- ```bash
220
- # Use specific browser when creating session
221
- playwright-cli -s="$SESSION" open --browser=chrome
222
- playwright-cli -s="$SESSION" open --browser=firefox
223
- playwright-cli -s="$SESSION" open --browser=webkit
224
- playwright-cli -s="$SESSION" open --browser=msedge
225
-
226
- # Use persistent profile (by default profile is in-memory)
227
- playwright-cli -s="$SESSION" open --persistent
228
- # Use persistent profile with custom directory
229
- playwright-cli -s="$SESSION" open --profile=/path/to/profile
230
-
231
- # Connect to browser via Playwright Extension
232
- playwright-cli -s="$SESSION" attach --extension=chrome
233
-
234
- # Connect to a running Chrome or Edge by channel name
235
- playwright-cli -s="$SESSION" attach --cdp=chrome
236
- playwright-cli -s="$SESSION" attach --cdp=msedge
237
-
238
- # Connect to a running browser via CDP endpoint
239
- playwright-cli -s="$SESSION" attach --cdp=http://localhost:9222
240
-
241
- # Start with config file
242
- playwright-cli -s="$SESSION" open --config=my-config.json
243
-
244
- # Close and verify an owned browser
245
- playwright-cli -s="$SESSION" close
246
- playwright-cli list
247
- # Detach from an attached browser (leaves the external browser running)
248
- playwright-cli -s="$SESSION" detach
249
- # Delete user data for the default session
250
- playwright-cli delete-data
251
- ```
252
-
253
- ## Snapshots
254
-
255
- After each command, playwright-cli provides a snapshot of the current browser state.
256
-
257
- ```bash
258
- > playwright-cli goto https://example.com
259
- ### Page
260
- - Page URL: https://example.com/
261
- - Page Title: Example Domain
262
- ### Snapshot
263
- [Snapshot](.playwright-cli/page-2026-02-14T19-22-42-679Z.yml)
264
- ```
265
-
266
- You can also take a snapshot on demand using `playwright-cli snapshot` command. All the options below can be combined as needed.
267
-
268
- ```bash
269
- # default - save to a file with timestamp-based name
270
- playwright-cli snapshot
271
-
272
- # save to file, use when snapshot is a part of the workflow result
273
- playwright-cli snapshot --filename=after-click.yaml
274
-
275
- # snapshot an element instead of the whole page
276
- playwright-cli snapshot "#main"
277
-
278
- # limit snapshot depth for efficiency, take a partial snapshot afterwards
279
- playwright-cli snapshot --depth=4
280
- playwright-cli snapshot e34
281
-
282
- # include each element's bounding box as [box=x,y,width,height]
283
- playwright-cli snapshot --boxes
284
- ```
285
-
286
- ## Targeting elements
287
-
288
- By default, use refs from the snapshot to interact with page elements.
289
-
290
- ```bash
291
- # get snapshot with refs
292
- playwright-cli snapshot
293
-
294
- # interact using a ref
295
- playwright-cli click e15
296
- ```
297
-
298
- You can also use css selectors or Playwright locators.
299
-
300
- ```bash
301
- # css selector
302
- playwright-cli click "#main > button.submit"
303
-
304
- # role locator
305
- playwright-cli click "getByRole('button', { name: 'Submit' })"
306
-
307
- # test id
308
- playwright-cli click "getByTestId('submit-button')"
309
- ```
310
-
311
- ## Browser Sessions
312
-
313
- ```bash
314
- # Choose a unique name once and register it as owned by this task.
315
- SESSION="profile-check-$(date +%s)-$$"
316
- # Choose either persistent option, not both.
317
- # Auto-generated profile location:
318
- playwright-cli -s="$SESSION" open example.com --persistent
319
- # Or a manually specified profile directory (only when requested explicitly):
320
- playwright-cli -s="$SESSION" open example.com --profile=/path/to/profile
321
- playwright-cli -s="$SESSION" click e6
322
- playwright-cli -s="$SESSION" delete-data # delete user data if requested
323
- playwright-cli -s="$SESSION" close # mandatory on success and errors
324
- playwright-cli list # verify $SESSION is absent
325
-
326
- playwright-cli list
327
- ```
328
-
329
- The global commands `playwright-cli close-all` and `playwright-cli kill-all` may affect sessions owned by others. Do not use them for this workflow; follow the emergency-only policy above.
330
-
331
- ## Installation
332
-
333
- If global `playwright-cli` command is not available, try a local version via `npx playwright-cli`:
334
-
335
- ```bash
336
- npx --no-install playwright-cli --version
337
- ```
338
-
339
- When local version is available, use `npx playwright-cli` in all commands. Otherwise, install `playwright-cli` as a global command:
340
-
341
- ```bash
342
- npm install -g @playwright/cli@latest
343
- ```
344
-
345
- ## Example: Form submission
346
-
347
- ```bash
348
- SESSION="form-check-$(date +%s)-$$"
349
- playwright-cli -s="$SESSION" open https://example.com/form
350
- playwright-cli -s="$SESSION" snapshot
351
-
352
- playwright-cli -s="$SESSION" fill e1 "user@example.com"
353
- playwright-cli -s="$SESSION" fill e2 "password123"
354
- playwright-cli -s="$SESSION" click e3
355
- playwright-cli -s="$SESSION" snapshot
356
- playwright-cli -s="$SESSION" close
357
- playwright-cli list # verify $SESSION is absent
358
- ```
359
-
360
- ## Example: Multi-tab workflow
361
-
362
- ```bash
363
- SESSION="tabs-check-$(date +%s)-$$"
364
- playwright-cli -s="$SESSION" open https://example.com
365
- playwright-cli -s="$SESSION" tab-new https://example.com/other
366
- playwright-cli -s="$SESSION" tab-list
367
- playwright-cli -s="$SESSION" tab-select 0
368
- playwright-cli -s="$SESSION" snapshot
369
- playwright-cli -s="$SESSION" close
370
- playwright-cli list # verify $SESSION is absent
371
- ```
372
-
373
- ## Example: Debugging with DevTools
374
-
375
- ```bash
376
- SESSION="devtools-check-$(date +%s)-$$"
377
- playwright-cli -s="$SESSION" open https://example.com
378
- playwright-cli -s="$SESSION" click e4
379
- playwright-cli -s="$SESSION" fill e7 "test"
380
- playwright-cli -s="$SESSION" console
381
- playwright-cli -s="$SESSION" requests
382
- playwright-cli -s="$SESSION" close
383
- playwright-cli list # verify $SESSION is absent
384
- ```
385
-
386
- ```bash
387
- SESSION="trace-check-$(date +%s)-$$"
388
- playwright-cli -s="$SESSION" open https://example.com
389
- playwright-cli -s="$SESSION" tracing-start
390
- playwright-cli -s="$SESSION" click e4
391
- playwright-cli -s="$SESSION" fill e7 "test"
392
- playwright-cli -s="$SESSION" tracing-stop
393
- playwright-cli -s="$SESSION" close
394
- playwright-cli list # verify $SESSION is absent
395
- ```
396
-
397
- ## Example: Interactive session
398
-
399
- Ask the user for UI review or design feedback. The user draws boxes on the live page and types comments; you receive the annotated screenshot, the snapshot of the marked region, and the user's notes. Use this whenever the user asks for "UI review", "design feedback", or to "ask the user what they think / want / mean":
400
-
401
- ```bash
402
- SESSION="ui-review-$(date +%s)-$$"
403
- playwright-cli -s="$SESSION" open https://example.com
404
- playwright-cli -s="$SESSION" show --annotate
405
- playwright-cli -s="$SESSION" close
406
- playwright-cli list # verify $SESSION is absent
407
- ```
408
-
409
- ## Specific tasks
410
-
411
- * **Running and Debugging Playwright tests** [references/playwright-tests.md](references/playwright-tests.md)
412
- * **Request mocking** [references/request-mocking.md](references/request-mocking.md)
413
- * **Running Playwright code** [references/running-code.md](references/running-code.md)
414
- * **Browser session management** [references/session-management.md](references/session-management.md)
415
- * **Spec-driven testing (plan / generate / heal)** [references/spec-driven-testing.md](references/spec-driven-testing.md)
416
- * **Storage state (cookies, localStorage)** [references/storage-state.md](references/storage-state.md)
417
- * **Test generation** [references/test-generation.md](references/test-generation.md)
418
- * **Tracing** [references/tracing.md](references/tracing.md)
419
- * **Video recording** [references/video-recording.md](references/video-recording.md)
420
- * **Inspecting element attributes** [references/element-attributes.md](references/element-attributes.md)
@@ -1,23 +0,0 @@
1
- # Inspecting Element Attributes
2
-
3
- When the snapshot doesn't show an element's `id`, `class`, `data-*` attributes, or other DOM properties, use `eval` to inspect them.
4
-
5
- ## Examples
6
-
7
- ```bash
8
- playwright-cli snapshot
9
- # snapshot shows a button as e7 but doesn't reveal its id or data attributes
10
-
11
- # get the element's id
12
- playwright-cli eval "el => el.id" e7
13
-
14
- # get all CSS classes
15
- playwright-cli eval "el => el.className" e7
16
-
17
- # get a specific attribute
18
- playwright-cli eval "el => el.getAttribute('data-testid')" e7
19
- playwright-cli eval "el => el.getAttribute('aria-label')" e7
20
-
21
- # get a computed style property
22
- playwright-cli eval "el => getComputedStyle(el).display" e7
23
- ```
@@ -1,50 +0,0 @@
1
- # Running Playwright Tests
2
-
3
- To run Playwright tests, use the `npx playwright test` command, or a package manager script. To avoid opening the interactive html report, use `PLAYWRIGHT_HTML_OPEN=never` environment variable.
4
-
5
- ```bash
6
- # Run all tests
7
- PLAYWRIGHT_HTML_OPEN=never npx playwright test
8
-
9
- # Run all tests through a custom npm script
10
- PLAYWRIGHT_HTML_OPEN=never npm run special-test-command
11
- ```
12
-
13
- # Debugging Playwright Tests
14
-
15
- To debug a failing Playwright test, run it with `--debug=cli` option. This command will pause the test at the start and print the debugging instructions.
16
-
17
- **IMPORTANT**: run the command in the background, record its PID as owned by the task, and check the output until "Debugging Instructions" is printed. As soon as the generated `tw-...` name appears, register that exact session as owned by this debug run. Plan cleanup immediately: on success, failure, interruption, or timeout, detach the CLI session, stop and reap the background test PID, then check `playwright-cli list` and verify the generated name is absent.
18
-
19
- Once instructions containing a session name are printed, use `playwright-cli` to attach the session and explore the page.
20
-
21
- ```bash
22
- # Run the test in the background and retain ownership of its PID.
23
- PLAYWRIGHT_HTML_OPEN=never npx playwright test --debug=cli > playwright-debug.log 2>&1 &
24
- TEST_PID=$!
25
- # ...
26
- # ... debugging instructions for "tw-abcdef" session ...
27
- # ...
28
-
29
- # Attach to the test
30
- playwright-cli attach tw-abcdef
31
- ```
32
-
33
- Keep the test running in the background while you explore and look for a fix.
34
- The test is paused at the start, so you should step over or pause at a particular location
35
- where the problem is most likely to be.
36
-
37
- Every action you perform with `playwright-cli` generates corresponding Playwright TypeScript code.
38
- This code appears in the output and can be copied directly into the test. Most of the time, a specific locator or an expectation should be updated, but it could also be a bug in the app. Use your judgement.
39
-
40
- After fixing the test, clean up before rerunning or responding:
41
-
42
- ```bash
43
- # Detach does not close an external browser. Ignore "not attached" if the test already exited.
44
- playwright-cli -s=tw-abcdef detach || true
45
- kill "$TEST_PID" 2>/dev/null || true
46
- wait "$TEST_PID" 2>/dev/null || true
47
- playwright-cli list # verify tw-abcdef is absent
48
- ```
49
-
50
- Do not use `close-all` or `kill-all`: other debug or automation sessions may belong to another task. Rerun normally to check that the test passes.
@@ -1,87 +0,0 @@
1
- # Request Mocking
2
-
3
- Intercept, mock, modify, and block network requests.
4
-
5
- ## CLI Route Commands
6
-
7
- ```bash
8
- # Mock with custom status
9
- playwright-cli route "**/*.jpg" --status=404
10
-
11
- # Mock with JSON body
12
- playwright-cli route "**/api/users" --body='[{"id":1,"name":"Alice"}]' --content-type=application/json
13
-
14
- # Mock with custom headers
15
- playwright-cli route "**/api/data" --body='{"ok":true}' --header="X-Custom: value"
16
-
17
- # Remove headers from requests
18
- playwright-cli route "**/*" --remove-header=cookie,authorization
19
-
20
- # List active routes
21
- playwright-cli route-list
22
-
23
- # Remove a route or all routes
24
- playwright-cli unroute "**/*.jpg"
25
- playwright-cli unroute
26
- ```
27
-
28
- ## URL Patterns
29
-
30
- ```
31
- **/api/users - Exact path match
32
- **/api/*/details - Wildcard in path
33
- **/*.{png,jpg,jpeg} - Match file extensions
34
- **/search?q=* - Match query parameters
35
- ```
36
-
37
- ## Advanced Mocking with run-code
38
-
39
- For conditional responses, request body inspection, response modification, or delays:
40
-
41
- ### Conditional Response Based on Request
42
-
43
- ```bash
44
- playwright-cli run-code "async page => {
45
- await page.route('**/api/login', route => {
46
- const body = route.request().postDataJSON();
47
- if (body.username === 'admin') {
48
- route.fulfill({ body: JSON.stringify({ token: 'mock-token' }) });
49
- } else {
50
- route.fulfill({ status: 401, body: JSON.stringify({ error: 'Invalid' }) });
51
- }
52
- });
53
- }"
54
- ```
55
-
56
- ### Modify Real Response
57
-
58
- ```bash
59
- playwright-cli run-code "async page => {
60
- await page.route('**/api/user', async route => {
61
- const response = await route.fetch();
62
- const json = await response.json();
63
- json.isPremium = true;
64
- await route.fulfill({ response, json });
65
- });
66
- }"
67
- ```
68
-
69
- ### Simulate Network Failures
70
-
71
- ```bash
72
- playwright-cli run-code "async page => {
73
- await page.route('**/api/offline', route => route.abort('internetdisconnected'));
74
- }"
75
- # Options: connectionrefused, timedout, connectionreset, internetdisconnected
76
- ```
77
-
78
- ### Delayed Response
79
-
80
- ```bash
81
- playwright-cli run-code "async page => {
82
- await page.route('**/api/slow', async route => {
83
- await new Promise(r => setTimeout(r, 3000));
84
- route.fulfill({ body: JSON.stringify({ data: 'loaded' }) });
85
- });
86
- }"
87
- ```