Loading...
Loading...
Give AI agents eyes into React apps - inspect component trees, props, state, hooks, and profile rendering performance from the command line
npx skill4agent add aradotso/devtools-skills agent-react-devtoolsSkill by ara.so — Devtools Skills collection.
agent-react-devtoolsnpm install -g agent-react-devtoolsnpx agent-react-devtools start@c1@c2<div><span>npx agent-react-devtools initnpx agent-react-devtools uninitsrc/main.tsximport "agent-react-devtools/connect";// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { reactDevtools } from "agent-react-devtools/vite";
export default defineConfig({
plugins: [
reactDevtools(), // Must come before react()
react()
],
});reactDevtools({ port: 8097, host: "localhost" })agent-react-devtools start
npx react-native startadb reverse tcp:8097 tcp:8097agent-react-devtools startagent-react-devtools start --port 8097agent-react-devtools statusagent-react-devtools stopagent-react-devtools get treeagent-react-devtools get tree --depth 3agent-react-devtools get tree --allagent-react-devtools get tree @c5agent-react-devtools get component @c6@c6 [fn] TodoItem key=1
props:
id: 1
text: "Buy groceries"
done: false
onToggle: ƒ
hooks:
State: false
Callback: ƒagent-react-devtools find TodoItemagent-react-devtools find App --exactagent-react-devtools countagent-react-devtools errorsagent-react-devtools wait --connected --timeout 30agent-react-devtools wait --component App --timeout 30agent-react-devtools profile startagent-react-devtools profile start "user-interaction-test"agent-react-devtools profile stopagent-react-devtools profile slowagent-react-devtools profile slow --limit 5agent-react-devtools profile rerendersagent-react-devtools profile timelineagent-react-devtools profile commit 3agent-react-devtools profile commit #3agent-react-devtools profile report @c5agent-react-devtools profile export results.jsonagent-react-devtools profile diff before.json after.jsonagent-react-devtools profile diff before.json after.json --threshold 2.0agent-react-devtools start
# Run your app (it should auto-connect)
agent-react-devtools statusagent-react-devtools find UserProfileagent-react-devtools get component @c12agent-react-devtools get tree @c12 --depth 2agent-react-devtools profile start "search-performance"agent-react-devtools profile stop
agent-react-devtools profile slow --limit 10
agent-react-devtools profile rerenders --limit 10agent-react-devtools profile report @c8#!/bin/bash
agent-react-devtools start
agent-react-devtools wait --connected --timeout 30 || exit 1
# Check for components with errors
if agent-react-devtools errors | grep -q "@c"; then
echo "Components have errors!"
agent-react-devtools errors
exit 1
fi
# Profile a workflow
agent-react-devtools profile start "ci-test"
# ... trigger app interactions ...
agent-react-devtools profile stop
agent-react-devtools profile export ci-results.json
# Check for slow components
SLOW_COUNT=$(agent-react-devtools profile slow --limit 5 | grep -c "avg:")
if [ "$SLOW_COUNT" -gt 3 ]; then
echo "Too many slow components detected"
agent-react-devtools profile slow
exit 1
fiagent-browser# IMPORTANT: Must use --headed mode
agent-browser --session devtools --headed open http://localhost:5173/
agent-react-devtools status # Verify connection
agent-react-devtools profile start
# ... agent-browser interactions ...
agent-react-devtools profile stop
agent-react-devtools profile slowREACT_DEVTOOLS_PORTagent-react-devtools start --port 9000agent-react-devtools statusagent-react-devtools stop
agent-react-devtools startreactDevtools()react()agent-react-devtools get tree --allagent-react-devtools countagent-react-devtools profile stopagent-react-devtools wait --connected --timeout 60lsof -i :8097@c1@c2⚠✗ƒ├─└─... +N moreAGENTS.md.cursorrules## React Component Inspection
Use `agent-react-devtools` to inspect the running React app:
1. Start daemon: `agent-react-devtools start`
2. Check connection: `agent-react-devtools status`
3. Browse tree: `agent-react-devtools get tree --depth 3`
4. Inspect component: `agent-react-devtools get component @cN`
5. Profile performance: `agent-react-devtools profile start` → interact → `profile stop` → `profile slow`
Always check `status` before other commands to ensure app is connected.