vibe-fork of zh-lx/code-inspector, inspired by this demo of inspector
- clone/fork this repo
- build
cd cursor-grabber
pnpm install && pnpm build
- set up local package link
cd cursor-grabber/packages/code-inspector-plugin
pnpm link
- build & install cursor extension
cd cursor-grabber/cursor-extension
cursor --install-extension cursor-grabber-extension-0.0.1.vsix
(restart extension host if needed cmd+shift+p → Restart Extension Host)
- add link in your project
cd path/to/my-project
npm link code-inspector-plugin
- add configuration to your project
// next.config.ts
import type { NextConfig } from "next";
import { codeInspectorPlugin } from 'code-inspector-plugin';
const nextConfig: NextConfig = {
turbopack: {
rules: codeInspectorPlugin({
bundler: 'turbopack',
editor: 'cursor',
printServer: true,
behavior: {
defaultAction: 'locate',
},
})
}
};
export default nextConfig;- open your project in cursor
- start your server as normal (
npm run dev) - hold
option+shiftthen click your target element - go to cursor,
cmd+vin the chat, and it'll attach those lines as chat context
- i have only tested this with nextjs, but it probably works with everything that is supported by zh-lx/code-inspector
- feel free to contribute :) i'd like to eventually publish this as a standalone npm pkg + vscode extension
- removed all demo stuff
- updated client to pass
endLineinstead of just start line number - removed
launchIDEcall → replaced with request to vscode server ext - added vscode ext
you can make changes then build/install like this:
cd cursor-grabber/cursor-extension
npm run compile
vsce package --no-yarn
cursor --install-extension cursor-grabber-extension-0.0.1.vsix