cursor

package
v0.13.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCachedStdin

func GetCachedStdin() io.Reader

GetCachedStdin returns a reader for the cached stdin data. This allows other parts of the code to read stdin even after ParseWorkspaceDir has consumed it.

func ParseWorkspaceDir

func ParseWorkspaceDir() string

ParseWorkspaceDir attempts to parse workspace directory from Cursor hook stdin. This is used by the install command when running in Cursor hook mode to determine the correct workspace context (since Cursor runs hooks from ~/.cursor). It caches stdin so it can be read multiple times.

func RuleCapabilities added in v0.9.0

func RuleCapabilities() *clients.RuleCapabilities

RuleCapabilities returns the rule capabilities for Cursor

Types

type Client

type Client struct {
	clients.BaseClient
}

Client implements the clients.Client interface for Cursor

func NewClient

func NewClient() *Client

NewClient creates a new Cursor client

func (*Client) EnsureAssetSupport

func (c *Client) EnsureAssetSupport(ctx context.Context, scope *clients.InstallScope) error

EnsureAssetSupport ensures asset infrastructure is set up for the current context. This scans skills from all applicable scopes (global, repo, path) and creates a local .cursor/rules/skills.md file listing all available skills. This must be called even when no new assets are installed, to ensure the local rules file exists (Cursor doesn't load global rules).

func (*Client) GetAssetPath added in v0.5.4

func (c *Client) GetAssetPath(ctx context.Context, name string, assetType asset.Type, scope *clients.InstallScope) (string, error)

GetAssetPath returns an error for Cursor (not yet supported)

func (*Client) GetBootstrapOptions added in v0.9.2

func (c *Client) GetBootstrapOptions(ctx context.Context) []bootstrap.Option

GetBootstrapOptions returns bootstrap options for Cursor. Uses shared options that apply to all clients.

func (*Client) GetBootstrapPath added in v0.12.0

func (c *Client) GetBootstrapPath() string

GetBootstrapPath returns the path to Cursor's hooks file.

func (*Client) GetVersion

func (c *Client) GetVersion() string

GetVersion returns the Cursor version

func (*Client) InstallAssets

func (c *Client) InstallAssets(ctx context.Context, req clients.InstallRequest) (clients.InstallResponse, error)

InstallAssets installs assets to Cursor using client-specific handlers

func (*Client) InstallBootstrap added in v0.6.0

func (c *Client) InstallBootstrap(ctx context.Context, opts []bootstrap.Option) error

InstallBootstrap installs Cursor infrastructure (hooks and MCP servers). Only installs options that are present in the opts slice.

func (*Client) IsInstalled

func (c *Client) IsInstalled() bool

IsInstalled checks if Cursor is installed by checking for .cursor directory

func (*Client) ListAssets

func (c *Client) ListAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledSkill, error)

ListAssets returns all installed skills for a given scope

func (*Client) ReadSkill

func (c *Client) ReadSkill(ctx context.Context, name string, scope *clients.InstallScope) (*clients.SkillContent, error)

ReadSkill reads the content of a specific skill by name

func (*Client) RuleCapabilities added in v0.9.0

func (c *Client) RuleCapabilities() *clients.RuleCapabilities

RuleCapabilities returns Cursor's rule capabilities

func (*Client) ScanInstalledAssets added in v0.5.4

func (c *Client) ScanInstalledAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledAsset, error)

ScanInstalledAssets returns an empty list for Cursor (not yet supported)

func (*Client) ShouldInstall

func (c *Client) ShouldInstall(ctx context.Context) (bool, error)

ShouldInstall checks if installation should proceed based on conversation tracking. Cursor fires beforeSubmitPrompt on every prompt, so we track conversation IDs to only run install once per conversation.

func (*Client) UninstallAssets

func (c *Client) UninstallAssets(ctx context.Context, req clients.UninstallRequest) (clients.UninstallResponse, error)

UninstallAssets removes assets from Cursor

func (*Client) UninstallBootstrap added in v0.6.0

func (c *Client) UninstallBootstrap(ctx context.Context, opts []bootstrap.Option) error

UninstallBootstrap removes Cursor infrastructure (hooks and MCP servers). Only uninstalls options that are present in the opts slice.

func (*Client) VerifyAssets

func (c *Client) VerifyAssets(ctx context.Context, assets []*lockfile.Asset, scope *clients.InstallScope) []clients.VerifyResult

VerifyAssets checks if assets are actually installed on the filesystem

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL