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

bootstrap

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package bootstrap wires awp into the agent harnesses installed on a machine, so the next session of each already knows how to message other agents. Each harness gets what it supports:

Claude Code   the whole plugin: skill, MCP server and hooks
Codex         skill and MCP server
Cursor        skill, MCP server and hooks
Gemini CLI    skill, MCP server and hooks
Copilot CLI   skill and MCP server
grok          skill and MCP server
pi            skill (pi has no MCP)

Everything bootstrap writes is marked as awp's own (a plugin or skill named awp, hook commands running `awp hook`), so running it again replaces rather than duplicates, and uninstalling removes only that.

Index

Constants

This section is empty.

Variables

View Source
var Harnesses = []*Harness{
	{
		ID: "claude", Name: "Claude Code", Bins: []string{"claude"}, Dir: ".claude",
		MCP: true, Hooks: true,
		Gets: "plugin: skill, MCP server, hooks",
		// contains filtered or unexported fields
	},
	{
		ID: "opencode", Name: "opencode", Bins: []string{"opencode"}, Dir: ".config/opencode",
		MCP: true, Hooks: true,
		Gets: "skill, MCP server, plugin",
		// contains filtered or unexported fields
	},
	{
		ID: "codex", Name: "Codex", Bins: []string{"codex"}, Dir: ".codex",
		MCP: true, Hooks: false,
		Gets: "skill, MCP server",
		// contains filtered or unexported fields
	},
	{
		ID: "cursor", Name: "Cursor", Bins: []string{"cursor-agent", "cursor"}, Dir: ".cursor",
		MCP: true, Hooks: true,
		Gets: "skill, MCP server, hooks",
		// contains filtered or unexported fields
	},
	{
		ID: "gemini", Name: "Gemini CLI", Bins: []string{"gemini"}, Dir: ".gemini",
		MCP: true, Hooks: true,
		Gets: "skill, MCP server, hooks",
		// contains filtered or unexported fields
	},
	{
		ID: "copilot", Name: "GitHub Copilot CLI", Bins: []string{"copilot"}, Dir: ".copilot",
		MCP: true, Hooks: false,
		Gets: "skill, MCP server",
		// contains filtered or unexported fields
	},
	{
		ID: "grok", Name: "grok", Bins: []string{"grok"}, Dir: ".grok",
		MCP: true, Hooks: false,
		Gets: "skill, MCP server",
		// contains filtered or unexported fields
	},
	{
		ID: "pi", Name: "pi", Bins: []string{"pi"}, Dir: ".pi",
		MCP: false, Hooks: false,
		Gets: "skill",
		// contains filtered or unexported fields
	},
}

Harnesses lists every harness bootstrap supports, in display order.

Functions

func IDs

func IDs() []string

IDs lists the supported harness IDs.

Types

type Env

type Env struct {
	Home       string                                                    // the user's home directory
	ConfigHome string                                                    // $XDG_CONFIG_HOME; empty means Home/.config
	Bin        string                                                    // absolute path of the awp binary to wire in
	LookPath   func(file string) (string, error)                         // finds harness executables
	Run        func(ctx context.Context, argv ...string) (string, error) // runs harness CLIs
	DryRun     bool
}

Env is everything bootstrap touches, so that tests can fake it.

func NewEnv

func NewEnv(home, bin string) *Env

NewEnv returns the real environment for home, wiring in bin.

type Found

type Found struct {
	*Harness
	Exe     string // its executable, if on PATH
	Version string
	Status  Status
}

Found is a harness detected on this machine.

func Detect

func Detect(ctx context.Context, e *Env) []Found

Detect finds the harnesses present on this machine: those with an executable on PATH or a config directory in Home. Versions are read in parallel, since some harness CLIs take a second to start.

type Harness

type Harness struct {
	ID   string   // short name, used with --harness
	Name string   // display name
	Bins []string // executables that indicate it is installed
	Dir  string   // config directory, relative to Home
	Gets string   // what bootstrap installs, for display

	MCP   bool // gets the MCP server
	Hooks bool // gets hooks (or a plugin doing their job)
	// contains filtered or unexported fields
}

Harness is one agent harness bootstrap knows how to set up.

func Lookup

func Lookup(id string) *Harness

Lookup returns the harness with the given ID, or nil.

func (*Harness) Install

func (h *Harness) Install(ctx context.Context, e *Env) ([]string, error)

Install sets awp up in the harness and describes what it did.

func (*Harness) Status

func (h *Harness) Status(e *Env) Status

Status reports what is installed.

func (*Harness) Uninstall

func (h *Harness) Uninstall(ctx context.Context, e *Env) ([]string, error)

Uninstall removes what Install added and describes what it did.

type Status

type Status struct {
	Skill bool
	MCP   bool
	Hooks bool
}

Status is what awp has installed into a harness.

func (Status) Any

func (s Status) Any() bool

Any reports whether anything is installed.

Jump to

Keyboard shortcuts

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