This page is the fastest path from zero context to a useful rdt session.
npm install -g react-devtool-clirdt resolves Playwright from the local project first, then falls back through playwright-core, RDT_PLAYWRIGHT_PATH, and global installs.
| Command | Use when | Notes |
|---|---|---|
rdt session open |
You want rdt to launch and own the browser locally |
Recommended default path |
rdt session connect |
You already have a Playwright wsEndpoint |
Remote-friendly, keeps Playwright fidelity |
rdt session attach |
You only have Chromium CDP access | Compatibility path, lower fidelity than Playwright protocol |
rdt session open --url http://localhost:3000 --browser chromium --engine auto --session demo
rdt tree get --session demo
rdt tree stats --session demo --top 5
rdt node search App --session demo --snapshot <snapshotId> --structured
rdt node inspect <nodeId> --session demo --snapshot <snapshotId>If you only remember one rule, remember this one: tree get starts the inspection cycle, and the returned snapshotId should follow later lookup commands.
tree getreturns asnapshotId.- Node ids are only guaranteed to be meaningful inside that snapshot.
- If you omit
--snapshot,rdtfalls back to the latest collected snapshot. - If a requested snapshot has been evicted from the in-memory cache, the command fails with
snapshot-expired.
Recommended flow:
rdt tree get --session demo
rdt tree stats --session demo --top 5
rdt node search App --session demo --snapshot <snapshotId> --structured
rdt node highlight <nodeId> --session demo --snapshot <snapshotId>
rdt source reveal <nodeId> --session demo --snapshot <snapshotId> --structuredtree statsis the lightweight summary path whentree get --format jsonis too heavy.node search --structuredkeeps the default array-returning behavior opt-in while addingmatchCountandruntimeWarnings.source reveal --structuredreturns availability metadata instead of only rawnull.
Recovery flow:
rdt tree get --session demo
# save the new snapshotId
rdt node search App --session demo --snapshot <newSnapshotId>rdt doctor --session demo
rdt session doctor --session demoUse it to confirm:
- React was detected
- which engine was selected
- whether built-in
interacthelpers are supported - whether profiler and source-reveal capabilities are trustworthy for the current runtime
Built-in interactions keep the investigation inside the same session instead of forcing separate helper scripts.
rdt interact click --session demo --role button --nth 0 --delivery auto
rdt interact type --session demo --selector 'input[name="query"]' --text hello
rdt interact wait --session demo --ms 500interact click --delivery autouses Playwright pointer input by default.- When the profiler is active,
automay fall back to DOM dispatch and reports the applied delivery in the response payload. - Use one targeting mode per click:
--selector,--text, or--role. - Add
--nthto choose one match from a broader result set, or--strictto require exactly one match.
After interaction, verify the app settled by collecting a fresh tree or reading profiler output instead of assuming the UI state changed correctly.
rdt profiler start --session demo
rdt interact type --session demo --selector 'input[name="query"]' --text hello
rdt profiler stop --session demo
rdt profiler summary --session demo
rdt profiler ranked <commitId> --session demo --limit 10
rdt profiler export --session demo --compressRead profiler output literally:
commitCounttells you how many commits were capturednodeCountfields describe live tree size at commit time, not exact rerender countsprimaryUpdateCommitIdandrecommendedCommitIdsare better drill-down targets than blindly reading the first commit
rdt session close --session demoTreat sessions as explicit resources. Close them when the investigation is over so later runs start from a known state.