github_copilot

package
v0.12.7 Latest Latest
Warning

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

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

Documentation

Index

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 NewClient

func NewClient() *Client

NewClient creates a new GitHub Copilot client

func (*Client) EnsureAssetSupport

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

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

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

GetBootstrapOptions returns bootstrap options for GitHub Copilot. 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 Copilot's hooks file. For Copilot, this is workspace-level: .github/hooks/sx.json

func (*Client) GetVersion

func (c *Client) GetVersion() string

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

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

InstallBootstrap installs GitHub Copilot 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 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

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

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

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

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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