Prerequisites
You must have the GitHub Copilot CLI installed to use this integration.
Installation
Start the server
The server runs on the default relay port.To stop it:
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: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 Copilot CLI process
- Copilot CLI processes the request with
--silent,--allow-all, and--no-colorflags - 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 Copilot”
- Enter your prompt describing what you want to change
- Watch as GitHub Copilot 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 form input in your UI and press Cmd+C (Mac) or Ctrl+C (Windows/Linux).
Advanced Configuration
You can customize the Copilot provider with options:Session Management
The Copilot integration supports session resumption for continued conversations:Undo Support
You can undo the last change made by Copilot:CLI Arguments
The integration automatically passes these arguments to the Copilot CLI:-p- The prompt describing the change--silent- Suppress interactive prompts--allow-all- Auto-approve all changes--no-color- Disable color output for parsing--model- Specify the AI model (if provided)--resume- Resume a previous session (if available)
Troubleshooting
Copilot CLI not found
Copilot CLI not found
Make sure you have installed the GitHub Copilot CLI:Verify it’s installed:
Server won't start
Server won't start
- Check if the default port is already in use
- Try killing existing processes:
pkill -f "react-grab.*server" - Check server logs for error messages
No response from Copilot
No response from Copilot
- Verify you’re logged into GitHub Copilot CLI
- Check that you have an active Copilot subscription
- Ensure the Copilot CLI is working:
copilot --help
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
Changes not appearing
Changes not appearing
- Check that your files are writable
- Verify the working directory is correct
- Look for error messages in stderr output
Performance Benefits
Using React Grab with GitHub Copilot can make your development workflow up to 3× faster by:- Eliminating manual file navigation and component searching
- Providing precise context about the exact element to modify
- Reducing back-and-forth by including all relevant information upfront
- Supporting session continuity for related changes
Next Steps
Quick Start
Get started with React Grab
Plugin API
Learn about the plugin system
