Documentation
¶
Index ¶
- func RuleCapabilities() *clients.RuleCapabilities
- type Client
- func (c *Client) EnsureAssetSupport(ctx context.Context, scope *clients.InstallScope) error
- func (c *Client) GetAssetPath(ctx context.Context, name string, assetType asset.Type, ...) (string, error)
- func (c *Client) GetBootstrapOptions(ctx context.Context) []bootstrap.Option
- func (c *Client) GetBootstrapPath() string
- func (c *Client) GetVersion() string
- func (c *Client) InstallAssets(ctx context.Context, req clients.InstallRequest) (clients.InstallResponse, error)
- func (c *Client) InstallBootstrap(ctx context.Context, opts []bootstrap.Option) 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) RuleCapabilities() *clients.RuleCapabilities
- func (c *Client) ScanInstalledAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledAsset, 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) UninstallBootstrap(ctx context.Context, opts []bootstrap.Option) error
- func (c *Client) VerifyAssets(ctx context.Context, assets []*lockfile.Asset, scope *clients.InstallScope) []clients.VerifyResult
- type CopilotHookEntry
- type CopilotHooksConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RuleCapabilities ¶
func RuleCapabilities() *clients.RuleCapabilities
RuleCapabilities returns the rule capabilities for GitHub Copilot
Types ¶
type Client ¶
type Client struct {
clients.BaseClient
}
Client implements the clients.Client interface for GitHub Copilot
func (*Client) EnsureAssetSupport ¶
EnsureAssetSupport is a no-op for GitHub Copilot. Copilot discovers skills natively from the skills directory.
func (*Client) GetAssetPath ¶
func (c *Client) GetAssetPath(ctx context.Context, name string, assetType asset.Type, scope *clients.InstallScope) (string, error)
GetAssetPath returns the filesystem path for an asset
func (*Client) GetBootstrapOptions ¶
GetBootstrapOptions returns bootstrap options for GitHub Copilot. Uses shared options that apply to all clients.
func (*Client) GetBootstrapPath ¶ added in v0.12.0
GetBootstrapPath returns the path to Copilot's hooks file. For Copilot, this is workspace-level: .github/hooks/sx.json
func (*Client) GetVersion ¶
GetVersion returns the GitHub Copilot version. It first tries the CLI (`copilot version`), then falls back to VS Code extension version.
func (*Client) InstallAssets ¶
func (c *Client) InstallAssets(ctx context.Context, req clients.InstallRequest) (clients.InstallResponse, error)
InstallAssets installs assets to GitHub Copilot using client-specific handlers
func (*Client) InstallBootstrap ¶
InstallBootstrap installs GitHub Copilot infrastructure (hooks and MCP servers). Only installs options that are present in the opts slice.
func (*Client) IsInstalled ¶
IsInstalled checks if GitHub Copilot is installed by looking for known Copilot directories. This prevents sx from creating .copilot directories for users who don't use Copilot. Note: Copilot spans many editors (VS Code, JetBrains, Neovim, CLI), so this is a best-effort check. Users can also control targeting via enabledClients configuration.
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 ¶
func (c *Client) RuleCapabilities() *clients.RuleCapabilities
RuleCapabilities returns Copilot's rule capabilities
func (*Client) ScanInstalledAssets ¶
func (c *Client) ScanInstalledAssets(ctx context.Context, scope *clients.InstallScope) ([]clients.InstalledAsset, error)
ScanInstalledAssets returns an empty list (not yet supported)
func (*Client) ShouldInstall ¶
ShouldInstall always returns true for GitHub Copilot. Copilot has a SessionStart hook that fires once per session, so no deduplication is needed (unlike Cursor's beforeSubmitPrompt which fires on every prompt).
func (*Client) UninstallAssets ¶
func (c *Client) UninstallAssets(ctx context.Context, req clients.UninstallRequest) (clients.UninstallResponse, error)
UninstallAssets removes assets from GitHub Copilot
func (*Client) UninstallBootstrap ¶
UninstallBootstrap removes GitHub Copilot 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
type CopilotHookEntry ¶ added in v0.11.1
type CopilotHookEntry struct {
Type string `json:"type"`
Bash string `json:"bash,omitempty"`
Powershell string `json:"powershell,omitempty"`
Cwd string `json:"cwd,omitempty"`
TimeoutSec int `json:"timeoutSec,omitempty"`
}
CopilotHookEntry represents a single hook entry for Copilot CLI
type CopilotHooksConfig ¶ added in v0.11.1
type CopilotHooksConfig struct {
Version int `json:"version"`
Hooks map[string][]CopilotHookEntry `json:"hooks"`
}
CopilotHooksConfig represents the structure of Copilot CLI sx.json