Contributing
January 31, 2026 · View on GitHub
Development Setup
Prerequisites
- Node.js 18+
- npm
Build from Source
# Clone the repository
git clone https://github.com/braintrustdata/cursor-extension.git
cd cursor-extension
# Install dependencies
npm install
# Build the extension
npm run build
Running in Development
- Open this folder in Cursor
- Press
F5to launch the Extension Development Host - A new Cursor window will open with the extension loaded
Setting the Environment Variable for Development
The extension reads BRAINTRUST_API_KEY from the process environment at runtime. You must set this variable before launching Cursor so the extension host process inherits it.
macOS / Linux
# Set the environment variable and launch Cursor
export BRAINTRUST_API_KEY="your-api-key-here"
cursor .
# Or in a single line
BRAINTRUST_API_KEY="your-api-key-here" cursor .
For persistent configuration, add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
export BRAINTRUST_API_KEY="your-api-key-here"
Then restart your terminal and Cursor.
Windows (PowerShell)
# Set for current session
$env:BRAINTRUST_API_KEY = "your-api-key-here"
# Launch Cursor
cursor .
For persistent configuration:
# Set permanently for user
[Environment]::SetEnvironmentVariable("BRAINTRUST_API_KEY", "your-api-key-here", "User")
Then restart PowerShell and Cursor.
Windows (Command Prompt)
# Set for current session
set BRAINTRUST_API_KEY=your-api-key-here
# Launch Cursor
cursor .
For persistent configuration, use System Properties > Environment Variables.
Installing a Local Build
- Build the extension:
npm run build - Package it:
npx vsce package(produces a.vsixfile) - In Cursor, open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) - Run Extensions: Install from VSIX...
- Select the generated
.vsixfile
Project Structure
cursor-extension/
├── package.json # Extension manifest
├── tsconfig.json # TypeScript configuration
├── src/
│ └── extension.ts # Main extension code
├── out/ # Compiled output (git-ignored)
└── README.md
Scripts
npm run build— Compile TypeScriptnpm run watch— Compile in watch modenpm run lint— Run ESLint (requires eslint to be installed)npm run package— Create a.vsixpackagenpm run publish:openvsx— Publish to OpenVSX (for Cursor)npm run publish:vscode— Publish to VS Code Marketplace
Publishing
Cursor uses OpenVSX, not the VS Code Marketplace. You need to publish to OpenVSX for extensions to appear in Cursor.
First-time setup (OpenVSX)
- Sign in at https://open-vsx.org with GitHub
- Get an access token from https://open-vsx.org/user-settings/tokens
- Create the namespace (one-time):
npx ovsx create-namespace braintrustdata -p <your-token>
Publishing a release
- Update the version in
package.json - Build and publish to OpenVSX:
npm run build npx ovsx publish -p <your-token>
Or to package without publishing (for testing):
npm run package
# creates braintrust-x.x.x.vsix