@neethan/pikr
v0.3.1
Published
Universal element picker for terminal-based AI coding agents
Maintainers
Readme
pikr
A CLI tool that lets you visually pick UI elements and get structured context for your AI agent. Click → clipboard → paste.
https://github.com/user-attachments/assets/4f31a091-c307-4621-b492-80e383316176
Quickstart
npm install -g @neethan/pikrThen from any project folder:
pikrThat's it. pikr starts your dev server if needed, opens Chrome, and you're ready to pick elements.
Or specify a port directly:
pikr <port> # e.g. pikr 3000, pikr 5173How it works
- pikr detects your project, starts the dev server if needed, and opens Chrome
- Click the pikr pill to toggle inspect mode
- Click elements to select — each gets a numbered badge
- Optionally click a badge to add a comment (e.g., "make this bigger")
- Press Enter or click the send icon to copy all selections to clipboard
- Paste into any terminal agent (Claude Code, Codex, OpenCode, Amp, ...)
- Press ESC to exit inspect mode
What gets captured
pikr: form.order-form > button.submit
url: http://localhost:3000/orders
source: OrderForm in src/components/OrderForm.tsx:84
ancestry: form.order-form > div.actions > [this]
<button class="submit btn-primary">Submit Order</button>
styles: background-color: #2563eb; color: #fff; border-radius: 8pxEvery capture is also logged to ~/.pikr/selections.jsonl.
Source mapping
pikr auto-detects Vue and React projects and maps elements back to source files:
- Vue 3 — component name + file path (works in dev mode, no extra setup)
- React 18 — component name + file:line:col (works in dev mode)
- React 19+ — best-effort file:line from stack trace parsing
- React (any) — precise file:line:col if
@react-dev-inspector/babel-pluginis installed
Agent integration
pikr works with any terminal agent out of the box — just paste the clipboard output.
For deeper integration, agents can:
- Launch pikr as a background process:
pikr & - Read selections from
~/.pikr/selections.jsonl(NDJSON, one entry per line) - Each entry includes
selector,html,styles,ancestry,component,filePath, andsessionId
Options
pikr Auto-start or auto-detect dev server
pikr <port> Port shorthand (e.g. pikr 3000)
pikr <url> Full URL (e.g. pikr localhost:3000)
pikr --log <path> Custom log file path
pikr --no-clipboard Log only, skip clipboard
pikr --plugin <path> Load a framework pluginPlugins
pikr includes built-in source mapping for Vue and React. For other frameworks, you can write or install plugins:
pikr --plugin ./my-plugin.jsPlugins are also auto-discovered from node_modules (pikr-plugin-* or @pikr/plugin-*).
Requirements
- Node.js 18+
- Chrome or Chromium installed
License
MIT
