@ewjdev/anyclick-cursor-local
v1.2.0
Published
Local Cursor CLI adapter for UI feedback - run cursor-agent locally during development
Maintainers
Readme
@ewjdev/anyclick-cursor-local
Local Cursor CLI adapter for UI feedback - run cursor-agent locally during development
Overview
@ewjdev/anyclick-cursor-local enables local Cursor integration for development workflows. Submit UI feedback and have it automatically open in Cursor with full context for AI-powered fixes.
Installation
npm install @ewjdev/anyclick-cursor-localQuick Start
1. Start the Local Server
# Add to package.json scripts
"scripts": {
"feedback-server": "anyclick-local-server"
}
# Run
npm run feedback-server2. Configure the Provider
"use client";
import { FeedbackProvider } from "@ewjdev/anyclick-react";
import { createLocalAdapter } from "@ewjdev/anyclick-cursor-local";
const adapter = createLocalAdapter({
serverUrl: "http://localhost:3847",
projectPath: process.cwd(),
});
<FeedbackProvider adapter={adapter}>{children}</FeedbackProvider>;Features
- 🖥️ Local Development - No cloud dependency for development
- 📁 File-Based Storage - Feedback saved as JSON files
- 🚀 Cursor Integration - Automatically opens Cursor with context
- ⚙️ Configurable - Customize prompt generation and file handling
How It Works
- User right-clicks element and selects "Fix with Cursor"
- Feedback is sent to local server on your machine
- Server saves feedback to
.feedback/directory - Server invokes Cursor with the feedback context
- Cursor AI analyzes and proposes fixes
Server Configuration
Create anyclick.config.js in your project root:
module.exports = {
port: 3847,
outputDir: ".feedback",
cursorPath: "/Applications/Cursor.app/Contents/MacOS/Cursor",
onFeedback: async (payload, filePath) => {
console.log(`Feedback saved to: ${filePath}`);
},
formatPrompt: (payload) => {
return `Fix: ${payload.comment}\nElement: ${payload.element.selector}`;
},
cors: {
origin: ["http://localhost:3000"],
},
};Multi-Adapter Setup
Route different feedback types to different adapters:
import { createLocalAdapter } from "@ewjdev/anyclick-cursor-local";
import { createHttpAdapter } from "@ewjdev/anyclick-github";
function createRoutingAdapter(config) {
return {
async submit(payload) {
if (payload.type === "cursor_local") {
return config.local.submit(payload);
}
return config.github.submit(payload);
},
};
}
const adapter = createRoutingAdapter({
local: createLocalAdapter({ serverUrl: "http://localhost:3847" }),
github: createHttpAdapter({ endpoint: "/api/feedback" }),
});CLI
# Start with default options
npx anyclick-local-server
# Start with custom port
npx anyclick-local-server --port 4000
# Start with custom output directory
npx anyclick-local-server --output .my-feedbackSecurity
⚠️ The local server is designed for development only. Never expose it to the internet. The server only accepts connections from localhost by default.
Best Practices
- Add
.feedback/to your.gitignore - Use descriptive comments when submitting feedback
- Configure Cursor rules for your project conventions
- Run the server in a separate terminal for visibility
Documentation
For full documentation, visit anyclick.ewj.dev/docs/adapters
Related Packages
@ewjdev/anyclick-core- Core library@ewjdev/anyclick-react- React provider@ewjdev/anyclick-cursor- Cursor Cloud integration
License
MIT © anyclick
