Installation
Start the server
The server runs on port To stop it:
5567 by default.Quick Start (CLI)
Start the server in the background before running your dev server:The server will run as a detached background process. Stopping your dev server (Ctrl+C) won’t stop the React Grab server.
Recommended: Config File Setup
For better lifecycle management, start the server from your config file. This ensures the server stops when your dev server stops:Vite
Next.js
How It Works
- React Grab sends the selected element context to the server via HTTP POST
- Server receives the request and spawns the
cursor-agentCLI process - cursor-agent processes the request and streams JSON responses to stdout
- Server relays status updates to the client via Server-Sent Events (SSE)
Usage
Once installed, you can:- Select an element in your browser by hovering over it with React Grab active
- Right-click or use the context menu to choose “Edit with Cursor”
- Enter your prompt describing what you want to change
- Watch as Cursor Agent makes the changes in real-time
- The selected element’s HTML structure
- Component name and file location
- Line numbers for precise targeting
Example Workflow
Select the element
Hover over a button in your UI and press Cmd+C (Mac) or Ctrl+C (Windows/Linux) to select it.
Advanced Configuration
You can customize the Cursor provider:Troubleshooting
Server won't start
Server won't start
- Check if port 5567 is already in use
- Try killing existing processes:
pkill -f "react-grab.*server" - Ensure you have the Cursor Agent CLI installed
No response from Cursor Agent
No response from Cursor Agent
- Verify the Cursor Agent CLI is installed and accessible
- Check server logs for error messages
- Ensure your project is open in Cursor
Context not being sent
Context not being sent
- Verify the client script is loaded in your browser
- Check browser console for connection errors
- Ensure the server is running before loading your app
Performance Benefits
Using React Grab with Cursor can make your development workflow up to 3× faster by:- Eliminating the need to manually locate files and components
- Providing precise context about the exact element to modify
- Reducing back-and-forth with the AI by including all relevant information upfront
Next Steps
Quick Start
Get started with React Grab
Plugin API
Learn about the plugin system
