Documentation
¶
Index ¶
- func GetCachedStdin() io.Reader
- func ParseWorkspaceDir() string
- type Client
- func (c *Client) EnsureAssetSupport(ctx context.Context, scope *clients.InstallScope) error
- func (c *Client) GetVersion() string
- func (c *Client) InstallAssets(ctx context.Context, req clients.InstallRequest) (clients.InstallResponse, error)
- func (c *Client) InstallHooks(ctx context.Context) error
- func (c *Client) IsInstalled() bool
- func (c *Client) ListAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledSkill, error)
- func (c *Client) ReadSkill(ctx context.Context, name string, scope *clients.InstallScope) (*clients.SkillContent, error)
- func (c *Client) ShouldInstall(ctx context.Context) (bool, error)
- func (c *Client) UninstallAssets(ctx context.Context, req clients.UninstallRequest) (clients.UninstallResponse, error)
- func (c *Client) UninstallHooks(ctx context.Context) error
- func (c *Client) VerifyAssets(ctx context.Context, assets []*lockfile.Asset, scope *clients.InstallScope) []clients.VerifyResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCachedStdin ¶
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.
Types ¶
type Client ¶
type Client struct {
clients.BaseClient
}
Client implements the clients.Client interface for Cursor
func (*Client) EnsureAssetSupport ¶
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) GetVersion ¶
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) InstallHooks ¶
InstallHooks installs Cursor-specific hooks (auto-install on prompt submission).
func (*Client) IsInstalled ¶
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) ShouldInstall ¶
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) UninstallHooks ¶
UninstallHooks removes Cursor-specific hooks (beforeSubmitPrompt).
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