How jdx/mise works
Overview
mise is a Rust CLI for managing development tools, environment variables, project tasks, and machine bootstrap configuration. A project declares these in mise.toml; mise can install or select tools, expose environment variables, and run tasks in the configured environment.
Public entry points
• src/main.rs is the primary CLI binary entry point.
• src/cli contains the public command surface, including exec, run, install, use, activate, task commands, configuration commands, and bootstrap commands.
• crates/mise-shim/src/main.rs provides a separate shim executable for tool command dispatch.
• Shell integration is exposed through commands such as mise activate bash, zsh, or fish. Editors and CI can instead invoke the CLI directly.
Core components
• Command orchestration — src/cli: Maps user-facing commands to tool, environment, task, shell, bootstrap, plugin, and system-management capabilities.
• Configuration and environment — src/config: Implements project/global configuration, settings, TOML files, version-file discovery, environment directives, trust, and provenance areas.
• Tool selection and installation state — src/toolset: Represents tool requests, versions, installation options, tool environments, paths, dependencies, and install state.
• Backend integrations — src/backend: Organizes alternative acquisition and version-resolution backends such as GitHub, HTTP, npm, Cargo, Go, Python, Aqua, UBI, S3, and vfox. The registry directory supplies declarative tool definitions.
• Task execution — src/task: Loads task files, templates, dependencies, workspace relationships, source freshness, scheduling, output handling, and task caching before running external commands.
• Shell environment and command dispatch — src/shell: Produces shell-specific activation/deactivation behavior and environment updates. src/shims.rs and the shim crate support command lookup through managed tool installations.
• Plugin boundary — src/plugins: Hosts core, asdf-style, mise, PackSlip, and vfox plugin integrations. The optional vfox runtime and Lua plugin ecosystem are separately organized under crates/vfox/src and crates/vfox/embedded-plugins.
• Bootstrap and system management — src/system: Covers machine packages, services, files, repositories, accounts, shell setup, secrets, and system-history operations exposed by bootstrap commands.
• Reproducibility and persistence — src/lockfile: Handles lockfile generation and graph data; related runtime caching is organized in src/cache.rs.
Relationships
Project or global configuration is interpreted by src/config and supplies tool, environment, and task inputs to the CLI. Tool requests are represented by src/toolset, resolved through a selected src/backend or plugin, and persisted through lockfile/cache facilities. Tasks consume the resulting tools and environment, then execute application-supplied commands. Shell activation and shims expose those resolved tools to interactive shells.
The main path is repository code; task scripts, external tools, remote registries, package hosts, shells, editors, and CI are external actors. Plugin implementations may be repository-embedded, installed separately, or supplied by users; the plugin directories define the extension boundary rather than making those implementations part of the CLI core.
Main entry points: toolset Toolset · cli Command surface · task Task execution · shell Shell integration
Components 17
mise core
Repository runtime components
- CLI binary
src/main.rs - Command surface · Maps user commands to mise capabilities.
src/cli - Configuration · Interprets project and global configuration and environment directives.
src/config - Toolset · Represents tool requests, environments, paths, dependencies, and installation state.
src/toolset - Backends · Provides alternative acquisition and version-resolution backends.
src/backend - Plugin boundary · Hosts core, asdf-style, mise, PackSlip, and vfox integrations.
src/plugins - Task execution · Loads, schedules, caches, and runs configured tasks.
src/task - Shell integration · Produces shell-specific activation and environment updates.
src/shell - Command shims · Looks up commands through managed tool installations.
src/shims.rs - Shim executable · Separate executable for tool command dispatch.
crates/mise-shim/src/main.rs - System management · Manages machine packages, services, files, repositories, accounts, and shell setup.
src/system - Lockfile · Generates lockfiles and stores dependency graph data.
src/lockfile - Runtime cache
src/cache.rs
External actors
Consumer-supplied code and external systems
- Interactive shells
- Application commands · Commands supplied by projects and run by tasks.
- Tool sources · Remote registries, package hosts, and tool providers.
- Editors and CI
Connections 19
- CLI binary → Command surface: starts
- Configuration → Command surface: supplies inputs
- Command surface → Toolset: orchestrates
- Command surface → Task execution: orchestrates
- Command surface → System management: manages
- Configuration → Task execution: supplies task inputs
- Toolset → Backends: resolves through
- Toolset → Plugin boundary: resolves through
- Backends → Tool sources: acquires from
- Toolset → Lockfile: persists state
- Toolset → Runtime cache: uses cache
- Task execution → Toolset: consumes tools
- Task execution → Shell integration: uses environment
- Task execution → Application commands: executes
- Toolset → Shell integration: exposes resolved tools
- Command shims → Toolset: looks up installations
- Shim executable → Command shims: dispatches through
- Shell integration → Interactive shells: generates activation for
- Editors and CI → Command surface: invokes