ReactDetector is a local CLI inspector for React and Next.js apps. It starts or attaches to a dev server, opens a local browser UI, lets you click visible UI elements, and produces an AI-ready context prompt for Codex, Cursor, ChatGPT, or another assistant.
pnpm install
pnpm buildStart an existing project with its dev script:
pnpm start -- run D:\path\to\appAttach to an app that is already running:
pnpm start -- inspect --target-url http://localhost:5173 --project D:\path\to\appUseful options:
pnpm start -- run ./app --script dev --ui-port 4545 --viewports mobile,desktop
pnpm start -- inspect --target-url http://localhost:3000 --no-openAfter installing or linking the package as a CLI, use the shorter reactdetector run ... and reactdetector inspect ... forms.
This repo has a mock Vite React app at sandbox/mock-react-app for local CLI testing.
pnpm start -- run .\sandbox\mock-react-appOr start the mock manually, then attach ReactDetector:
pnpm --dir .\sandbox\mock-react-app run dev
pnpm start -- inspect --target-url http://localhost:5179 --project .\sandbox\mock-react-app- Supports Next.js and Vite React detection first.
- Does not modify target project source files.
- Adds only temporary runtime
data-rd-idvalues inside the browser DOM. - Produces copyable Markdown plus JSON context instead of calling AI directly.
- Uses runtime DOM/accessibility context and best-effort React fiber hints.
pnpm typecheck
pnpm test
pnpm build
pnpm test:browserpnpm test:browser requires Playwright Chromium to be installed:
pnpm exec playwright install chromiumMIT. See LICENSE.
