copilot

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CopilotInitMountPath is where the Copilot staging directory is mounted.
	CopilotInitMountPath = "/moat/copilot-init"

	// ContextFileName is loaded through COPILOT_CUSTOM_INSTRUCTIONS_DIRS so it
	// augments repository instructions without writing into /workspace.
	ContextFileName = "moat-context.instructions.md"
)

Variables

This section is empty.

Functions

func DefaultDependencies

func DefaultDependencies() []string

func GetCredentialName

func GetCredentialName() string

func MergeSettings

func MergeSettings(opts MergeOpts) ([]byte, error)

MergeSettings builds the container settings.json by: 1. Reading COPILOT_HOME/settings.json or ~/.copilot/settings.json (host defaults) 2. Reading <MOAT_HOME>/copilot/settings.json (moat user overrides) 3. Filtering to the allowlist 4. Stripping settings overridden by moat.yaml/CLI flags

Returns nil, nil when no settings need to be written.

func NetworkHosts

func NetworkHosts() []string

func ValidateGitHubToken

func ValidateGitHubToken(ctx context.Context, token string) error

ValidateGitHubToken verifies that a GitHub token can authenticate Copilot CLI. It is intentionally separate from moat grant github, which remains a general GitHub credential setup command and accepts tokens that do not need Copilot.

Types

type MergeOpts

type MergeOpts struct {
	ModelOverride   string
	ContextOverride string
	EffortOverride  string
}

MergeOpts provides override values that take precedence over settings.json. These correspond to CLI flags or moat.yaml copilot.* fields that are passed as --flags to the Copilot CLI (which naturally override settings.json).

type Provider

type Provider struct{}

Provider implements provider.CredentialProvider and provider.AgentProvider for GitHub Copilot CLI.

func (*Provider) Cleanup

func (p *Provider) Cleanup(cleanupPath string)

Cleanup is a no-op — staging-directory cleanup is handled by PrepareContainer.

func (*Provider) ConfigureProxy

func (p *Provider) ConfigureProxy(proxy provider.ProxyConfigurer, cred *provider.Credential)

ConfigureProxy sets up Copilot credential injection using a GitHub token.

func (*Provider) ContainerEnv

func (p *Provider) ContainerEnv(cred *provider.Credential) []string

ContainerEnv returns Copilot auth placeholders. The github grant supplies GH_TOKEN and git prompt behavior; Copilot only needs its preferred env var.

func (*Provider) ContainerMounts

func (p *Provider) ContainerMounts(cred *provider.Credential, containerHome string) ([]provider.MountConfig, string, error)

ContainerMounts returns none — Copilot uses the staging-directory approach.

func (*Provider) Grant

func (p *Provider) Grant(ctx context.Context) (*provider.Credential, error)

Grant intentionally does not acquire a separate credential. Copilot CLI uses the github grant so there is one GitHub token to rotate and audit.

func (*Provider) ImpliedDependencies

func (p *Provider) ImpliedDependencies() []string

ImpliedDependencies returns dependencies useful for Copilot's GitHub workflow.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider identifier.

func (*Provider) PrepareContainer

func (p *Provider) PrepareContainer(ctx context.Context, opts provider.PrepareOpts) (*provider.ContainerConfig, error)

PrepareContainer stages Copilot config and runtime context.

func (*Provider) RegisterCLI

func (p *Provider) RegisterCLI(root *cobra.Command)

Jump to

Keyboard shortcuts

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