setup

package
v0.0.11 Latest Latest
Warning

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

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

Documentation

Overview

Package setup installs what Jade can use but does not ship — language servers today, plugins later — behind `jade-mcp install`.

Nothing runs without being shown first: every component lists the exact command it would run, a menu asks which to install and confirms once, and a component with no installer on the machine gets manual instructions instead of a guess.

Index

Constants

This section is empty.

Variables

View Source
var ErrInstallFailed = errors.New("some installs failed")

ErrInstallFailed reports that at least one installer failed.

Functions

This section is empty.

Types

type Component

type Component struct {
	// Key selects it on the command line: go, java, scala…
	Key string
	// Kind groups the menu. Plugins will be a second kind.
	Kind string
	Name string
	// For is who it serves, as the menu shows it.
	For string
	// Languages are the Jade language identifiers it provides a server for.
	Languages []string
	// Detect reports where it is installed.
	Detect func() (string, bool)
	// Recipes are tried in order; the first whose Needs is on the machine is
	// the one offered.
	Recipes []Recipe
	// Manual says how to install it by hand when no recipe fits.
	Manual string
	// Note is shown after installing: a prerequisite or an opt-in.
	Note string
}

Component is one thing Jade can install.

func LanguageServers

func LanguageServers() []Component

LanguageServers lists the language servers Jade can use, JVM and Go first.

func (Component) Recipe

func (c Component) Recipe(env Environment) (Recipe, bool)

Recipe returns the first recipe this machine can run.

type Environment

type Environment struct {
	LookPath func(string) (string, error)
	Run      func(command []string, out io.Writer) error
}

Environment is the machine a menu works on, replaceable in tests.

func System

func System() Environment

System is the real machine.

type Menu struct {
	In         io.Reader
	Out        io.Writer
	Env        Environment
	Components []Component
}

Menu lists components and installs the ones picked.

func (m Menu) Install(keys []string, all bool, dryRun bool) error

Install installs the components with the given keys, or every missing one, without asking. dryRun prints the commands instead of running them, so an agent can show them to its user first.

func (m Menu) List()

List prints each component, whether it is installed, and how it would be.

func (m Menu) Run() error

Run lists the components, asks which to install, confirms, and installs.

func (m Menu) Statuses() []Status

Statuses reports every component: where it is installed, or the command that would install it here and the manual way when there is none.

type Recipe

type Recipe struct {
	Needs   string
	Command []string
}

Recipe is one way to install a component.

type Status

type Status struct {
	Key       string   `json:"key"`
	Kind      string   `json:"kind"`
	Name      string   `json:"name"`
	For       string   `json:"for"`
	Installed bool     `json:"installed"`
	Path      string   `json:"path,omitempty"`
	Command   []string `json:"command,omitempty"`
	Manual    string   `json:"manual,omitempty"`
	Note      string   `json:"note,omitempty"`
}

Status is one component's state as an agent reads it from `jade-mcp install --list --json`.

Jump to

Keyboard shortcuts

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