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:
go get github.com/vibe-coding-labs/go-cursor-sdkThis will download the SDK and all its dependencies.
Verify Installation
Create a simple test program to verify the installation:
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:
go run main.goIf 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/CursorThe SDK will automatically detect this location.
Linux
On Linux, Cursor data is typically stored in:
~/.config/CursorThe SDK will automatically detect this location.
Windows
On Windows, Cursor data is typically stored in:
%APPDATA%\CursorThe SDK will automatically detect this location.
Custom Storage Path
If Cursor is installed in a non-standard location, you can specify a custom path:
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:
- Ensure Cursor IDE is installed
- Run Cursor at least once to create the data directory
- Specify a custom path using
CustomPathin the configuration
"Permission denied"
This error occurs when the SDK doesn't have permission to read Cursor's data. Solutions:
- Run your program with appropriate permissions
- Check file permissions on the Cursor data directory
- 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:
- Close Cursor IDE before running your program
- The SDK opens databases in read-only mode, but some operations may still conflict
- Wait a moment and try again
Updating
To update to the latest version:
go get -u github.com/vibe-coding-labs/go-cursor-sdkVersion 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
- Getting Started - Start using the SDK
- Configuration - Learn about configuration options
- Examples - See practical examples