mise

package
v0.0.21 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateCommand

func ActivateCommand(configDir string, tools map[string]Tool) string

ActivateCommand returns the shell preamble that:

  1. Writes the profile's tools into mise's global config at configDir (ephemeral — lives in the container's own filesystem, NOT the shared volume). configDir must match MISE_CONFIG_DIR set in the container env, otherwise mise will not read the written config.
  2. Activates mise so shims are on PATH.

When the user cd's into the workspace, mise's directory walk picks up any project-local .tool-versions / mise.toml and overrides these defaults. The config is base64-encoded so unvalidated tool names, versions, and digests cannot escape into the shell or the TOML.

func BackendRuntimesCommand

func BackendRuntimesCommand(configDir string, tools map[string]Tool) string

BackendRuntimesCommand returns a shell snippet that ensures the runtime for mise backends is present before `mise install` runs. The npm backend needs `node` and the pipx backend needs `uv` (or `pipx`) on PATH during install lifecycle scripts; without them aube fails with exit 127 (command not found).

Tools whose backend is encoded in their name (npm:*, pipx:*) set the flag directly. Unprefixed tools resolve their backend through mise's registry (`mise registry <tool>`); only the primary (first) backend counts, so aqua-primary tools like codex or biome never trigger a node install. The snippet appends the runtime to the already-written [tools] config when it is missing.

Returns "" when no runtime is needed or already present.

func NeedsEmbeddedPlugin

func NeedsEmbeddedPlugin(tools map[string]Tool) bool

NeedsEmbeddedPlugin reports whether tools reference a tool backed by an embedded mise plugin (currently the generic appimage backend). When true, PluginInstallCommand must run before `mise install` so the prefixed tools can resolve.

func PluginInstallCommand

func PluginInstallCommand() string

PluginInstallCommand returns a shell command that installs the embedded mise plugins into the shared mise data dir, so backend tools such as appimage:... resolve during a subsequent `mise install`. Files are base64-encoded to survive the shell round-trip unchanged.

Files land in a content-versioned sibling directory and the pointer `plugins/appimage` is a symlink repointed only after every file (the marker last) has been written, so mise — which follows the symlink — never sees a partially written plugin dir. A run whose marker and pointer already match the embedded content does nothing.

Types

type ProgressWriter

type ProgressWriter interface {
	WriteProgress(line string)
}

type Tool

type Tool struct {
	Version      string
	SHA256       string
	SHA256ByArch map[string]string
}

Tool is a mise tool as seen by the runtime: the version plus optional verification metadata. SHA256 is a universal digest; SHA256ByArch keys are the schema's arch set ("amd64", "aarch64"), which the appimage backend maps its RUNTIME.archType to. At most one form is set.

Jump to

Keyboard shortcuts

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