config

package
v0.1.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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

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"`
	Skills     []string    `yaml:"skills,omitempty"`      // Legacy: simple list of skill names
	SkillsInfo []SkillInfo `yaml:"skills_info,omitempty"` // New: skills with metadata
	Sources    []Source    `yaml:"sources,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) RemoveSkill

func (c *Config) RemoveSkill(skillName string)

RemoveSkill removes a skill from the configuration

func (*Config) Save

func (c *Config) Save() error

Save saves the configuration to ask.yaml

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

type Source

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

Source represents a skill source

Jump to

Keyboard shortcuts

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