Documentation
¶
Overview ¶
Package config handles configuration loading, writing, and scope detection.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContractPath ¶
ContractPath replaces home directory with ~.
func DetectGitRoot ¶ added in v0.7.1
func DetectGitRoot() string
DetectGitRoot returns the git root for cwd, or empty when cwd is not in a git repo.
func DetectLocalPath ¶
func DetectLocalPath() string
DetectLocalPath finds the local config path by searching from cwd to git root.
Types ¶
type CacheConfig ¶
type CacheConfig struct {
Path string `toml:"path"`
}
CacheConfig defines the cache settings.
type Config ¶
type Config struct {
Cache CacheConfig `toml:"cache"`
Targets map[string]Target `toml:"targets"`
Repos map[string]RepoInfo `toml:"repos"`
}
Config represents the main configuration structure.
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader handles configuration loading with scope detection.
func (*Loader) GlobalPath ¶
GlobalPath returns the global config file path.
func (*Loader) LoadAllRepos ¶
func (l *Loader) LoadAllRepos() (map[string]RepoInfo, CacheConfig, error)
LoadAllRepos loads repos from both global and local configs. This is needed for skill discovery since repos are cached globally.
type RepoInfo ¶
type RepoInfo struct {
URL string `toml:"url"`
Branch string `toml:"branch"`
Updated string `toml:"updated"`
Alias string `toml:"alias"`
}
RepoInfo tracks a cached repository.
type Scope ¶
type Scope int
Scope represents the config scope.
type Target ¶
type Target struct {
Name string `toml:"name"`
GlobalPath string `toml:"globalPath"`
GlobalPaths map[string]string `toml:"globalPaths"`
LocalPath string `toml:"localPath"`
Enabled bool `toml:"enabled"`
}
Target defines an agent skill directory target. GlobalPath is used when installing with -s global (global agent). LocalPath is used when installing with -s local (local/project agent).