tools

package
v1.31.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package tools resolves the pinned versions and download URLs of the host tools lerd installs (composer, fnm, mkcert). tools.yaml is the source of truth: embedded at build time as the offline fallback, and fetched from GitHub before use so a bad pin can be fixed without a binary release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstalledVersion

func InstalledVersion(name string) string

InstalledVersion reports the version of an installed tool: the stamp sidecar while it is trustworthy (not older than the binary, which would mean something else replaced it, e.g. composer self-update), else a version probe. Empty when the binary is missing or undeterminable.

func Names

func Names() []string

Names lists the managed tools in display order.

func WriteStamp

func WriteStamp(name, version string) error

WriteStamp records the installed version of a tool in its sidecar, so status can report it without executing anything.

Types

type Manifest

type Manifest struct {
	Tools map[string]Tool `yaml:"tools"`
}

Manifest is the parsed tools.yaml.

func Load

func Load(ctx context.Context) *Manifest

Load returns the pinned tool manifest: the embedded copy, overlaid with every valid entry of the published tools.yaml when it is reachable.

func (*Manifest) URL

func (m *Manifest) URL(name, goos, goarch string) (string, error)

URL resolves the download URL for the named tool on goos/goarch.

type Tool

type Tool struct {
	Version string            `yaml:"version"`
	URL     string            `yaml:"url"`
	Assets  map[string]string `yaml:"assets"`
}

Tool is one pinned download: a version and an HTTPS URL template in which {version} and {asset} expand. Assets maps GOOS/GOARCH to the release asset name, which may itself contain {version}.

type ToolStatus

type ToolStatus struct {
	Name            string `json:"name"`
	Installed       string `json:"installed,omitempty"`
	Pinned          string `json:"pinned"`
	Present         bool   `json:"present"`
	UpdateAvailable bool   `json:"update_available"`
}

ToolStatus is one row of the tools report shared by the CLI, UI and MCP.

func StatusAll

func StatusAll(ctx context.Context) []ToolStatus

StatusAll compares each installed tool with its pin.

Jump to

Keyboard shortcuts

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