Documentation
¶
Index ¶
- Constants
- func DefaultDependencies() []string
- func GetCredentialName() string
- func MergeSettings(opts MergeOpts) ([]byte, error)
- func NetworkHosts() []string
- func ValidateGitHubToken(ctx context.Context, token string) error
- type MergeOpts
- type Provider
- func (p *Provider) Cleanup(cleanupPath string)
- func (p *Provider) ConfigureProxy(proxy provider.ProxyConfigurer, cred *provider.Credential)
- func (p *Provider) ContainerEnv(cred *provider.Credential) []string
- func (p *Provider) ContainerMounts(cred *provider.Credential, containerHome string) ([]provider.MountConfig, string, error)
- func (p *Provider) Grant(ctx context.Context) (*provider.Credential, error)
- func (p *Provider) ImpliedDependencies() []string
- func (p *Provider) Name() string
- func (p *Provider) PrepareContainer(ctx context.Context, opts provider.PrepareOpts) (*provider.ContainerConfig, error)
- func (p *Provider) RegisterCLI(root *cobra.Command)
Constants ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
ImpliedDependencies returns dependencies useful for Copilot's GitHub workflow.
func (*Provider) PrepareContainer ¶
func (p *Provider) PrepareContainer(ctx context.Context, opts provider.PrepareOpts) (*provider.ContainerConfig, error)
PrepareContainer stages Copilot config and runtime context.