cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inspect

func Inspect(args []string)

Inspect shows detailed information about a skill.

func Install

func Install(args []string)

Install downloads and installs a skill locally.

func Installed

func Installed(args []string)

Installed lists locally installed skills.

func List

func List(args []string)

List shows skills from the registry.

func Login

func Login(args []string)

Login prompts for registry URL and token, verifies, and saves config.

func PrintUsage

func PrintUsage()

PrintUsage prints CLI usage help.

func Publish

func Publish(args []string)

Publish publishes a skill from a local directory.

func ReadDirFiles

func ReadDirFiles(dirPath string) (map[string][]byte, error)

ReadDirFiles reads all files from a directory path, returning a map of relative path -> content.

func SaveConfig

func SaveConfig(cfg *CLIConfig) error
func Search(args []string)

Search searches for skills by query.

func SkillsDir

func SkillsDir(cfg *CLIConfig) string

SkillsDir returns the directory where skills are installed. Reads from the loaded config; falls back to ~/.skillhub/skills.

func Uninstall

func Uninstall(args []string)

Uninstall removes a locally installed skill.

func Update

func Update(args []string)

Update checks for and downloads newer versions of installed skills.

func WhoAmI

func WhoAmI(args []string)

WhoAmI shows the currently authenticated user.

Types

type CLIConfig

type CLIConfig struct {
	Registry  string `yaml:"registry"`
	Token     string `yaml:"token"`
	SkillsDir string `yaml:"skills_dir,omitempty"`
}

func LoadConfig

func LoadConfig() (*CLIConfig, error)

type Client

type Client struct {
	BaseURL string
	Token   string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg *CLIConfig) *Client

func NewClientFromConfig

func NewClientFromConfig() (*Client, error)

func (*Client) Download

func (c *Client) Download(slug, version string) (io.ReadCloser, error)

Download calls GET /api/v1/download and returns the response body (ZIP)

func (*Client) GetSkill

func (c *Client) GetSkill(slug string) (map[string]interface{}, error)

GetSkill calls GET /api/v1/skills/:slug

func (*Client) GetVersions

func (c *Client) GetVersions(slug string) (map[string]interface{}, error)

GetVersions calls GET /api/v1/skills/:slug/versions

func (*Client) ListSkills

func (c *Client) ListSkills(sort string, limit int) (map[string]interface{}, error)

ListSkills calls GET /api/v1/skills

func (*Client) Publish

func (c *Client) Publish(slug, version, summary, tags, changelog string, files map[string][]byte) (map[string]interface{}, error)

Publish calls POST /api/v1/skills with multipart form

func (*Client) Search

func (c *Client) Search(query string) (map[string]interface{}, error)

Search calls GET /api/v1/search?q=...

func (*Client) WhoAmI

func (c *Client) WhoAmI() (map[string]interface{}, error)

WhoAmI calls GET /api/v1/whoami

Jump to

Keyboard shortcuts

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