| name | d3k |
| description | d3k assistant for debugging web apps |
d3k Commands
d3k captures browser and server logs in a unified log file. Use these commands:
Viewing Errors and Logs
d3k errors
d3k errors --context
d3k errors -n 20
d3k logs
d3k logs --type browser
d3k logs --type server
Other Commands
d3k fix
d3k fix --focus build
d3k crawl
d3k crawl --depth all
d3k find-component "nav"
Browser Interaction
First run d3k cdp-port to get the port number, then use it directly in all browser commands:
d3k cdp-port
d3k agent-browser --cdp 9222 open http://localhost:3000/page
d3k agent-browser --cdp 9222 snapshot -i
d3k agent-browser --cdp 9222 click @e2
d3k agent-browser --cdp 9222 fill @e3 "text"
d3k agent-browser --cdp 9222 screenshot /tmp/shot.png
Fix Workflow
d3k errors --context - See errors and what triggered them
- Fix the code
- Run
d3k cdp-port to get the port, then d3k agent-browser --cdp <port> open <url> then click @e1 to replay
d3k errors - Verify fix worked
Creating PRs with Before/After Screenshots
When creating a PR for visual changes, always capture before/after screenshots to show the impact:
-
Before making changes, screenshot the production site (run d3k cdp-port first to get the port):
d3k agent-browser --cdp <port> open https://production-url.com/affected-page
d3k agent-browser --cdp <port> screenshot /tmp/before.png
-
After making changes, screenshot localhost:
d3k agent-browser --cdp <port> open http://localhost:3000/affected-page
d3k agent-browser --cdp <port> screenshot /tmp/after.png
-
Or use the tooling API to capture multiple routes at once:
capture_before_after_screenshots(
productionUrl: "https://myapp.vercel.app",
routes: ["/", "/about", "/contact"]
)
-
Include in PR description using markdown:
### Visual Comparison
| Route | Before | After |
|-------|--------|-------|
| `/` |  |  |
Upload screenshots by dragging them into the GitHub PR description.