config

package
v0.0.0-...-cc74e3f Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthAuto        = "auto"         // SDK auto-manages CLI process, uses stored credentials
	AuthCLIUrl      = "cli-url"      // Connect to external headless CLI server
	AuthGitHubToken = "github-token" // Explicit GitHub token, SDK starts CLI
	AuthEnvVar      = "env-var"      // Use environment variables (COPILOT_GITHUB_TOKEN etc.)
	AuthBYOK        = "byok"         // Bring your own API key (no Copilot subscription)
)

AuthMethod identifies how the SDK connects and authenticates.

Variables

This section is empty.

Functions

func ConfigDir

func ConfigDir() string

ConfigDir returns ~/.config/toskill/

func ConfigFilePath

func ConfigFilePath() string

ConfigFilePath returns the config file path.

func LoadConfigFile

func LoadConfigFile() (map[string]string, error)

LoadConfigFile loads key=value pairs from the config file.

func SaveConfigValue

func SaveConfigValue(key, value string) error

SaveConfigValue sets a key=value in the config file.

Types

type Config

type Config struct {
	CopilotURL   string // Copilot CLI server address (for AuthCLIUrl)
	OutputDir    string // Base output directory (articles/, knowledge-bases/, skills/)
	Model        string // LLM model to use (default for all phases)
	ExtractModel string // Model override for extraction phase
	CurateModel  string // Model override for curation phase
	BuildModel   string // Model override for skill building phase
	Verbose      bool   // Enable verbose output

	// Auth
	AuthMethod         string                  // One of Auth* constants (default: AuthAuto)
	GitHubCopilotToken string                  // For AuthGitHubToken method
	BYOKProvider       *copilot.ProviderConfig // For AuthBYOK method

	// Skill mode
	SkillMode   string // "new" or "evolve" (default: "new")
	EvolveSkill string // Name of existing skill to evolve (for SkillMode "evolve")

	// Display
	RedactPaths bool // Replace $HOME with ~ in all output paths
}

Config holds shared configuration for all agents.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns a Config with sensible defaults. It loads from config file first, then env vars override.

func (Config) ApplyBYOK

func (c Config) ApplyBYOK(sc *copilot.SessionConfig)

ApplyBYOK sets the BYOK provider on a SessionConfig if configured.

func (Config) ArticlesDir

func (c Config) ArticlesDir() string

ArticlesDir returns the articles subdirectory.

func (Config) EnsureDirs

func (c Config) EnsureDirs() error

EnsureDirs creates all output subdirectories.

func (Config) KnowledgeBasesDir

func (c Config) KnowledgeBasesDir() string

KnowledgeBasesDir returns the knowledge-bases subdirectory.

func (Config) ModelFor

func (c Config) ModelFor(phase string) string

ModelFor returns the model to use for a given phase. Falls back to the default Model if no per-phase override is set.

func (Config) Redact

func (c Config) Redact(path string) string

Redact replaces the user's home directory with ~ when RedactPaths is enabled.

func (Config) SkillsDir

func (c Config) SkillsDir() string

SkillsDir returns the skills subdirectory.

Jump to

Keyboard shortcuts

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