plugins

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const BuiltIn = "kairocode"

BuiltIn is the name of the marketplace KairoCode comes with.

View Source
const ClaudeMarketplaceManifest = ".claude-plugin/marketplace.json"

ClaudeMarketplaceManifest is where a Claude Code marketplace has its catalog.

View Source
const ManifestFile = "kairocode-plugin.json"

ManifestFile is the file KairoCode reads in a plugin's folder.

View Source
const MarketplaceManifest = "kairocode-marketplace.json"

MarketplaceManifest is the file a marketplace has at its top.

Variables

View Source
var NamePattern = regexp.MustCompile(`^[a-zA-Z0-9_-]{1,64}$`)

NamePattern is a name the model's API takes.

Functions

func AvailableText

func AvailableText(install string) string

AvailableText lists the marketplaces' plugins not installed, by marketplace, and how to install one (install: the command's words).

func Catalog

func Catalog() (plugins []CatalogPlugin, markets []MarketInfo, errs []string)

Catalog is every marketplace's plugins, the marketplaces, and why any could not be read.

func ClaudeUnused

func ClaudeUnused(dir string) []string

ClaudeUnused is what of a Claude Code plugin at dir KairoCode does not use: its commands, subagents, hooks, language servers and output styles.

func Commit

func Commit(dir string) string

Commit is the commit an installed plugin is at.

func MarketplacesText

func MarketplacesText() string

MarketplacesText lists the marketplaces.

func PluginsText

func PluginsText(list []api.PluginInfo) string

PluginsText is /plugin's answer.

func RemoveMarketplace

func RemoveMarketplace(name string) error

RemoveMarketplace removes a marketplace the user added. The plugins installed from it stay.

func RemovePlugin

func RemovePlugin(name string) error

RemovePlugin removes an installed plugin; its credentials stay until disconnected.

func UpdateMarketplace

func UpdateMarketplace(ctx context.Context, name string) (before, after string, err error)

UpdateMarketplace brings a git marketplace to its latest commit: the commits before and after.

func UpdatePlugin

func UpdatePlugin(ctx context.Context, name string) (before, after string, err error)

UpdatePlugin brings an installed plugin up to date: one of a marketplace is installed again as the marketplace has it now (a git one brought to its latest commit first); a git one is pulled. The versions before and after.

func UserPluginsDir

func UserPluginsDir() string

UserPluginsDir is the folder of the user's plugins.

Types

type Auth

type Auth struct {
	Type     string `json:"type"` // none, key, oauth
	Keys     []Key  `json:"keys"`
	ClientID string `json:"client_id"` // oauth: a client registered beforehand (else registered dynamically)
}

Auth is what a plugin needs to connect: none, keys (each named, given where the manifest writes {secret:NAME}), or oauth.

type CatalogPlugin

type CatalogPlugin = api.CatalogPlugin

type Installed

type Installed struct {
	Name    string
	From    string // the marketplace, or the URL or folder
	Version string
	Auth    string // none, key, oauth
	// ConnectNow: its marketplace says to ask for its credentials as it
	// is installed.
	ConnectNow bool
}

Installed is a plugin as it was installed.

func InstallPlugin

func InstallPlugin(ctx context.Context, arg string) (Installed, error)

InstallPlugin installs a plugin into the user's: name or name@market of a marketplace, a git URL, or a folder.

type Key

type Key struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

Key is a key a plugin needs, named.

type MCPConfig

type MCPConfig struct {
	Type        string            `json:"type"` // local, remote
	Command     []string          `json:"command"`
	Environment map[string]string `json:"environment"`
	URL         string            `json:"url"`
	Headers     map[string]string `json:"headers"`
	Enabled     *bool             `json:"enabled"`
}

MCPConfig is an MCP server as kairocode.json and a plugin's manifest write it.

type Manifest

type Manifest struct {
	Name        string                `json:"name"`
	Description string                `json:"description"`
	Version     string                `json:"version"`
	MCP         *MCPConfig            `json:"mcp"`
	Auth        Auth                  `json:"auth"`
	Tools       map[string]ToolConfig `json:"tools"` // effects, by the server's tool name (* ends a prefix)
}

Manifest is a plugin's kairocode-plugin.json.

type MarketInfo

type MarketInfo = api.MarketInfo

type MarketPlugin

type MarketPlugin struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
	// Source: ./<path> in the marketplace, or a git URL: then Path, a
	// folder in the repository (else all of it); Ref, a branch or a tag;
	// SHA, the commit (else the ref's latest).
	Source string `json:"source"`
	Path   string `json:"path,omitempty"`
	Ref    string `json:"ref,omitempty"`
	SHA    string `json:"sha,omitempty"`
	// Connect: when its credentials are asked for: install (as it is
	// installed), or use (when it is used; the default).
	Connect string `json:"connect,omitempty"`
	// Unsupported: why it cannot be installed (a Claude Code one's source
	// KairoCode does not take, say).
	Unsupported string `json:"-"`
	// contains filtered or unexported fields
}

MarketPlugin is a plugin of a marketplace.

type Marketplace

type Marketplace struct {
	Name        string         `json:"name"`
	Description string         `json:"description,omitempty"`
	Plugins     []MarketPlugin `json:"plugins"`
	// Where it is: built in, a folder, or a git repository's clone.
	Source  string `json:"-"` // as added ("" when built in)
	Commit  string `json:"-"` // a git one's
	BuiltIn bool   `json:"-"`
	Claude  bool   `json:"-"` // Claude Code's (.claude-plugin/marketplace.json)
	// contains filtered or unexported fields
}

Marketplace is a catalog of plugins.

func AddMarketplace

func AddMarketplace(ctx context.Context, src string) (Marketplace, error)

AddMarketplace adds a marketplace: a folder (read where it is), or a git repository (a URL, or GitHub's owner/repo), cloned and kept at its commit.

func Marketplaces

func Marketplaces() (list []Marketplace, errs []error)

Marketplaces are the marketplaces: the built-in one, then the user's in the order they were added. One that cannot be read is in errs.

type Plugin

type Plugin struct {
	opencode.Plugin
	Manifest Manifest
	Source   string // the manifest's path
	Err      error  // why it could not be read
}

Plugin is a plugin as read.

func Read

func Read(dir string) []Plugin

Read reads dir's plugins.

type Said

type Said struct{ Prefix string }

Said is how the plugin commands tell what they did, the same in each front end but for its command (Prefix: "/plugin", "kairocode plugin").

func (Said) Installed

func (s Said) Installed(got Installed) string

Installed: got is in place.

func (Said) MarketAdded

func (s Said) MarketAdded(m Marketplace) string

MarketAdded: m can be installed from.

func (Said) MarketRemoved

func (s Said) MarketRemoved(name string) string

MarketRemoved: name is gone; what was installed from it is not.

func (Said) MarketUpdated

func (s Said) MarketUpdated(name, before, after string) string

MarketUpdated: name went from before to after.

func (Said) NeedsCredentials

func (s Said) NeedsCredentials(name string) string

NeedsCredentials: name is installed, and is not connected yet.

func (Said) Removed

func (s Said) Removed(name string) string

Removed: name is gone; its credentials are not.

func (Said) Updated

func (s Said) Updated(name, before, after string) string

Updated: name went from before to after.

type ToolConfig

type ToolConfig struct {
	Effect      string          `json:"effect"`
	Description string          `json:"description"`
	Schema      json.RawMessage `json:"schema"`
	Command     []string        `json:"command"`
}

ToolConfig is a custom tool, or the effect of an MCP server's tool, as kairocode.json and a plugin's manifest write it.

Jump to

Keyboard shortcuts

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