Help us shape the future of Go! Take the 2026 Go Developer Survey

skillinstall

package
v0.0.113 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeAuto    = "auto"
	ScopeProject = "project"
	ScopeUser    = "user"

	ActionInstalled = "installed"
	ActionSkipped   = "skipped"
	ActionFailed    = "failed"

	MaxSkillFileBytes int64 = 1 << 20
)

Variables

This section is empty.

Functions

func DigestOSDir

func DigestOSDir(dir string) (string, error)

func DigestSkillDir

func DigestSkillDir(fsys fs.FS, root string) (string, error)

func PrintSummary added in v0.0.91

func PrintSummary(stdout io.Writer, summary Summary)

PrintSummary reports installed, unchanged, modified, and failed skills.

func ValidateSkillDir

func ValidateSkillDir(fsys fs.FS, name string) error

Types

type LockEntry

type LockEntry struct {
	Name      string `yaml:"name"`
	Source    string `yaml:"source"`
	Ref       string `yaml:"ref"`
	Commit    string `yaml:"commit,omitempty"`
	SkillPath string `yaml:"skill_path"`
	Scope     string `yaml:"scope"`
	// Path is relative to the project root, or CODEX_HOME for user scope.
	Path   string `yaml:"path"`
	Digest string `yaml:"digest"`
}

type LockFile

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

type Options

type Options struct {
	Bundle          fs.FS
	WorkingDir      string
	Scope           string
	Force           bool
	IncludeOpSkills bool
}

type SkillResult

type SkillResult struct {
	Name   string
	Action string
	Path   string
	Digest string
	Reason string
	Err    error
}

type SourcesFile

type SourcesFile struct {
	Version int                      `yaml:"version"`
	Sources map[string]TrustedSource `yaml:"sources"`
}

func LoadSources

func LoadSources(fsys fs.FS) (SourcesFile, error)

func (SourcesFile) TrustedGitHubSkill

func (s SourcesFile) TrustedGitHubSkill(owner string, repo string, ref string, skillPath string) (string, bool, error)

func (SourcesFile) TrustedSelector

func (s SourcesFile) TrustedSelector(selector string) (string, bool, error)

func (SourcesFile) Validate

func (s SourcesFile) Validate() error

type Summary

type Summary struct {
	Results []SkillResult
}

func InstallBundled

func InstallBundled(ctx context.Context, opts Options) (Summary, error)

func (Summary) Failed

func (s Summary) Failed() []SkillResult

func (Summary) HasFailures

func (s Summary) HasFailures() bool

func (Summary) Installed

func (s Summary) Installed() []SkillResult

func (Summary) Skipped

func (s Summary) Skipped() []SkillResult

type TrustedSource

type TrustedSource struct {
	Type             string   `yaml:"type"`
	Owner            string   `yaml:"owner"`
	Repo             string   `yaml:"repo"`
	AllowedRefs      []string `yaml:"allowed_refs"`
	AllowedPaths     []string `yaml:"allowed_paths"`
	SelectorPrefixes []string `yaml:"selector_prefixes"`
	InstallByDefault bool     `yaml:"install_by_default"`
	AllowScripts     bool     `yaml:"allow_scripts"`
}

Jump to

Keyboard shortcuts

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