vitexec
Use vitexec when the truth lives in the running browser: client state, imported app modules, DOM, canvas/WebGL, screenshots, recordings, or browser-only errors.
Do not use it for questions static files, unit tests, or TypeScript can answer directly.
References
- If
vitexec or Playwright is missing, read references/install.md.
- For mouse, keyboard, pointer lock, gamepad, or other input, read references/inputs.md.
- For CPU, network, performance timeline, or heap analysis, read references/performance.md.
- For WebXR, read references/webxr.md.
Workflow
- Identify the page path if it is not
/.
- Write the smallest snippet that performs the user-like action or reads the browser-only state.
- Run
vitexec '<snippet>', adding --path, --gpu, --screenshot, --record, --cpu-profile, --network-trace, --performance-trace, --heap-snapshot, --timeout, or --config only when needed.
- Treat stdout as browser logs. It starts with
logs:.
vitexec 'console.log("ready")'
For structured state, log JSON:
vitexec --path /cart '
import { useCartStore } from "/src/store/cart.ts";
document.querySelector("[data-testid=add-to-cart]")?.click();
await new Promise((resolve) => requestAnimationFrame(resolve));
console.log("cart", JSON.stringify(useCartStore.getState()));
'
Guidance
- Prefer importing exported app state over scraping DOM when state is available.
- Use direct state reads for observation and assertions, not to bypass user interaction.
- Use live progress logs and focused assertions to early-exit on failures and see current progress.
- Keep logs concise; overly verbose logs become unreadable and unnecessarily fill the context.
- Prefer browser-root imports such as
/src/store.ts, not local filesystem paths.
- Use
--gpu for WebGL, canvas, Three.js, and WebXR behavior.
- Use screenshots or recordings only when visual evidence matters.
- Do not leave temporary code in the app when
vitexec can inspect it from outside.
1---2name: vitexec3description: Use this skill when an AI agent needs to inspect, verify, debug, or profile a live Vite app by running temporary snippets inside the browser page and reading browser logs or captured artifacts. Use for client state after interactions, imported app modules, DOM state, human-like input, canvas/WebGL/Three.js state, screenshots, videos, CPU/network/performance/heap analysis, WebXR/Three.js XR with IWER, and runtime-only behavior without editing app files.4metadata:5 source: https://skillmd.com/skills/pmndrs/vitexec6---78# vitexec910Use `vitexec` when the truth lives in the running browser: client state, imported app modules, DOM, canvas/WebGL, screenshots, recordings, or browser-only errors.1112Do not use it for questions static files, unit tests, or TypeScript can answer directly.1314## References1516- If `vitexec` or Playwright is missing, read [references/install.md](references/install.md).17- For mouse, keyboard, pointer lock, gamepad, or other input, read [references/inputs.md](references/inputs.md).18- For CPU, network, performance timeline, or heap analysis, read [references/performance.md](references/performance.md).19- For WebXR, read [references/webxr.md](references/webxr.md).2021## Workflow22231. Identify the page path if it is not `/`.242. Write the smallest snippet that performs the user-like action or reads the browser-only state.253. Run `vitexec '<snippet>'`, adding `--path`, `--gpu`, `--screenshot`, `--record`, `--cpu-profile`, `--network-trace`, `--performance-trace`, `--heap-snapshot`, `--timeout`, or `--config` only when needed.264. Treat stdout as browser logs. It starts with `logs:`.2728```sh29vitexec 'console.log("ready")'30```3132For structured state, log JSON:3334```sh35vitexec --path /cart '36 import { useCartStore } from "/src/store/cart.ts";37 document.querySelector("[data-testid=add-to-cart]")?.click();38 await new Promise((resolve) => requestAnimationFrame(resolve));39 console.log("cart", JSON.stringify(useCartStore.getState()));40'41```4243## Guidance4445- Prefer importing exported app state over scraping DOM when state is available.46- Use direct state reads for observation and assertions, not to bypass user interaction.47- Use live progress logs and focused assertions to early-exit on failures and see current progress.48- Keep logs concise; overly verbose logs become unreadable and unnecessarily fill the context.49- Prefer browser-root imports such as `/src/store.ts`, not local filesystem paths.50- Use `--gpu` for WebGL, canvas, Three.js, and WebXR behavior.51- Use screenshots or recordings only when visual evidence matters.52- Do not leave temporary code in the app when `vitexec` can inspect it from outside.