Documentation
¶
Index ¶
- Constants
- func AddCopilotCLIMCPServer(copilotDir, name string, serverConfig map[string]any) error
- func AddMCPServer(vscodeDir, name string, serverConfig map[string]any) error
- func RemoveCopilotCLIMCPServer(copilotDir, name string) error
- func RemoveMCPServer(vscodeDir, name string) error
- type AgentHandler
- type CommandHandler
- type Handler
- type MCPHandler
- type RuleHandler
- type SkillHandler
Constants ¶
const ( DirSkills = "skills" DirInstructions = "instructions" DirPrompts = "prompts" DirAgents = "agents" DirMCPServers = "mcp-servers" DirHooks = "hooks" )
Directory names for GitHub Copilot assets
const (
// ConfigDir is the GitHub Copilot configuration directory name (in home dir)
ConfigDir = ".copilot"
)
Configuration directory
const (
FileHooks = "sx.json"
)
File names
Variables ¶
This section is empty.
Functions ¶
func AddCopilotCLIMCPServer ¶ added in v0.11.1
AddCopilotCLIMCPServer adds an MCP server entry to ~/.copilot/mcp-config.json This is the Copilot CLI-specific MCP config location.
func AddMCPServer ¶ added in v0.11.1
AddMCPServer adds an MCP server entry to .vscode/mcp.json This is used by bootstrap to add servers like the sx query MCP.
func RemoveCopilotCLIMCPServer ¶ added in v0.11.1
RemoveCopilotCLIMCPServer removes an MCP server entry from ~/.copilot/mcp-config.json
func RemoveMCPServer ¶ added in v0.11.1
RemoveMCPServer removes an MCP server entry from .vscode/mcp.json
Types ¶
type AgentHandler ¶
type AgentHandler struct {
// contains filtered or unexported fields
}
AgentHandler handles agent asset installation for GitHub Copilot. Agents are written to agents/{name}.agent.md with YAML frontmatter.
func NewAgentHandler ¶
func NewAgentHandler(meta *metadata.Metadata) *AgentHandler
NewAgentHandler creates a new agent handler
func (*AgentHandler) Install ¶
Install writes the agent as an .agent.md file to {targetBase}/agents/
func (*AgentHandler) Remove ¶
func (h *AgentHandler) Remove(ctx context.Context, targetBase string) error
Remove removes the agent file
func (*AgentHandler) VerifyInstalled ¶
func (h *AgentHandler) VerifyInstalled(targetBase string) (bool, string)
VerifyInstalled checks if the agent file exists
type CommandHandler ¶
type CommandHandler struct {
// contains filtered or unexported fields
}
CommandHandler handles command asset installation for GitHub Copilot. Commands are written to prompts/{name}.prompt.md with optional YAML frontmatter.
func NewCommandHandler ¶
func NewCommandHandler(meta *metadata.Metadata) *CommandHandler
NewCommandHandler creates a new command handler
func (*CommandHandler) Install ¶
Install writes the command as a .prompt.md file to {targetBase}/prompts/
func (*CommandHandler) Remove ¶
func (h *CommandHandler) Remove(ctx context.Context, targetBase string) error
Remove removes the prompt file
func (*CommandHandler) VerifyInstalled ¶
func (h *CommandHandler) VerifyInstalled(targetBase string) (bool, string)
VerifyInstalled checks if the prompt file exists
type Handler ¶
type Handler interface {
// Install installs the asset from zip data to the target base directory
Install(ctx context.Context, zipData []byte, targetBase string) error
// Remove removes the asset from the target base directory
Remove(ctx context.Context, targetBase string) error
// VerifyInstalled checks if the asset is properly installed
// Returns (installed bool, message string)
VerifyInstalled(targetBase string) (bool, string)
}
Handler defines the interface for asset type handlers
type MCPHandler ¶
type MCPHandler struct {
// contains filtered or unexported fields
}
MCPHandler handles MCP asset installation for GitHub Copilot (VS Code)
func NewMCPHandler ¶
func NewMCPHandler(meta *metadata.Metadata) *MCPHandler
NewMCPHandler creates a new MCP handler
func (*MCPHandler) Remove ¶
func (h *MCPHandler) Remove(ctx context.Context, targetBase string) error
Remove removes an MCP entry from VS Code
func (*MCPHandler) VerifyInstalled ¶
func (h *MCPHandler) VerifyInstalled(targetBase string) (bool, string)
VerifyInstalled checks if the MCP server is properly installed
type RuleHandler ¶
type RuleHandler struct {
// contains filtered or unexported fields
}
RuleHandler handles rule asset installation for GitHub Copilot. Rules are written to instructions/{name}.instructions.md with YAML frontmatter using Copilot's applyTo field for glob patterns.
func NewRuleHandler ¶
func NewRuleHandler(meta *metadata.Metadata) *RuleHandler
NewRuleHandler creates a new rule handler
func (*RuleHandler) Install ¶
Install writes the rule as an .instructions.md file to {targetBase}/instructions/
func (*RuleHandler) Remove ¶
func (h *RuleHandler) Remove(ctx context.Context, targetBase string) error
Remove removes the instruction file
func (*RuleHandler) VerifyInstalled ¶
func (h *RuleHandler) VerifyInstalled(targetBase string) (bool, string)
VerifyInstalled checks if the instruction file exists
type SkillHandler ¶
type SkillHandler struct {
// contains filtered or unexported fields
}
SkillHandler handles skill asset installation for GitHub Copilot. Skills are extracted to {targetBase}/skills/{name}/
func NewSkillHandler ¶
func NewSkillHandler(meta *metadata.Metadata) *SkillHandler
NewSkillHandler creates a new skill handler
func (*SkillHandler) Remove ¶
func (h *SkillHandler) Remove(ctx context.Context, targetBase string) error
Remove removes a skill from {targetBase}/skills/
func (*SkillHandler) VerifyInstalled ¶
func (h *SkillHandler) VerifyInstalled(targetBase string) (bool, string)
VerifyInstalled checks if the skill is properly installed