Skip to content

Installation

Requirements

  • Go: Version 1.19 or higher
  • Cursor IDE: Installed on your system
  • Operating System: Windows, macOS, or Linux

Install via go get

The simplest way to install Go Cursor SDK is using go get:

bash
go get github.com/vibe-coding-labs/go-cursor-sdk

This will download the SDK and all its dependencies.

Verify Installation

Create a simple test program to verify the installation:

go
package main

import (
    "fmt"
    cursor "github.com/vibe-coding-labs/go-cursor-sdk"
)

func main() {
    client, err := cursor.NewCursorClient(nil)
    if err != nil {
        fmt.Printf("Error: %v\n", err)
        return
    }
    defer client.Close()
    
    fmt.Println("Go Cursor SDK installed successfully!")
}

Run it:

bash
go run main.go

If you see "Go Cursor SDK installed successfully!", the installation is complete!

Dependencies

The SDK has minimal dependencies:

  • github.com/mattn/go-sqlite3 - SQLite driver for Go
  • Standard Go library

All dependencies are automatically installed when you run go get.

Platform-Specific Notes

macOS

On macOS, Cursor data is typically stored in:

~/Library/Application Support/Cursor

The SDK will automatically detect this location.

Linux

On Linux, Cursor data is typically stored in:

~/.config/Cursor

The SDK will automatically detect this location.

Windows

On Windows, Cursor data is typically stored in:

%APPDATA%\Cursor

The SDK will automatically detect this location.

Custom Storage Path

If Cursor is installed in a non-standard location, you can specify a custom path:

go
config := &cursor.ClientConfig{
    CustomPath: "/path/to/cursor/storage",
}

client, err := cursor.NewCursorClient(config)

Troubleshooting

"Cursor storage path not found"

This error occurs when the SDK cannot locate Cursor's data directory. Solutions:

  1. Ensure Cursor IDE is installed
  2. Run Cursor at least once to create the data directory
  3. Specify a custom path using CustomPath in the configuration

"Permission denied"

This error occurs when the SDK doesn't have permission to read Cursor's data. Solutions:

  1. Run your program with appropriate permissions
  2. Check file permissions on the Cursor data directory
  3. On macOS, grant Full Disk Access to your terminal application

"Database is locked"

This error occurs when Cursor IDE is actively using the database. Solutions:

  1. Close Cursor IDE before running your program
  2. The SDK opens databases in read-only mode, but some operations may still conflict
  3. Wait a moment and try again

Updating

To update to the latest version:

bash
go get -u github.com/vibe-coding-labs/go-cursor-sdk

Version Compatibility

The SDK follows semantic versioning:

  • Major version (1.x.x): Breaking API changes
  • Minor version (x.1.x): New features, backward compatible
  • Patch version (x.x.1): Bug fixes, backward compatible

Check the CHANGELOG for version-specific changes.

Next Steps

Released under the MIT License.