config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultSkillsDir = ".agent/skills"
View Source
const LockFileName = "ask.lock"

Variables

This section is empty.

Functions

func CreateDefaultConfig

func CreateDefaultConfig() error

CreateDefaultConfig creates a new ask.yaml in the current directory

Types

type Config

type Config struct {
	Version    string      `yaml:"version"`
	SkillsDir  string      `yaml:"skills_dir,omitempty"`  // Skills installation directory (default: .agent/skills)
	Skills     []string    `yaml:"skills,omitempty"`      // Legacy: simple list of skill names
	SkillsInfo []SkillInfo `yaml:"skills_info,omitempty"` // New: skills with metadata
	Repos      []Repo      `yaml:"repos,omitempty"`
}

Config represents the structure of ask.yaml

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the current ask.yaml configuration

func (*Config) AddSkill

func (c *Config) AddSkill(skillName string)

AddSkill adds a skill to the configuration if it doesn't exist

func (*Config) AddSkillInfo

func (c *Config) AddSkillInfo(info SkillInfo)

AddSkillInfo adds a skill with metadata to the configuration

func (*Config) GetSkillInfo

func (c *Config) GetSkillInfo(name string) *SkillInfo

GetSkillInfo returns skill info by name

func (*Config) GetSkillsDir added in v0.2.0

func (c *Config) GetSkillsDir() string

GetSkillsDir returns the skills directory, using default if not set

func (*Config) RemoveSkill

func (c *Config) RemoveSkill(skillName string)

RemoveSkill removes a skill from the configuration

func (*Config) RemoveSkillInfo added in v0.2.0

func (c *Config) RemoveSkillInfo(skillName string)

RemoveSkillInfo removes skill metadata from the configuration

func (*Config) Save

func (c *Config) Save() error

Save saves the configuration to ask.yaml

type LockEntry added in v0.2.0

type LockEntry struct {
	Name        string    `yaml:"name"`
	Source      string    `yaml:"source,omitempty"`
	URL         string    `yaml:"url"`
	Commit      string    `yaml:"commit,omitempty"`
	Version     string    `yaml:"version,omitempty"`
	InstalledAt time.Time `yaml:"installed_at"`
}

LockEntry represents a locked skill version

type LockFile added in v0.2.0

type LockFile struct {
	Version int         `yaml:"version"`
	Skills  []LockEntry `yaml:"skills"`
}

LockFile represents the ask.lock file structure

func LoadLockFile added in v0.2.0

func LoadLockFile() (*LockFile, error)

LoadLockFile loads the ask.lock file

func (*LockFile) AddEntry added in v0.2.0

func (l *LockFile) AddEntry(entry LockEntry)

AddEntry adds or updates a lock entry

func (*LockFile) GetEntry added in v0.2.0

func (l *LockFile) GetEntry(name string) *LockEntry

GetEntry gets a lock entry by name

func (*LockFile) RemoveEntry added in v0.2.0

func (l *LockFile) RemoveEntry(name string)

RemoveEntry removes a lock entry by name

func (*LockFile) Save added in v0.2.0

func (l *LockFile) Save() error

Save saves the lock file to disk

type Repo added in v0.2.0

type Repo struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"` // "topic" or "dir"
	URL  string `yaml:"url"`  // GitHub topic or "owner/repo/path"
}

Repo represents a skill repository

type SkillInfo

type SkillInfo struct {
	Name        string `yaml:"name"`
	Description string `yaml:"description,omitempty"`
	URL         string `yaml:"url,omitempty"`
}

SkillInfo represents an installed skill with metadata

Jump to

Keyboard shortcuts

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