This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
mise run buildormise run b- Build the project with cargotarget/debug/mise- Run the built binary directlymise run testormise run t- Run all tests (unit + e2e)mise run test:unit- Run unit tests onlymise run test:e2e- Run end-to-end tests onlymise run snapshots- Update test snapshots withcargo insta
- Use
MISE_DEBUG=1orMISE_TRACE=1environment variables to enable debug output (notRUST_LOG)
mise run lint- Run all linting tasksmise run lint-fix- Run linting and automatically fix issuesmise run format- Format code (part of CI task)mise run ci- Run format, build, and testmise run test:e2e [test_filename]...- Run specific e2e tests (use this instead of executing test files directly)mise --cd crates/vfox run test- Run tests for the vfox cratemise --cd crates/vfox run lint- Run linting for the vfox cratemise --cd crates/vfox run lint-fix- Run linting and fix issues for the vfox cratemise task ls- List all available tasks
mise run render- Generate all documentation and completionsmise run render:usage- Generate CLI usage documentationmise run render:completions- Generate shell completionsmise run docs- Start documentation dev servermise run docs:build- Build documentation
mise run install-dev- Install development version locallymise run clean- Clean cargo build artifacts
Mise is a Rust CLI tool that manages development environments, tools, tasks, and environment variables. The codebase follows a modular architecture:
Core Components:
src/main.rs- Entry point and CLI initializationsrc/cli/- Command-line interface implementation with subcommandssrc/config/- Configuration file parsing and managementsrc/backend/- Tool backend implementations (asdf, vfox, cargo, npm, etc.)src/toolset/- Tool version management and installation logicsrc/task/- Task execution systemsrc/plugins/- Plugin system for extending tool support
Key Backend Systems:
src/backend/asdf.rs- ASDF plugin compatibilitysrc/backend/vfox.rs- VersionFox plugin systemsrc/backend/cargo.rs- Rust Cargo tool backendsrc/backend/npm.rs- Node.js/npm tool backendsrc/backend/github.rs- GitHub releases backendsrc/backend/aqua.rs- Aqua tool registry integration
Core Tools (Built-in):
src/plugins/core/- Built-in tool implementations (Node, Python, Go, Ruby, etc.)
Configuration System:
mise.tomlfiles for project configuration.tool-versionsfiles for ASDF compatibility- Environment variable management and templating
- Task definition and execution
- Backend Architecture: Tools are implemented through a unified backend interface, allowing multiple sources (ASDF plugins, vfox plugins, cargo, npm, etc.)
- Toolset Management: The
Toolsetmanages collections of tool versions and their installation state - Configuration Layering: Config files are loaded hierarchically from system → global → local with environment-specific overrides
- Task System: Tasks can be defined in TOML files with dependencies, environment variables, and multiple execution modes
mise.toml- Main configuration file formatsettings.toml- Global settings definitions (generates code/docs)registry/- Tool registry mappingstasks.toml- Project task definitions
- Unit tests within source files
- E2E tests in
e2e/directory organized by feature area (e.g.,e2e/cli/,e2e/backend/) - E2E tests are bash scripts using assertion helpers from
e2e/assert.sh(e.g.,assert,assert_contains,assert_fail) - Snapshot tests using
instacrate for CLI output verification - Windows-specific tests in
e2e-win/
- Rust project using Cargo with workspace for
crates/vfox - Custom build script in
build.rsfor generating metadata - Multiple build profiles including
releaseandserious(with LTO) - Cross-compilation support via
Cross.toml
All commit messages and PR titles MUST follow conventional commit format:
Format: <type>(<scope>): <description>
Types:
feat:- New featuresfix:- Bug fixes that affect the CLI behavior (not CI, docs, or infrastructure)refactor:- Code refactoringdocs:- Documentation changesstyle:- Code style/formatting (no logic changes)perf:- Performance improvementstest:- Testing changeschore:- Maintenance tasks, releases, dependency updates, CI/infrastructure changessecurity:- Security-related changesregistry:- Any changes toregistry/(no scope needed, use for both new tools and fixes)
Scopes:
- For command-specific changes, use the command name:
install,activate,use,exec, etc. - For subsystem changes:
config,backend,env,task,vfox,python,github,release,completions,http,schema,doctor,shim,core,deps,ci - Use
task(notrun) for task-related changes, even if the code lives insrc/cli/run.rsorsrc/cmd.rs
Description Style:
- Use lowercase after the colon
- Use imperative mood ("add feature" not "added feature")
- Keep it concise but descriptive
Examples:
fix(install): resolve version mismatch for previously installed toolsfeat(activate): add fish shell supportfeat(vfox): add semver Lua module for version sortingfeat(env): add environment caching with module cacheability supportdocs(contributing): update hk usageschore: release 2026.1.6chore(ci): add FORGEJO_TOKEN for API authenticationregistry: add miller
- Run
hk install --miseonce to set up pre-commit hooks (runshk fixautomatically on commit) - Run
mise run lint-fixandgit addany lint fixes before committing - Use
mise run test:e2e [test_filename]...for running specific e2e tests - Never run e2e tests by executing them directly - always use the mise task
When implementing new tool backends, follow the pattern in src/backend/mod.rs. Each backend must implement the Backend trait with methods for listing versions, installing tools, and managing tool metadata.
- Core tools are implemented in
src/plugins/core/ - External plugins use ASDF or vfox compatibility layers
- Plugin metadata is defined in
mise.plugin.tomlfiles
The configuration system supports multiple file formats and environment-specific configs. Changes to settings require updating settings.toml and running mise run render:schema.
- E2E tests are organized by feature area (cli/, config/, backend/, etc.)
- Use snapshot testing for CLI output verification
- Backend-specific tests verify tool installation and version management
- Slow tests (marked with
_slowsuffix) test actual tool compilation/installation
- Windows-specific implementations in files ending with
_windows.rs - Platform-specific tool installation logic in core plugins
- Shim system varies by platform (especially Windows)
- we don't chmod mise e2e tests to be executable
When posting comments on GitHub PRs or discussions, always include a note that the comment was AI-generated (e.g., "This comment was generated by Claude Code.").
When referencing mise documentation URLs, use the correct path structure based on the docs/ directory layout:
- Dev tools & backends:
mise.jdx.dev/dev-tools/backends/<backend>.html(e.g.,mise.jdx.dev/dev-tools/backends/s3.html) - Configuration:
mise.jdx.dev/configuration/... - Tasks:
mise.jdx.dev/tasks/... - Environments:
mise.jdx.dev/environments/... - CLI reference:
mise.jdx.dev/cli/...
Do NOT use shortened paths like mise.jdx.dev/backends/... - always include the full path matching the docs/ directory structure.