├── .cargo └── config.toml ├── .cliffignore ├── .config ├── insta.yaml └── nextest.toml ├── .devcontainer └── devcontainer.json ├── .dockerignore ├── .editorconfig ├── .eslintrc.cjs ├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ └── config.yml ├── actionlint.yaml ├── renovate.json ├── restyled.yml └── workflows │ ├── autofix.yml │ ├── docker.yml │ ├── docs.yml │ ├── hyperfine.yml │ ├── issue-closer.yml │ ├── registry.yml │ ├── registry_comment.yml │ ├── release-fig.yml │ ├── release-plz.yml │ ├── release.yml │ ├── semantic-pr-lint.yml │ ├── test-plugins.yml │ ├── test.yml │ └── winget.yml ├── .gitignore ├── .gitmodules ├── .idea ├── .gitignore ├── codeStyles │ └── codeStyleConfig.xml ├── git_toolbox_blame.xml ├── inspectionProfiles │ └── Project_Default.xml ├── mise.iml ├── modules.xml ├── modules │ └── fixtures.iml ├── prettier.xml └── vcs.xml ├── .markdown-link-check.json ├── .markdownlint.json ├── .markdownlintignore ├── .pre-commit-config.yaml ├── .prettierignore ├── .prettierrc.toml ├── .shellcheckrc ├── .yamllint.yml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── Cross.toml ├── Dockerfile ├── LICENSE ├── README.md ├── SECURITY.md ├── age.pub ├── build.rs ├── bun.lock ├── cliff.toml ├── completions ├── _mise ├── mise.bash └── mise.fish ├── default.nix ├── deny.toml ├── docs ├── .gitignore ├── .mise.toml ├── .vitepress │ ├── cli_commands.ts │ ├── config.ts │ └── theme │ │ └── index.ts ├── LICENSE ├── README.md ├── about.md ├── bun.lock ├── cache-behavior.md ├── cli │ ├── activate.md │ ├── alias.md │ ├── alias │ │ ├── get.md │ │ ├── ls.md │ │ ├── set.md │ │ └── unset.md │ ├── backends.md │ ├── backends │ │ └── ls.md │ ├── bin-paths.md │ ├── cache.md │ ├── cache │ │ ├── clear.md │ │ └── prune.md │ ├── completion.md │ ├── config.md │ ├── config │ │ ├── generate.md │ │ ├── get.md │ │ ├── ls.md │ │ └── set.md │ ├── deactivate.md │ ├── doctor.md │ ├── doctor │ │ └── path.md │ ├── en.md │ ├── env.md │ ├── exec.md │ ├── fmt.md │ ├── generate.md │ ├── generate │ │ ├── bootstrap.md │ │ ├── config.md │ │ ├── devcontainer.md │ │ ├── git-pre-commit.md │ │ ├── github-action.md │ │ ├── task-docs.md │ │ └── task-stubs.md │ ├── implode.md │ ├── index.md │ ├── install-into.md │ ├── install.md │ ├── latest.md │ ├── link.md │ ├── ls-remote.md │ ├── ls.md │ ├── outdated.md │ ├── plugins.md │ ├── plugins │ │ ├── install.md │ │ ├── link.md │ │ ├── ls-remote.md │ │ ├── ls.md │ │ ├── uninstall.md │ │ └── update.md │ ├── prune.md │ ├── registry.md │ ├── reshim.md │ ├── run.md │ ├── search.md │ ├── self-update.md │ ├── set.md │ ├── settings.md │ ├── settings │ │ ├── add.md │ │ ├── get.md │ │ ├── ls.md │ │ ├── set.md │ │ └── unset.md │ ├── shell.md │ ├── sync.md │ ├── sync │ │ ├── node.md │ │ ├── python.md │ │ └── ruby.md │ ├── tasks.md │ ├── tasks │ │ ├── add.md │ │ ├── deps.md │ │ ├── edit.md │ │ ├── info.md │ │ ├── ls.md │ │ └── run.md │ ├── test-tool.md │ ├── tool.md │ ├── trust.md │ ├── uninstall.md │ ├── unset.md │ ├── unuse.md │ ├── upgrade.md │ ├── use.md │ ├── version.md │ ├── watch.md │ ├── where.md │ └── which.md ├── components │ ├── registry.vue │ ├── setting.vue │ └── settings.vue ├── configuration.md ├── configuration │ ├── environments.md │ └── settings.md ├── contact.md ├── continuous-integration.md ├── contributing.md ├── core-tools.md ├── demo.md ├── dev-tools │ ├── aliases.md │ ├── backends │ │ ├── aqua.md │ │ ├── asdf.md │ │ ├── cargo.md │ │ ├── dotnet.md │ │ ├── gem.md │ │ ├── go.md │ │ ├── index.md │ │ ├── npm.md │ │ ├── pipx.md │ │ ├── spm.md │ │ ├── ubi.md │ │ └── vfox.md │ ├── comparison-to-asdf.md │ ├── index.md │ └── shims.md ├── directories.md ├── direnv.md ├── environments │ ├── index.md │ └── secrets.md ├── errors.md ├── external-resources.md ├── faq.md ├── getting-started.md ├── hooks.md ├── how-i-use-mise.md ├── ide-integration.md ├── index.md ├── installing-mise.md ├── intellij-sdk-selection.png ├── lang │ ├── bun.md │ ├── deno.md │ ├── elixir.md │ ├── erlang.md │ ├── go.md │ ├── java.md │ ├── node.md │ ├── python.md │ ├── ruby.md │ ├── rust.md │ ├── swift.md │ └── zig.md ├── lefthook.yml ├── logo-dark.png ├── logo-dark@2x.png ├── logo-light.png ├── logo-light@2x.png ├── mise-cookbook │ ├── cpp.md │ ├── docker.md │ ├── index.md │ ├── neovim.md │ ├── nodejs.md │ ├── presets.md │ ├── python.md │ ├── ruby.md │ ├── shell-tricks.md │ └── terraform.md ├── mise.usage.kdl ├── package.json ├── paranoid.md ├── plugins.md ├── public │ ├── android-chrome-192x192.png │ ├── android-chrome-512x512.png │ ├── apple-touch-icon.png │ ├── favicon-16x16.png │ ├── favicon-32x32.png │ ├── favicon.ico │ └── site.webmanifest ├── registry.data.ts ├── registry.md ├── registry.toml ├── roadmap.md ├── rtx.md ├── settings.data.ts ├── settings.toml ├── shims-intellij.png ├── shims-vscode.png ├── tapes │ ├── demo.gif │ ├── demo.mp4 │ └── demo.tape ├── tasks │ ├── file-tasks.md │ ├── index.md │ ├── running-tasks.md │ ├── task-configuration.md │ └── toml-tasks.md ├── team.md ├── templates.md ├── tips-and-tricks.md ├── troubleshooting.md ├── tsconfig.json └── walkthrough.md ├── e2e-win ├── go.Tests.ps1 ├── helm.Tests.ps1 ├── java.Tests.ps1 ├── node.Tests.ps1 ├── python.Tests.ps1 ├── run.ps1 ├── rust.Tests.ps1 ├── shim.Tests.ps1 ├── task.Tests.ps1 └── zig.Tests.ps1 ├── e2e ├── .gitignore ├── assert.sh ├── backend │ ├── test_aqua │ ├── test_asdf │ ├── test_asdf_fake_list │ ├── test_cargo_binstall │ ├── test_cargo_binstall_token │ ├── test_cargo_compile_git_slow │ ├── test_cargo_compile_slow │ ├── test_cargo_features │ ├── test_disable_backends │ ├── test_dotnet │ ├── test_gem_slow │ ├── test_go_install_slow │ ├── test_npm │ ├── test_npm_bun │ ├── test_pipx_custom_registry │ ├── test_pipx_deep_dependencies │ ├── test_pipx_direct_dependencies │ ├── test_pipx_extras │ ├── test_pipx_slow │ ├── test_pipx_uvx │ ├── test_terraform │ ├── test_ubi │ ├── test_vfox_cmake │ ├── test_vfox_go │ ├── test_vfox_kotlin_slow │ ├── test_vfox_maven_slow │ ├── test_vfox_node_slow │ └── test_vfox_python_slow ├── cli │ ├── test_activate_aggressive │ ├── test_activate_path_safety │ ├── test_alias │ ├── test_backends │ ├── test_bin_paths │ ├── test_chdir │ ├── test_config_ls │ ├── test_config_set │ ├── test_current │ ├── test_doctor │ ├── test_exec_chdir │ ├── test_fmt │ ├── test_global │ ├── test_global_alt │ ├── test_hook_env │ ├── test_install_into │ ├── test_install_raw │ ├── test_link │ ├── test_local │ ├── test_local_toml │ ├── test_log_level │ ├── test_ls │ ├── test_ls_cache │ ├── test_ls_remote │ ├── test_outdated │ ├── test_prune │ ├── test_registry │ ├── test_search │ ├── test_set │ ├── test_settings_add │ ├── test_settings_ls │ ├── test_settings_set │ ├── test_settings_unset │ ├── test_shims │ ├── test_status │ ├── test_uninstall │ ├── test_unuse │ ├── test_upgrade │ ├── test_use │ ├── test_use_env │ ├── test_use_latest │ ├── test_use_retain_opts │ ├── test_version │ ├── test_watch │ ├── test_where │ └── test_which ├── config │ ├── test_config_alias │ ├── test_config_enable_tool │ ├── test_config_env │ ├── test_config_fmt │ ├── test_config_ignore │ ├── test_config_plugins │ ├── test_config_post_tools │ ├── test_hooks │ ├── test_no_config │ └── test_tool_versions_alt ├── core │ ├── test_bun │ ├── test_deno │ ├── test_erlang_slow │ ├── test_go │ ├── test_gopath │ ├── test_java │ ├── test_java_corretto │ ├── test_node │ ├── test_poetry_slow │ ├── test_python_compile_slow │ ├── test_python_precompiled │ ├── test_python_uv_venv │ ├── test_python_venv │ ├── test_ruby_build_slow │ ├── test_ruby_from_gemfile │ ├── test_ruby_install_slow │ ├── test_ruby_ls_remote │ ├── test_rust │ ├── test_swift_slow │ ├── test_system_node │ ├── test_zig │ └── test_zigmod ├── direnv │ └── test_direnv ├── env │ ├── test_env_dotenv │ ├── test_env_file │ ├── test_env_file_glob │ ├── test_env_json │ ├── test_env_path │ ├── test_env_profiles │ ├── test_env_source │ ├── test_env_source_glob │ ├── test_env_template │ ├── test_env_tmpl_cache │ └── test_env_tools ├── generate │ ├── test_generate_bootstrap │ ├── test_generate_config │ ├── test_generate_devcontainer │ └── test_generate_task_stubs ├── lockfile │ ├── test_lockfile_backend │ ├── test_lockfile_exec │ ├── test_lockfile_install │ └── test_lockfile_use ├── plugins │ ├── test_core_overloading │ ├── test_install │ ├── test_plugin_install │ ├── test_plugin_link │ ├── test_plugin_update │ ├── test_poetry_system_python_slow │ ├── test_purge │ ├── test_tiny │ └── test_version_range ├── run_all_tests ├── run_test ├── secrets │ └── test_secrets ├── shell │ ├── fish_script │ ├── test_bash │ ├── test_bash_legacy_activate │ ├── test_fish │ ├── test_zsh │ └── zsh_script ├── style.sh ├── sync │ ├── test_sync_nvm │ ├── test_sync_nvm_slow │ └── test_sync_python_uv ├── tasks │ ├── test_task_add │ ├── test_task_config_dir │ ├── test_task_default │ ├── test_task_depends_post │ ├── test_task_deps │ ├── test_task_deps_circular │ ├── test_task_help │ ├── test_task_info │ ├── test_task_keep_order │ ├── test_task_ls │ ├── test_task_ls_global │ ├── test_task_options │ ├── test_task_project_root │ ├── test_task_redactions │ ├── test_task_remote_git_https │ ├── test_task_remote_git_ssh │ ├── test_task_run_depends │ ├── test_task_run_file │ ├── test_task_run_output │ ├── test_task_run_sources │ ├── test_task_run_tmpl │ ├── test_task_run_toml │ ├── test_task_shell │ ├── test_task_skip │ ├── test_task_standalone │ ├── test_task_tools │ ├── test_task_unnest │ ├── test_task_usage │ └── test_task_vars ├── test_top_runtimes └── tools │ ├── test_path_order │ └── test_runtime_symlinks ├── flake.lock ├── flake.nix ├── hk.pkl ├── man └── man1 │ └── mise.1 ├── minisign.key.age ├── minisign.pub ├── mise.code-workspace ├── mise.lock ├── mise.toml ├── mise.usage.kdl ├── package.json ├── packaging ├── alpine │ ├── Dockerfile │ └── README.md ├── deb │ ├── Dockerfile │ └── generate-release.sh ├── dev │ └── Dockerfile ├── mise │ └── Dockerfile ├── rpm │ ├── Dockerfile │ ├── mise.repo │ ├── mise.spec │ └── rpmmacros └── standalone │ └── install.envsubst ├── pitchfork.toml ├── registry.toml ├── schema ├── mise-task.json ├── mise.json └── mise.plugin.json ├── scripts ├── build-deb.sh ├── build-rpm.sh ├── build-tarball.ps1 ├── build-tarball.sh ├── get-latest-version.sh ├── get-version.ps1 ├── get-version.sh ├── publish-r2.sh ├── publish-s3.sh ├── query-top-plugins.fish ├── release-alpine.sh ├── release-npm.sh ├── release.sh ├── render-install.sh ├── setup-zipsign.sh └── test-standalone.sh ├── settings.toml ├── share └── fish │ └── vendor_conf.d │ └── mise-activate.fish ├── src ├── aqua │ ├── aqua_registry.rs │ ├── aqua_template.rs │ └── mod.rs ├── assets │ ├── bash_zsh_support │ │ ├── LICENSE │ │ ├── README.md │ │ └── chpwd │ │ │ ├── README.md │ │ │ ├── function.sh │ │ │ └── load.sh │ ├── gpg │ │ ├── node.asc │ │ └── swift.asc │ └── mise-extra.usage.kdl ├── backend │ ├── aqua.rs │ ├── asdf.rs │ ├── backend_type.rs │ ├── cargo.rs │ ├── dotnet.rs │ ├── external_plugin_cache.rs │ ├── gem.rs │ ├── go.rs │ ├── mod.rs │ ├── npm.rs │ ├── pipx.rs │ ├── spm.rs │ ├── ubi.rs │ └── vfox.rs ├── build_time.rs ├── cache.rs ├── cli │ ├── activate.rs │ ├── alias │ │ ├── get.rs │ │ ├── ls.rs │ │ ├── mod.rs │ │ ├── set.rs │ │ └── unset.rs │ ├── args │ │ ├── backend_arg.rs │ │ ├── env_var_arg.rs │ │ ├── mod.rs │ │ └── tool_arg.rs │ ├── asdf.rs │ ├── backends │ │ ├── ls.rs │ │ └── mod.rs │ ├── bin_paths.rs │ ├── cache │ │ ├── clear.rs │ │ ├── mod.rs │ │ └── prune.rs │ ├── completion.rs │ ├── config │ │ ├── generate.rs │ │ ├── get.rs │ │ ├── ls.rs │ │ ├── mod.rs │ │ └── set.rs │ ├── current.rs │ ├── deactivate.rs │ ├── direnv │ │ ├── activate.rs │ │ ├── envrc.rs │ │ ├── exec.rs │ │ └── mod.rs │ ├── doctor │ │ ├── mod.rs │ │ └── path.rs │ ├── en.rs │ ├── env.rs │ ├── exec.rs │ ├── external.rs │ ├── fmt.rs │ ├── generate │ │ ├── bootstrap.rs │ │ ├── config.rs │ │ ├── devcontainer.rs │ │ ├── git_pre_commit.rs │ │ ├── github_action.rs │ │ ├── mod.rs │ │ ├── task_docs.rs │ │ └── task_stubs.rs │ ├── global.rs │ ├── hook_env.rs │ ├── hook_not_found.rs │ ├── implode.rs │ ├── install.rs │ ├── install_into.rs │ ├── latest.rs │ ├── link.rs │ ├── local.rs │ ├── ls.rs │ ├── ls_remote.rs │ ├── mod.rs │ ├── outdated.rs │ ├── plugins │ │ ├── install.rs │ │ ├── link.rs │ │ ├── ls.rs │ │ ├── ls_remote.rs │ │ ├── mod.rs │ │ ├── uninstall.rs │ │ └── update.rs │ ├── prune.rs │ ├── registry.rs │ ├── render_help.rs │ ├── render_mangen.rs │ ├── reshim.rs │ ├── run.rs │ ├── search.rs │ ├── self_update.rs │ ├── self_update_stub.rs │ ├── set.rs │ ├── settings │ │ ├── add.rs │ │ ├── get.rs │ │ ├── ls.rs │ │ ├── mod.rs │ │ ├── set.rs │ │ └── unset.rs │ ├── shell.rs │ ├── sync │ │ ├── mod.rs │ │ ├── node.rs │ │ ├── python.rs │ │ └── ruby.rs │ ├── tasks │ │ ├── add.rs │ │ ├── deps.rs │ │ ├── edit.rs │ │ ├── info.rs │ │ ├── ls.rs │ │ └── mod.rs │ ├── test_tool.rs │ ├── tool.rs │ ├── trust.rs │ ├── uninstall.rs │ ├── unset.rs │ ├── unuse.rs │ ├── upgrade.rs │ ├── usage.rs │ ├── use.rs │ ├── version.rs │ ├── watch.rs │ ├── where.rs │ └── which.rs ├── cmd.rs ├── config │ ├── config_file │ │ ├── idiomatic_version.rs │ │ ├── mise_toml.rs │ │ ├── mod.rs │ │ ├── snapshots │ │ │ ├── mise__config__config_file__mise_toml__tests__env-2.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__env-3.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__env-4.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__fixture-2.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__fixture-3.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__fixture-4.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__fixture-5.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__fixture.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_alias-2.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_alias-3.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_alias-4.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_alias.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_plugin-2.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_plugin-3.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_plugin-4.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__remove_plugin.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__replace_versions-2.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__replace_versions-3.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__replace_versions-4.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__replace_versions.snap │ │ │ ├── mise__config__config_file__mise_toml__tests__set_alias-2.snap │ │ │ └── mise__config__config_file__mise_toml__tests__set_alias.snap │ │ ├── toml.rs │ │ └── tool_versions.rs │ ├── env_directive │ │ ├── file.rs │ │ ├── mod.rs │ │ ├── module.rs │ │ ├── path.rs │ │ ├── source.rs │ │ └── venv.rs │ ├── mod.rs │ ├── settings.rs │ ├── snapshots │ │ └── mise__config__tests__load.snap │ └── tracking.rs ├── direnv.rs ├── dirs.rs ├── duration.rs ├── env.rs ├── env_diff.rs ├── errors.rs ├── exit.rs ├── fake_asdf.rs ├── fake_asdf_windows.rs ├── file.rs ├── git.rs ├── github.rs ├── gitlab.rs ├── gpg.rs ├── hash.rs ├── hint.rs ├── hook_env.rs ├── hooks.rs ├── http.rs ├── install_context.rs ├── lock_file.rs ├── lockfile.rs ├── logger.rs ├── main.rs ├── maplit.rs ├── migrate.rs ├── minisign.rs ├── output.rs ├── parallel.rs ├── path.rs ├── path_env.rs ├── plugins │ ├── asdf_plugin.rs │ ├── core │ │ ├── assets │ │ │ ├── node_npm_shim │ │ │ └── rubygems_plugin.rb │ │ ├── bun.rs │ │ ├── deno.rs │ │ ├── elixir.rs │ │ ├── erlang.rs │ │ ├── go.rs │ │ ├── java.rs │ │ ├── mod.rs │ │ ├── node.rs │ │ ├── python.rs │ │ ├── ruby.rs │ │ ├── ruby_windows.rs │ │ ├── rust.rs │ │ ├── swift.rs │ │ └── zig.rs │ ├── mise_plugin_toml.rs │ ├── mod.rs │ ├── script_manager.rs │ ├── snapshots │ │ └── mise__plugins__mise_plugin_toml__tests__fixture.snap │ └── vfox_plugin.rs ├── rand.rs ├── redactions.rs ├── registry.rs ├── result.rs ├── runtime_symlinks.rs ├── shell │ ├── bash.rs │ ├── elvish.rs │ ├── fish.rs │ ├── mod.rs │ ├── nushell.rs │ ├── pwsh.rs │ ├── snapshots │ │ ├── mise__shell__bash__tests__activate.snap │ │ ├── mise__shell__bash__tests__deactivate.snap │ │ ├── mise__shell__bash__tests__prepend_env.snap │ │ ├── mise__shell__bash__tests__set_env.snap │ │ ├── mise__shell__bash__tests__unset_env.snap │ │ ├── mise__shell__elvish__tests__deactivate.snap │ │ ├── mise__shell__elvish__tests__hook_init.snap │ │ ├── mise__shell__elvish__tests__prepend_env.snap │ │ ├── mise__shell__elvish__tests__set_env.snap │ │ ├── mise__shell__elvish__tests__unset_env.snap │ │ ├── mise__shell__fish__tests__activate.snap │ │ ├── mise__shell__fish__tests__deactivate.snap │ │ ├── mise__shell__fish__tests__prepend_env.snap │ │ ├── mise__shell__fish__tests__set_env.snap │ │ ├── mise__shell__fish__tests__unset_env.snap │ │ ├── mise__shell__nushell__tests__deactivate.snap │ │ ├── mise__shell__nushell__tests__hook_init.snap │ │ ├── mise__shell__nushell__tests__prepend_env.snap │ │ ├── mise__shell__nushell__tests__set_env.snap │ │ ├── mise__shell__nushell__tests__unset_env.snap │ │ ├── mise__shell__pwsh__tests__activate.snap │ │ ├── mise__shell__pwsh__tests__deactivate.snap │ │ ├── mise__shell__pwsh__tests__prepend_env.snap │ │ ├── mise__shell__pwsh__tests__set_env.snap │ │ ├── mise__shell__pwsh__tests__unset_env.snap │ │ ├── mise__shell__xonsh__tests__hook_init.snap │ │ ├── mise__shell__xonsh__tests__prepend_env.snap │ │ ├── mise__shell__xonsh__tests__set_env.snap │ │ ├── mise__shell__xonsh__tests__unset_env.snap │ │ ├── mise__shell__xonsh__tests__xonsh_deactivate.snap │ │ ├── mise__shell__zsh__tests__activate.snap │ │ ├── mise__shell__zsh__tests__deactivate.snap │ │ ├── mise__shell__zsh__tests__prepend_env.snap │ │ ├── mise__shell__zsh__tests__set_env.snap │ │ └── mise__shell__zsh__tests__unset_env.snap │ ├── xonsh.rs │ └── zsh.rs ├── shims.rs ├── shorthands.rs ├── snapshots │ ├── mise__direnv__tests__add_path_to_old_and_new-2.snap │ ├── mise__direnv__tests__add_path_to_old_and_new.snap │ ├── mise__direnv__tests__dump-2.snap │ ├── mise__direnv__tests__dump.snap │ ├── mise__direnv__tests__null_path-2.snap │ ├── mise__direnv__tests__null_path.snap │ ├── mise__direnv__tests__parse.snap │ ├── mise__env_diff__tests__diff.snap │ ├── mise__env_diff__tests__from_bash_script.snap │ ├── mise__env_diff__tests__serialize.snap │ └── mise__hash__tests__hash_sha256.snap ├── sops.rs ├── sysconfig │ ├── LICENSE-MIT │ ├── cursor.rs │ ├── mod.rs │ └── parser.rs ├── task │ ├── deps.rs │ ├── mod.rs │ ├── task_dep.rs │ ├── task_file_providers │ │ ├── local_task.rs │ │ ├── mod.rs │ │ ├── remote_task_git.rs │ │ └── remote_task_http.rs │ ├── task_script_parser.rs │ └── task_sources.rs ├── tera.rs ├── test.rs ├── timeout.rs ├── timings.rs ├── toml.rs ├── toolset │ ├── builder.rs │ ├── install_state.rs │ ├── mod.rs │ ├── outdated_info.rs │ ├── tool_request.rs │ ├── tool_request_set.rs │ ├── tool_source.rs │ ├── tool_version.rs │ └── tool_version_list.rs ├── ui │ ├── ctrlc.rs │ ├── ctrlc_stub.rs │ ├── info.rs │ ├── mod.rs │ ├── multi_progress_report.rs │ ├── progress_report.rs │ ├── prompt.rs │ ├── style.rs │ ├── table.rs │ ├── time.rs │ └── tree.rs ├── uv.rs ├── versions_host.rs ├── watch_files.rs └── wildcard.rs ├── tasks.md ├── tasks.toml ├── test ├── .gitignore ├── .test-tool-versions ├── config │ ├── config.toml │ └── settings.toml ├── data │ └── plugins │ │ ├── dummy │ │ ├── LICENSE │ │ └── bin │ │ │ ├── download │ │ │ ├── get-version-from-legacy-file │ │ │ ├── help.overview │ │ │ ├── install │ │ │ ├── latest-stable │ │ │ ├── list-all │ │ │ ├── list-legacy-filenames │ │ │ ├── parse-legacy-file │ │ │ ├── post-plugin-add │ │ │ ├── post-plugin-update │ │ │ └── pre-plugin-remove │ │ └── tiny │ │ ├── .gitignore │ │ └── bin │ │ ├── exec-env │ │ ├── install │ │ ├── list-aliases │ │ ├── list-all │ │ └── list-legacy-filenames └── fixtures │ ├── .env │ ├── .env2 │ ├── .mise.toml │ ├── exec-env │ ├── mise.plugin.toml │ ├── shorthands.toml │ └── signal-test.js ├── tsconfig.json ├── xtasks ├── .hidden-executable ├── .hidden │ └── bar │ │ └── baz │ │ └── hidden-executable ├── aqua-tester.fish ├── docs │ └── release ├── fetch-gpg-keys ├── fig │ ├── .gitignore │ ├── addCustomGenerators.ts │ ├── generators.ts │ └── src │ │ ├── .gitignore │ │ └── mise.ts ├── filetask ├── filetask.bat ├── lint-fix.ps1 ├── lint-fix.sh ├── lint │ ├── actionlint │ ├── cargo-fmt │ ├── hk │ ├── markdownlint │ ├── ripgrep │ └── toml ├── release-plz ├── render │ └── settings.ts ├── show-output-on-failure ├── show-output-on-failure.bat ├── test │ ├── build-perf-workspace │ ├── coverage │ ├── e2e │ └── perf ├── testtask.ps1 ├── testtask.sh └── update-descriptions └── zipsign.pub /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | #paths = ["../vfox.rs"] 2 | #paths = ["../usage/lib"] 3 | 4 | [env] 5 | RUST_TEST_THREADS = '1' 6 | 7 | [target.aarch64-pc-windows-msvc] 8 | rustflags = ["-C", "link-arg=/STACK:8000000"] 9 | [target.aarch64-pc-windows-gnu] 10 | rustflags = ["-C", "link-arg=-Wl,--stack,8000000"] 11 | [target.x86_64-pc-windows-msvc] 12 | rustflags = ["-C", "link-arg=/STACK:8000000"] 13 | [target.x86_64-pc-windows-gnu] 14 | rustflags = ["-C", "link-arg=-Wl,--stack,8000000"] 15 | -------------------------------------------------------------------------------- /.config/insta.yaml: -------------------------------------------------------------------------------- 1 | test: 2 | auto_review: true 3 | -------------------------------------------------------------------------------- /.config/nextest.toml: -------------------------------------------------------------------------------- 1 | [profile.default] 2 | test-threads = 1 3 | slow-timeout = { period = "250ms", terminate-after = 4 } 4 | status-level = "all" 5 | retries = { backoff = "exponential", count = 4, delay = "1s", max-delay = "10s" } 6 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.toml] 2 | indent_style = space 3 | indent_size = 4 4 | 5 | [{*.sh,.mise/tasks/**/*,e2e/**/*,*.pkl}] 6 | indent_style = space 7 | indent_size = 2 8 | 9 | # shfmt 10 | switch_case_indent = true 11 | simplify = true 12 | -------------------------------------------------------------------------------- /.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | extends: ["@fig/autocomplete"], 3 | }; 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | zipsign.pub binary 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: jdx 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Features, Bug Reports, Questions 4 | url: https://github.com/jdx/mise/discussions/new/choose 5 | about: Our preferred starting point if you have any questions or suggestions about configuration, features or behavior. 6 | -------------------------------------------------------------------------------- /.github/actionlint.yaml: -------------------------------------------------------------------------------- 1 | self-hosted-runner: 2 | # Labels of self-hosted runner in array of strings. 3 | labels: 4 | - macos-14 5 | - buildjet-32vcpu-ubuntu-2204-arm 6 | - buildjet-16vcpu-ubuntu-2204-arm 7 | - buildjet-8vcpu-ubuntu-2204-arm 8 | - buildjet-4vcpu-ubuntu-2204-arm 9 | - buildjet-2vcpu-ubuntu-2204-arm 10 | - buildjet-32vcpu-ubuntu-2204 11 | - buildjet-16vcpu-ubuntu-2204 12 | - buildjet-8vcpu-ubuntu-2204 13 | - buildjet-4vcpu-ubuntu-2204 14 | - buildjet-2vcpu-ubuntu-2204 15 | 16 | # Configuration variables in array of strings defined in your repository or 17 | # organization. `null` means disabling configuration variables check. 18 | # Empty array means no configuration variable is allowed. 19 | config-variables: null 20 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["github>jdx/renovate-config", "helpers:pinGitHubActionDigests"], 4 | "automerge": false, 5 | "lockFileMaintenance": { 6 | "enabled": false 7 | }, 8 | "excludeCommitPaths": ["registry/**"], 9 | "asdf": { 10 | "enabled": false 11 | }, 12 | "nodenv": { 13 | "enabled": false 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/restyled.yml: -------------------------------------------------------------------------------- 1 | enabled: true 2 | restylers: 3 | - "!shellharden" 4 | - "!prettier-markdown" 5 | - "*" 6 | -------------------------------------------------------------------------------- /.github/workflows/issue-closer.yml: -------------------------------------------------------------------------------- 1 | name: issue-closer 2 | 3 | on: 4 | issues: 5 | types: [opened] 6 | 7 | jobs: 8 | label-issue: 9 | runs-on: ubuntu-latest 10 | if: github.actor != 'jdx' 11 | 12 | steps: 13 | - run: gh issue close "${{ github.event.issue.number }}" -R jdx/mise --reason "not planned" -c "issues may only be created by maintainers" 14 | env: 15 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | -------------------------------------------------------------------------------- /.github/workflows/semantic-pr-lint.yml: -------------------------------------------------------------------------------- 1 | name: semantic-pr-lint 2 | 3 | on: 4 | pull_request_target: 5 | types: 6 | - opened 7 | - edited 8 | - reopened 9 | 10 | jobs: 11 | main: 12 | name: Validate PR title 13 | runs-on: ubuntu-latest 14 | permissions: 15 | pull-requests: read 16 | steps: 17 | - uses: amannn/action-semantic-pull-request@v5 18 | env: 19 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 20 | -------------------------------------------------------------------------------- /.github/workflows/winget.yml: -------------------------------------------------------------------------------- 1 | name: winget 2 | on: 3 | release: 4 | types: [released] 5 | workflow_dispatch: 6 | jobs: 7 | publish: 8 | runs-on: windows-latest 9 | steps: 10 | - uses: actions/checkout@v4 11 | with: 12 | repository: jdx/winget-pkgs 13 | token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }} 14 | fetch-depth: 0 15 | - run: git config user.name mise-en-dev 16 | - run: git config user.email release@mise.jdx.dev 17 | - run: git remote add microsoft https://github.com/microsoft/winget-pkgs 18 | - run: git pull --rebase microsoft master 19 | - run: git push -f origin master 20 | - uses: vedantmgoyal9/winget-releaser@main 21 | with: 22 | identifier: jdx.mise 23 | max-versions-to-keep: 5 24 | token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }} 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /dist/ 3 | /node_modules/ 4 | package-lock.json 5 | .mise.lock 6 | /mise.local.toml 7 | /perf-workspace 8 | 9 | *.log 10 | *.profraw 11 | *.lcov 12 | flamegraph.svg 13 | cargo-flamegraph.trace 14 | 15 | **/snapshots/*.snap.new 16 | 17 | # Generated by Cargo 18 | # will have compiled files and executables 19 | /target/ 20 | # These are backup files generated by rustfmt 21 | **/*.rs.bk 22 | 23 | # alpine 24 | .ash_history 25 | .abuild 26 | /aports 27 | 28 | megalinter-reports/ 29 | .dev/ 30 | 31 | .vscode/ 32 | testResults.xml 33 | .mise/ 34 | comment.md 35 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "aqua-registry"] 2 | path = aqua-registry 3 | url = https://github.com/aquaproj/aqua-registry 4 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | # GitHub Copilot persisted chat sessions 10 | /copilot/chatSessions 11 | -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/git_toolbox_blame.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules/fixtures.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/prettier.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.markdown-link-check.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": [{ "pattern": "^https://crates.io" }] 3 | } 4 | -------------------------------------------------------------------------------- /.markdownlint.json: -------------------------------------------------------------------------------- 1 | { 2 | "MD004": false, 3 | "MD013": false, 4 | "MD029": false, 5 | "MD033": false, 6 | "MD040": false, 7 | "MD041": false 8 | } 9 | -------------------------------------------------------------------------------- /.markdownlintignore: -------------------------------------------------------------------------------- 1 | /registry/ 2 | /target/ 3 | CHANGELOG.md 4 | docs/node_modules/ 5 | docs/cli/watch.md 6 | node_modules/ 7 | test/ 8 | /tasks.md 9 | /comment.md 10 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | repos: 4 | - repo: https://github.com/pre-commit/pre-commit-hooks 5 | rev: v5.0.0 6 | hooks: 7 | - id: trailing-whitespace 8 | - id: end-of-file-fixer 9 | exclude: "^.idea/" 10 | - id: check-yaml 11 | - id: check-toml 12 | - id: check-json 13 | - repo: https://github.com/shellcheck-py/shellcheck-py 14 | rev: v0.10.0.1 15 | hooks: 16 | - id: shellcheck 17 | exclude: "^completions/" # TODO: remove after usage is released again 18 | - repo: https://github.com/rhysd/actionlint 19 | rev: v1.7.4 20 | hooks: 21 | - id: actionlint 22 | args: ["-shellcheck", ""] 23 | - repo: https://github.com/kykosic/pre-commit-rust 24 | rev: 0.4.0 25 | hooks: 26 | - id: cargo-fmt 27 | - id: cargo-check 28 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | *.rs 2 | *.snap 3 | .idea 4 | .venv 5 | *.gif 6 | *.png 7 | *.lock 8 | .cliffignore 9 | *.kdl 10 | CHANGELOG.md 11 | aqua-registry/ 12 | docs/.vitepress/cache 13 | docs/.vitepress/dist 14 | docs/cli 15 | docs/environments.md 16 | docs/public/site.webmanifest 17 | docs/registry.md 18 | e2e 19 | src/assets/bash_zsh_support/ 20 | tasks.md 21 | test/data 22 | tmp 23 | -------------------------------------------------------------------------------- /.prettierrc.toml: -------------------------------------------------------------------------------- 1 | [[overrides]] 2 | files = "xtasks/fig/**/*.ts" 3 | options = { trailingComma = "es5", printWidth = 80 } 4 | -------------------------------------------------------------------------------- /.shellcheckrc: -------------------------------------------------------------------------------- 1 | disable=SC1008 2 | disable=SC2088 3 | disable=SC2129 4 | disable=SC2164 5 | disable=SC2317 6 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | document-start: disable 2 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /Cross.toml: -------------------------------------------------------------------------------- 1 | [build.env] 2 | passthrough = ["AWS_ACCESS_KEY_ID", "AWS_SECRET_ACCESS_KEY"] 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | ./packaging/mise/Dockerfile -------------------------------------------------------------------------------- /age.pub: -------------------------------------------------------------------------------- 1 | age1y5mxeyps7vjthl8ea59uecmdycflfny8s9fuj620dfyjvl3y3qksqa565h 2 | -------------------------------------------------------------------------------- /completions/mise.fish: -------------------------------------------------------------------------------- 1 | # if "usage" is not installed show an error 2 | if ! command -v usage &> /dev/null 3 | echo >&2 4 | echo "Error: usage CLI not found. This is required for completions to work in mise." >&2 5 | echo "See https://usage.jdx.dev for more information." >&2 6 | return 1 7 | end 8 | 9 | if ! set -q _usage_spec_mise_2025_5_17 10 | set -g _usage_spec_mise_2025_5_17 (mise usage | string collect) 11 | end 12 | set -l tokens 13 | if commandline -x >/dev/null 2>&1 14 | complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_5_17" -- (commandline -xpc) (commandline -t))' 15 | else 16 | complete -xc mise -a '(usage complete-word --shell fish -s "$_usage_spec_mise_2025_5_17" -- (commandline -opc) (commandline -t))' 17 | end 18 | -------------------------------------------------------------------------------- /docs/.mise.toml: -------------------------------------------------------------------------------- 1 | tasks.dev = "bun run docs:dev" 2 | tasks.build = "bun run docs:build" 3 | 4 | [tasks."commit-and-push"] 5 | depends = ["build"] 6 | run = ["git ci -pm docs", "git push"] 7 | 8 | [tools] 9 | bun = 'latest' 10 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.ts: -------------------------------------------------------------------------------- 1 | import type { Theme } from "vitepress"; 2 | import DefaultTheme from "vitepress/theme"; 3 | import { enhanceAppWithTabs } from "vitepress-plugin-tabs/client"; 4 | import "virtual:group-icons.css"; 5 | 6 | export default { 7 | extends: DefaultTheme, 8 | enhanceApp({ app }) { 9 | enhanceAppWithTabs(app); 10 | }, 11 | } satisfies Theme; 12 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # mise-docs 2 | 3 | This repository contains the documentation website for the runtime executor [mise](https://github.com/jdx/mise). The website is powered by [VitePress](https://vitepress.dev/). 4 | -------------------------------------------------------------------------------- /docs/cli/alias.md: -------------------------------------------------------------------------------- 1 | # `mise alias` 2 | 3 | - **Usage**: `mise alias [-p --plugin ] [--no-header] ` 4 | - **Aliases**: `a` 5 | - **Source code**: [`src/cli/alias/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/alias/mod.rs) 6 | 7 | Manage version aliases. 8 | 9 | ## Flags 10 | 11 | ### `-p --plugin ` 12 | 13 | filter aliases by plugin 14 | 15 | ### `--no-header` 16 | 17 | Don't show table header 18 | 19 | ## Subcommands 20 | 21 | - [`mise alias get `](/cli/alias/get.md) 22 | - [`mise alias ls [--no-header] [TOOL]`](/cli/alias/ls.md) 23 | - [`mise alias set …`](/cli/alias/set.md) 24 | - [`mise alias unset `](/cli/alias/unset.md) 25 | -------------------------------------------------------------------------------- /docs/cli/alias/get.md: -------------------------------------------------------------------------------- 1 | # `mise alias get` 2 | 3 | - **Usage**: `mise alias get ` 4 | - **Source code**: [`src/cli/alias/get.rs`](https://github.com/jdx/mise/blob/main/src/cli/alias/get.rs) 5 | 6 | Show an alias for a plugin 7 | 8 | This is the contents of an alias.<PLUGIN> entry in ~/.config/mise/config.toml 9 | 10 | ## Arguments 11 | 12 | ### `` 13 | 14 | The plugin to show the alias for 15 | 16 | ### `` 17 | 18 | The alias to show 19 | 20 | Examples: 21 | 22 | ``` 23 | $ mise alias get node lts-hydrogen 24 | 20.0.0 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/cli/alias/ls.md: -------------------------------------------------------------------------------- 1 | # `mise alias ls` 2 | 3 | - **Usage**: `mise alias ls [--no-header] [TOOL]` 4 | - **Aliases**: `list` 5 | - **Source code**: [`src/cli/alias/ls.rs`](https://github.com/jdx/mise/blob/main/src/cli/alias/ls.rs) 6 | 7 | List aliases 8 | Shows the aliases that can be specified. 9 | These can come from user config or from plugins in `bin/list-aliases`. 10 | 11 | For user config, aliases are defined like the following in `~/.config/mise/config.toml`: 12 | 13 | ``` 14 | [alias.node.versions] 15 | lts = "22.0.0" 16 | ``` 17 | 18 | ## Arguments 19 | 20 | ### `[TOOL]` 21 | 22 | Show aliases for <TOOL> 23 | 24 | ## Flags 25 | 26 | ### `--no-header` 27 | 28 | Don't show table header 29 | 30 | Examples: 31 | 32 | ``` 33 | $ mise aliases 34 | node lts-jod 22 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/cli/alias/set.md: -------------------------------------------------------------------------------- 1 | # `mise alias set` 2 | 3 | - **Usage**: `mise alias set …` 4 | - **Aliases**: `add`, `create` 5 | - **Source code**: [`src/cli/alias/set.rs`](https://github.com/jdx/mise/blob/main/src/cli/alias/set.rs) 6 | 7 | Add/update an alias for a plugin 8 | 9 | This modifies the contents of ~/.config/mise/config.toml 10 | 11 | ## Arguments 12 | 13 | ### `` 14 | 15 | The plugin to set the alias for 16 | 17 | ### `` 18 | 19 | The alias to set 20 | 21 | ### `` 22 | 23 | The value to set the alias to 24 | 25 | Examples: 26 | 27 | ``` 28 | mise alias set node lts-jod 22.0.0 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/cli/alias/unset.md: -------------------------------------------------------------------------------- 1 | # `mise alias unset` 2 | 3 | - **Usage**: `mise alias unset ` 4 | - **Aliases**: `rm`, `remove`, `delete`, `del` 5 | - **Source code**: [`src/cli/alias/unset.rs`](https://github.com/jdx/mise/blob/main/src/cli/alias/unset.rs) 6 | 7 | Clears an alias for a plugin 8 | 9 | This modifies the contents of ~/.config/mise/config.toml 10 | 11 | ## Arguments 12 | 13 | ### `` 14 | 15 | The plugin to remove the alias from 16 | 17 | ### `` 18 | 19 | The alias to remove 20 | 21 | Examples: 22 | 23 | ``` 24 | mise alias unset node lts-jod 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/cli/backends.md: -------------------------------------------------------------------------------- 1 | # `mise backends` 2 | 3 | - **Usage**: `mise backends ` 4 | - **Aliases**: `b` 5 | - **Source code**: [`src/cli/backends/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/backends/mod.rs) 6 | 7 | Manage backends 8 | 9 | ## Subcommands 10 | 11 | - [`mise backends ls`](/cli/backends/ls.md) 12 | -------------------------------------------------------------------------------- /docs/cli/backends/ls.md: -------------------------------------------------------------------------------- 1 | # `mise backends ls` 2 | 3 | - **Usage**: `mise backends ls` 4 | - **Aliases**: `list` 5 | - **Source code**: [`src/cli/backends/ls.rs`](https://github.com/jdx/mise/blob/main/src/cli/backends/ls.rs) 6 | 7 | List built-in backends 8 | 9 | Examples: 10 | 11 | ``` 12 | $ mise backends ls 13 | aqua 14 | asdf 15 | cargo 16 | core 17 | dotnet 18 | gem 19 | go 20 | npm 21 | pipx 22 | spm 23 | ubi 24 | vfox 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/cli/bin-paths.md: -------------------------------------------------------------------------------- 1 | # `mise bin-paths` 2 | 3 | - **Usage**: `mise bin-paths [TOOL@VERSION]…` 4 | - **Source code**: [`src/cli/bin_paths.rs`](https://github.com/jdx/mise/blob/main/src/cli/bin_paths.rs) 5 | 6 | List all the active runtime bin paths 7 | 8 | ## Arguments 9 | 10 | ### `[TOOL@VERSION]…` 11 | 12 | Tool(s) to look up 13 | e.g.: ruby@3 14 | -------------------------------------------------------------------------------- /docs/cli/cache.md: -------------------------------------------------------------------------------- 1 | # `mise cache` 2 | 3 | - **Usage**: `mise cache ` 4 | - **Source code**: [`src/cli/cache/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/cache/mod.rs) 5 | 6 | Manage the mise cache 7 | 8 | Run `mise cache` with no args to view the current cache directory. 9 | 10 | ## Subcommands 11 | 12 | - [`mise cache clear [PLUGIN]…`](/cli/cache/clear.md) 13 | - [`mise cache prune [--dry-run] [-v --verbose…] [PLUGIN]…`](/cli/cache/prune.md) 14 | -------------------------------------------------------------------------------- /docs/cli/cache/clear.md: -------------------------------------------------------------------------------- 1 | # `mise cache clear` 2 | 3 | - **Usage**: `mise cache clear [PLUGIN]…` 4 | - **Aliases**: `c` 5 | - **Source code**: [`src/cli/cache/clear.rs`](https://github.com/jdx/mise/blob/main/src/cli/cache/clear.rs) 6 | 7 | Deletes all cache files in mise 8 | 9 | ## Arguments 10 | 11 | ### `[PLUGIN]…` 12 | 13 | Plugin(s) to clear cache for e.g.: node, python 14 | -------------------------------------------------------------------------------- /docs/cli/cache/prune.md: -------------------------------------------------------------------------------- 1 | # `mise cache prune` 2 | 3 | - **Usage**: `mise cache prune [--dry-run] [-v --verbose…] [PLUGIN]…` 4 | - **Aliases**: `p` 5 | - **Source code**: [`src/cli/cache/prune.rs`](https://github.com/jdx/mise/blob/main/src/cli/cache/prune.rs) 6 | 7 | Removes stale mise cache files 8 | 9 | By default, this command will remove files that have not been accessed in 30 days. 10 | Change this with the MISE_CACHE_PRUNE_AGE environment variable. 11 | 12 | ## Arguments 13 | 14 | ### `[PLUGIN]…` 15 | 16 | Plugin(s) to clear cache for e.g.: node, python 17 | 18 | ## Flags 19 | 20 | ### `--dry-run` 21 | 22 | Just show what would be pruned 23 | 24 | ### `-v --verbose…` 25 | 26 | Show pruned files 27 | -------------------------------------------------------------------------------- /docs/cli/config/generate.md: -------------------------------------------------------------------------------- 1 | # `mise config generate` 2 | 3 | - **Usage**: `mise config generate [-t --tool-versions ] [-o --output ]` 4 | - **Aliases**: `g` 5 | - **Source code**: [`src/cli/config/generate.rs`](https://github.com/jdx/mise/blob/main/src/cli/config/generate.rs) 6 | 7 | [experimental] Generate a mise.toml file 8 | 9 | ## Flags 10 | 11 | ### `-t --tool-versions ` 12 | 13 | Path to a .tool-versions file to import tools from 14 | 15 | ### `-o --output ` 16 | 17 | Output to file instead of stdout 18 | 19 | Examples: 20 | 21 | ``` 22 | mise cf generate > mise.toml 23 | mise cf generate --output=mise.toml 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/cli/config/get.md: -------------------------------------------------------------------------------- 1 | # `mise config get` 2 | 3 | - **Usage**: `mise config get [-f --file ] [KEY]` 4 | - **Source code**: [`src/cli/config/get.rs`](https://github.com/jdx/mise/blob/main/src/cli/config/get.rs) 5 | 6 | Display the value of a setting in a mise.toml file 7 | 8 | ## Arguments 9 | 10 | ### `[KEY]` 11 | 12 | The path of the config to display 13 | 14 | ## Flags 15 | 16 | ### `-f --file ` 17 | 18 | The path to the mise.toml file to edit 19 | 20 | If not provided, the nearest mise.toml file will be used 21 | 22 | Examples: 23 | 24 | ``` 25 | $ mise toml get tools.python 26 | 3.12 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/cli/config/ls.md: -------------------------------------------------------------------------------- 1 | # `mise config ls` 2 | 3 | - **Usage**: `mise config ls [FLAGS]` 4 | - **Aliases**: `list` 5 | - **Source code**: [`src/cli/config/ls.rs`](https://github.com/jdx/mise/blob/main/src/cli/config/ls.rs) 6 | 7 | List config files currently in use 8 | 9 | ## Flags 10 | 11 | ### `--no-header` 12 | 13 | Do not print table header 14 | 15 | ### `--tracked-configs` 16 | 17 | List all tracked config files 18 | 19 | ### `-J --json` 20 | 21 | Output in JSON format 22 | 23 | Examples: 24 | 25 | ``` 26 | $ mise config ls 27 | Path Tools 28 | ~/.config/mise/config.toml pitchfork 29 | ~/src/mise/mise.toml actionlint, bun, cargo-binstall, cargo:cargo-edit, cargo:cargo-insta 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/cli/deactivate.md: -------------------------------------------------------------------------------- 1 | # `mise deactivate` 2 | 3 | - **Usage**: `mise deactivate` 4 | - **Source code**: [`src/cli/deactivate.rs`](https://github.com/jdx/mise/blob/main/src/cli/deactivate.rs) 5 | 6 | Disable mise for current shell session 7 | 8 | This can be used to temporarily disable mise in a shell session. 9 | 10 | Examples: 11 | 12 | ``` 13 | mise deactivate 14 | ``` 15 | -------------------------------------------------------------------------------- /docs/cli/doctor.md: -------------------------------------------------------------------------------- 1 | # `mise doctor` 2 | 3 | - **Usage**: `mise doctor [-J --json] ` 4 | - **Aliases**: `dr` 5 | - **Source code**: [`src/cli/doctor/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/doctor/mod.rs) 6 | 7 | Check mise installation for possible problems 8 | 9 | ## Flags 10 | 11 | ### `-J --json` 12 | 13 | ## Subcommands 14 | 15 | - [`mise doctor path [-f --full]`](/cli/doctor/path.md) 16 | 17 | Examples: 18 | 19 | ``` 20 | $ mise doctor 21 | [WARN] plugin node is not installed 22 | ``` 23 | -------------------------------------------------------------------------------- /docs/cli/doctor/path.md: -------------------------------------------------------------------------------- 1 | # `mise doctor path` 2 | 3 | - **Usage**: `mise doctor path [-f --full]` 4 | - **Source code**: [`src/cli/doctor/path.rs`](https://github.com/jdx/mise/blob/main/src/cli/doctor/path.rs) 5 | 6 | Print the current PATH entries mise is providing 7 | 8 | ## Flags 9 | 10 | ### `-f --full` 11 | 12 | Print all entries including those not provided by mise 13 | 14 | Examples: 15 | 16 | ``` 17 | Get the current PATH entries mise is providing 18 | $ mise path 19 | /home/user/.local/share/mise/installs/node/24.0.0/bin 20 | /home/user/.local/share/mise/installs/rust/1.90.0/bin 21 | /home/user/.local/share/mise/installs/python/3.10.0/bin 22 | ``` 23 | -------------------------------------------------------------------------------- /docs/cli/en.md: -------------------------------------------------------------------------------- 1 | # `mise en` 2 | 3 | - **Usage**: `mise en [-s --shell ] [DIR]` 4 | - **Source code**: [`src/cli/en.rs`](https://github.com/jdx/mise/blob/main/src/cli/en.rs) 5 | 6 | [experimental] starts a new shell with the mise environment built from the current configuration 7 | 8 | This is an alternative to `mise activate` that allows you to explicitly start a mise session. 9 | It will have the tools and environment variables in the configs loaded. 10 | Note that changing directories will not update the mise environment. 11 | 12 | ## Arguments 13 | 14 | ### `[DIR]` 15 | 16 | Directory to start the shell in 17 | 18 | **Default:** `.` 19 | 20 | ## Flags 21 | 22 | ### `-s --shell ` 23 | 24 | Shell to start 25 | 26 | Defaults to $SHELL 27 | 28 | Examples: 29 | 30 | ``` 31 | $ mise en . 32 | $ node -v 33 | v20.0.0 34 | 35 | Skip loading bashrc: 36 | $ mise en -s "bash --norc" 37 | 38 | Skip loading zshrc: 39 | $ mise en -s "zsh -f" 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/cli/fmt.md: -------------------------------------------------------------------------------- 1 | # `mise fmt` 2 | 3 | - **Usage**: `mise fmt [FLAGS]` 4 | - **Source code**: [`src/cli/fmt.rs`](https://github.com/jdx/mise/blob/main/src/cli/fmt.rs) 5 | 6 | Formats mise.toml 7 | 8 | Sorts keys and cleans up whitespace in mise.toml 9 | 10 | ## Flags 11 | 12 | ### `-a --all` 13 | 14 | Format all files from the current directory 15 | 16 | ### `-c --check` 17 | 18 | Check if the configs are formatted, no formatting is done 19 | 20 | ### `-s --stdin` 21 | 22 | Read config from stdin and write its formatted version into stdout 23 | 24 | Examples: 25 | 26 | ``` 27 | mise fmt 28 | ``` 29 | -------------------------------------------------------------------------------- /docs/cli/generate.md: -------------------------------------------------------------------------------- 1 | # `mise generate` 2 | 3 | - **Usage**: `mise generate ` 4 | - **Aliases**: `gen` 5 | - **Source code**: [`src/cli/generate/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/generate/mod.rs) 6 | 7 | [experimental] Generate files for various tools/services 8 | 9 | ## Subcommands 10 | 11 | - [`mise generate bootstrap [FLAGS]`](/cli/generate/bootstrap.md) 12 | - [`mise generate config [-t --tool-versions ] [-o --output ]`](/cli/generate/config.md) 13 | - [`mise generate devcontainer [FLAGS]`](/cli/generate/devcontainer.md) 14 | - [`mise generate git-pre-commit [FLAGS]`](/cli/generate/git-pre-commit.md) 15 | - [`mise generate github-action [FLAGS]`](/cli/generate/github-action.md) 16 | - [`mise generate task-docs [FLAGS]`](/cli/generate/task-docs.md) 17 | - [`mise generate task-stubs [-m --mise-bin ] [-d --dir ]`](/cli/generate/task-stubs.md) 18 | -------------------------------------------------------------------------------- /docs/cli/generate/config.md: -------------------------------------------------------------------------------- 1 | # `mise generate config` 2 | 3 | - **Usage**: `mise generate config [-t --tool-versions ] [-o --output ]` 4 | - **Aliases**: `g` 5 | - **Source code**: [`src/cli/generate/config.rs`](https://github.com/jdx/mise/blob/main/src/cli/generate/config.rs) 6 | 7 | [experimental] Generate a mise.toml file 8 | 9 | ## Flags 10 | 11 | ### `-t --tool-versions ` 12 | 13 | Path to a .tool-versions file to import tools from 14 | 15 | ### `-o --output ` 16 | 17 | Output to file instead of stdout 18 | 19 | Examples: 20 | 21 | ``` 22 | mise cf generate > mise.toml 23 | mise cf generate --output=mise.toml 24 | ``` 25 | -------------------------------------------------------------------------------- /docs/cli/generate/devcontainer.md: -------------------------------------------------------------------------------- 1 | # `mise generate devcontainer` 2 | 3 | - **Usage**: `mise generate devcontainer [FLAGS]` 4 | - **Source code**: [`src/cli/generate/devcontainer.rs`](https://github.com/jdx/mise/blob/main/src/cli/generate/devcontainer.rs) 5 | 6 | [experimental] Generate a devcontainer to execute mise 7 | 8 | ## Flags 9 | 10 | ### `-n --name ` 11 | 12 | The name of the devcontainer 13 | 14 | ### `-i --image ` 15 | 16 | The image to use for the devcontainer 17 | 18 | ### `-m --mount-mise-data` 19 | 20 | Bind the mise-data-volume to the devcontainer 21 | 22 | ### `-w --write` 23 | 24 | write to .devcontainer/devcontainer.json 25 | 26 | Examples: 27 | 28 | ``` 29 | mise generate devcontainer 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/cli/generate/github-action.md: -------------------------------------------------------------------------------- 1 | # `mise generate github-action` 2 | 3 | - **Usage**: `mise generate github-action [FLAGS]` 4 | - **Source code**: [`src/cli/generate/github_action.rs`](https://github.com/jdx/mise/blob/main/src/cli/generate/github_action.rs) 5 | 6 | [experimental] Generate a GitHub Action workflow file 7 | 8 | This command generates a GitHub Action workflow file that runs a mise task like `mise run ci` 9 | when you push changes to your repository. 10 | 11 | ## Flags 12 | 13 | ### `--name ` 14 | 15 | the name of the workflow to generate 16 | 17 | ### `-t --task ` 18 | 19 | The task to run when the workflow is triggered 20 | 21 | ### `-w --write` 22 | 23 | write to .github/workflows/$name.yml 24 | 25 | Examples: 26 | 27 | ``` 28 | mise generate github-action --write --task=ci 29 | git commit -m "feat: add new feature" 30 | git push # runs `mise run ci` on GitHub 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/cli/implode.md: -------------------------------------------------------------------------------- 1 | # `mise implode` 2 | 3 | - **Usage**: `mise implode [--config] [-n --dry-run]` 4 | - **Source code**: [`src/cli/implode.rs`](https://github.com/jdx/mise/blob/main/src/cli/implode.rs) 5 | 6 | Removes mise CLI and all related data 7 | 8 | Skips config directory by default. 9 | 10 | ## Flags 11 | 12 | ### `--config` 13 | 14 | Also remove config directory 15 | 16 | ### `-n --dry-run` 17 | 18 | List directories that would be removed without actually removing them 19 | -------------------------------------------------------------------------------- /docs/cli/install-into.md: -------------------------------------------------------------------------------- 1 | # `mise install-into` 2 | 3 | - **Usage**: `mise install-into ` 4 | - **Source code**: [`src/cli/install_into.rs`](https://github.com/jdx/mise/blob/main/src/cli/install_into.rs) 5 | 6 | Install a tool version to a specific path 7 | 8 | Used for building a tool to a directory for use outside of mise 9 | 10 | ## Arguments 11 | 12 | ### `` 13 | 14 | Tool to install e.g.: node@20 15 | 16 | ### `` 17 | 18 | Path to install the tool into 19 | 20 | Examples: 21 | 22 | ``` 23 | # install node@20.0.0 into ./mynode 24 | $ mise install-into node@20.0.0 ./mynode && ./mynode/bin/node -v 25 | 20.0.0 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/cli/latest.md: -------------------------------------------------------------------------------- 1 | # `mise latest` 2 | 3 | - **Usage**: `mise latest [-i --installed] ` 4 | - **Source code**: [`src/cli/latest.rs`](https://github.com/jdx/mise/blob/main/src/cli/latest.rs) 5 | 6 | Gets the latest available version for a plugin 7 | 8 | Supports prefixes such as `node@20` to get the latest version of node 20. 9 | 10 | ## Arguments 11 | 12 | ### `` 13 | 14 | Tool to get the latest version of 15 | 16 | ## Flags 17 | 18 | ### `-i --installed` 19 | 20 | Show latest installed instead of available version 21 | 22 | Examples: 23 | 24 | ``` 25 | $ mise latest node@20 # get the latest version of node 20 26 | 20.0.0 27 | 28 | $ mise latest node # get the latest stable version of node 29 | 20.0.0 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/cli/ls-remote.md: -------------------------------------------------------------------------------- 1 | # `mise ls-remote` 2 | 3 | - **Usage**: `mise ls-remote [--all] [TOOL@VERSION] [PREFIX]` 4 | - **Source code**: [`src/cli/ls_remote.rs`](https://github.com/jdx/mise/blob/main/src/cli/ls_remote.rs) 5 | 6 | List runtime versions available for install. 7 | 8 | Note that the results may be cached, run `mise cache clean` to clear the cache and get fresh results. 9 | 10 | ## Arguments 11 | 12 | ### `[TOOL@VERSION]` 13 | 14 | Tool to get versions for 15 | 16 | ### `[PREFIX]` 17 | 18 | The version prefix to use when querying the latest version 19 | same as the first argument after the "@" 20 | 21 | ## Flags 22 | 23 | ### `--all` 24 | 25 | Show all installed plugins and versions 26 | 27 | Examples: 28 | 29 | ``` 30 | $ mise ls-remote node 31 | 18.0.0 32 | 20.0.0 33 | 34 | $ mise ls-remote node@20 35 | 20.0.0 36 | 20.1.0 37 | 38 | $ mise ls-remote node 20 39 | 20.0.0 40 | 20.1.0 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/cli/plugins/link.md: -------------------------------------------------------------------------------- 1 | # `mise plugins link` 2 | 3 | - **Usage**: `mise plugins link [-f --force] [DIR]` 4 | - **Aliases**: `ln` 5 | - **Source code**: [`src/cli/plugins/link.rs`](https://github.com/jdx/mise/blob/main/src/cli/plugins/link.rs) 6 | 7 | Symlinks a plugin into mise 8 | 9 | This is used for developing a plugin. 10 | 11 | ## Arguments 12 | 13 | ### `` 14 | 15 | The name of the plugin 16 | e.g.: node, ruby 17 | 18 | ### `[DIR]` 19 | 20 | The local path to the plugin 21 | e.g.: ./mise-node 22 | 23 | ## Flags 24 | 25 | ### `-f --force` 26 | 27 | Overwrite existing plugin 28 | 29 | Examples: 30 | 31 | ``` 32 | # essentially just `ln -s ./mise-node ~/.local/share/mise/plugins/node` 33 | $ mise plugins link node ./mise-node 34 | 35 | # infer plugin name as "node" 36 | $ mise plugins link ./mise-node 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/cli/plugins/ls-remote.md: -------------------------------------------------------------------------------- 1 | # `mise plugins ls-remote` 2 | 3 | - **Usage**: `mise plugins ls-remote [-u --urls] [--only-names]` 4 | - **Aliases**: `list-remote`, `list-all` 5 | - **Source code**: [`src/cli/plugins/ls_remote.rs`](https://github.com/jdx/mise/blob/main/src/cli/plugins/ls_remote.rs) 6 | 7 | List all available remote plugins 8 | 9 | The full list is here: 10 | 11 | Examples: 12 | 13 | ``` 14 | mise plugins ls-remote 15 | ``` 16 | 17 | ## Flags 18 | 19 | ### `-u --urls` 20 | 21 | Show the git url for each plugin e.g.: 22 | 23 | ### `--only-names` 24 | 25 | Only show the name of each plugin by default it will show a "*" next to installed plugins 26 | -------------------------------------------------------------------------------- /docs/cli/plugins/ls.md: -------------------------------------------------------------------------------- 1 | # `mise plugins ls` 2 | 3 | - **Usage**: `mise plugins ls [-u --urls]` 4 | - **Aliases**: `list` 5 | - **Source code**: [`src/cli/plugins/ls.rs`](https://github.com/jdx/mise/blob/main/src/cli/plugins/ls.rs) 6 | 7 | List installed plugins 8 | 9 | Can also show remotely available plugins to install. 10 | 11 | ## Flags 12 | 13 | ### `-u --urls` 14 | 15 | Show the git url for each plugin 16 | e.g.: 17 | 18 | Examples: 19 | 20 | ``` 21 | $ mise plugins ls 22 | node 23 | ruby 24 | 25 | $ mise plugins ls --urls 26 | node https://github.com/asdf-vm/asdf-nodejs.git 27 | ruby https://github.com/asdf-vm/asdf-ruby.git 28 | ``` 29 | -------------------------------------------------------------------------------- /docs/cli/plugins/uninstall.md: -------------------------------------------------------------------------------- 1 | # `mise plugins uninstall` 2 | 3 | - **Usage**: `mise plugins uninstall [-p --purge] [-a --all] [PLUGIN]…` 4 | - **Aliases**: `remove`, `rm` 5 | - **Source code**: [`src/cli/plugins/uninstall.rs`](https://github.com/jdx/mise/blob/main/src/cli/plugins/uninstall.rs) 6 | 7 | Removes a plugin 8 | 9 | ## Arguments 10 | 11 | ### `[PLUGIN]…` 12 | 13 | Plugin(s) to remove 14 | 15 | ## Flags 16 | 17 | ### `-p --purge` 18 | 19 | Also remove the plugin's installs, downloads, and cache 20 | 21 | ### `-a --all` 22 | 23 | Remove all plugins 24 | 25 | Examples: 26 | 27 | ``` 28 | mise uninstall node 29 | ``` 30 | -------------------------------------------------------------------------------- /docs/cli/plugins/update.md: -------------------------------------------------------------------------------- 1 | # `mise plugins update` 2 | 3 | - **Usage**: `mise plugins update [-j --jobs ] [PLUGIN]…` 4 | - **Aliases**: `up`, `upgrade` 5 | - **Source code**: [`src/cli/plugins/update.rs`](https://github.com/jdx/mise/blob/main/src/cli/plugins/update.rs) 6 | 7 | Updates a plugin to the latest version 8 | 9 | note: this updates the plugin itself, not the runtime versions 10 | 11 | ## Arguments 12 | 13 | ### `[PLUGIN]…` 14 | 15 | Plugin(s) to update 16 | 17 | ## Flags 18 | 19 | ### `-j --jobs ` 20 | 21 | Number of jobs to run in parallel 22 | Default: 4 23 | 24 | Examples: 25 | 26 | ``` 27 | mise plugins update # update all plugins 28 | mise plugins update node # update only node 29 | mise plugins update node#beta # specify a ref 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/cli/registry.md: -------------------------------------------------------------------------------- 1 | # `mise registry` 2 | 3 | - **Usage**: `mise registry [-b --backend ] [--hide-aliased] [NAME]` 4 | - **Source code**: [`src/cli/registry.rs`](https://github.com/jdx/mise/blob/main/src/cli/registry.rs) 5 | 6 | List available tools to install 7 | 8 | This command lists the tools available in the registry as shorthand names. 9 | 10 | For example, `poetry` is shorthand for `asdf:mise-plugins/mise-poetry`. 11 | 12 | ## Arguments 13 | 14 | ### `[NAME]` 15 | 16 | Show only the specified tool's full name 17 | 18 | ## Flags 19 | 20 | ### `-b --backend ` 21 | 22 | Show only tools for this backend 23 | 24 | ### `--hide-aliased` 25 | 26 | Hide aliased tools 27 | 28 | Examples: 29 | 30 | ``` 31 | $ mise registry 32 | node core:node 33 | poetry asdf:mise-plugins/mise-poetry 34 | ubi cargo:ubi-cli 35 | 36 | $ mise registry poetry 37 | asdf:mise-plugins/mise-poetry 38 | ``` 39 | -------------------------------------------------------------------------------- /docs/cli/self-update.md: -------------------------------------------------------------------------------- 1 | # `mise self-update` 2 | 3 | - **Usage**: `mise self-update [FLAGS] [VERSION]` 4 | - **Source code**: [`src/cli/self_update.rs`](https://github.com/jdx/mise/blob/main/src/cli/self_update.rs) 5 | 6 | Updates mise itself. 7 | 8 | Uses the GitHub Releases API to find the latest release and binary. 9 | By default, this will also update any installed plugins. 10 | Uses the `GITHUB_API_TOKEN` environment variable if set for higher rate limits. 11 | 12 | This command is not available if mise is installed via a package manager. 13 | 14 | ## Arguments 15 | 16 | ### `[VERSION]` 17 | 18 | Update to a specific version 19 | 20 | ## Flags 21 | 22 | ### `-f --force` 23 | 24 | Update even if already up to date 25 | 26 | ### `--no-plugins` 27 | 28 | Disable auto-updating plugins 29 | 30 | ### `-y --yes` 31 | 32 | Skip confirmation prompt 33 | -------------------------------------------------------------------------------- /docs/cli/set.md: -------------------------------------------------------------------------------- 1 | # `mise set` 2 | 3 | - **Usage**: `mise set [--file ] [-g --global] [ENV_VAR]…` 4 | - **Source code**: [`src/cli/set.rs`](https://github.com/jdx/mise/blob/main/src/cli/set.rs) 5 | 6 | Set environment variables in mise.toml 7 | 8 | By default, this command modifies `mise.toml` in the current directory. 9 | 10 | ## Arguments 11 | 12 | ### `[ENV_VAR]…` 13 | 14 | Environment variable(s) to set 15 | e.g.: NODE_ENV=production 16 | 17 | ## Flags 18 | 19 | ### `--file ` 20 | 21 | The TOML file to update 22 | 23 | Defaults to MISE_DEFAULT_CONFIG_FILENAME environment variable, or `mise.toml`. 24 | 25 | ### `-g --global` 26 | 27 | Set the environment variable in the global config file 28 | 29 | Examples: 30 | 31 | ``` 32 | $ mise set NODE_ENV=production 33 | 34 | $ mise set NODE_ENV 35 | production 36 | 37 | $ mise set 38 | key value source 39 | NODE_ENV production ~/.config/mise/config.toml 40 | ``` 41 | -------------------------------------------------------------------------------- /docs/cli/settings/add.md: -------------------------------------------------------------------------------- 1 | # `mise settings add` 2 | 3 | - **Usage**: `mise settings add [-l --local] ` 4 | - **Source code**: [`src/cli/settings/add.rs`](https://github.com/jdx/mise/blob/main/src/cli/settings/add.rs) 5 | 6 | Adds a setting to the configuration file 7 | 8 | Used with an array setting, this will append the value to the array. 9 | This modifies the contents of ~/.config/mise/config.toml 10 | 11 | ## Arguments 12 | 13 | ### `` 14 | 15 | The setting to set 16 | 17 | ### `` 18 | 19 | The value to set 20 | 21 | ## Flags 22 | 23 | ### `-l --local` 24 | 25 | Use the local config file instead of the global one 26 | 27 | Examples: 28 | 29 | ``` 30 | mise settings add disable_hints python_multi 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/cli/settings/get.md: -------------------------------------------------------------------------------- 1 | # `mise settings get` 2 | 3 | - **Usage**: `mise settings get [-l --local] ` 4 | - **Source code**: [`src/cli/settings/get.rs`](https://github.com/jdx/mise/blob/main/src/cli/settings/get.rs) 5 | 6 | Show a current setting 7 | 8 | This is the contents of a single entry in ~/.config/mise/config.toml 9 | 10 | Note that aliases are also stored in this file 11 | but managed separately with `mise aliases get` 12 | 13 | ## Arguments 14 | 15 | ### `` 16 | 17 | The setting to show 18 | 19 | ## Flags 20 | 21 | ### `-l --local` 22 | 23 | Use the local config file instead of the global one 24 | 25 | Examples: 26 | 27 | ``` 28 | $ mise settings get idiomatic_version_file 29 | true 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/cli/settings/set.md: -------------------------------------------------------------------------------- 1 | # `mise settings set` 2 | 3 | - **Usage**: `mise settings set [-l --local] ` 4 | - **Aliases**: `create` 5 | - **Source code**: [`src/cli/settings/set.rs`](https://github.com/jdx/mise/blob/main/src/cli/settings/set.rs) 6 | 7 | Add/update a setting 8 | 9 | This modifies the contents of ~/.config/mise/config.toml 10 | 11 | ## Arguments 12 | 13 | ### `` 14 | 15 | The setting to set 16 | 17 | ### `` 18 | 19 | The value to set 20 | 21 | ## Flags 22 | 23 | ### `-l --local` 24 | 25 | Use the local config file instead of the global one 26 | 27 | Examples: 28 | 29 | ``` 30 | mise settings idiomatic_version_file=true 31 | ``` 32 | -------------------------------------------------------------------------------- /docs/cli/settings/unset.md: -------------------------------------------------------------------------------- 1 | # `mise settings unset` 2 | 3 | - **Usage**: `mise settings unset [-l --local] ` 4 | - **Aliases**: `rm`, `remove`, `delete`, `del` 5 | - **Source code**: [`src/cli/settings/unset.rs`](https://github.com/jdx/mise/blob/main/src/cli/settings/unset.rs) 6 | 7 | Clears a setting 8 | 9 | This modifies the contents of ~/.config/mise/config.toml 10 | 11 | ## Arguments 12 | 13 | ### `` 14 | 15 | The setting to remove 16 | 17 | ## Flags 18 | 19 | ### `-l --local` 20 | 21 | Use the local config file instead of the global one 22 | 23 | Examples: 24 | 25 | ``` 26 | mise settings unset idiomatic_version_file 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/cli/sync.md: -------------------------------------------------------------------------------- 1 | # `mise sync` 2 | 3 | - **Usage**: `mise sync ` 4 | - **Source code**: [`src/cli/sync/mod.rs`](https://github.com/jdx/mise/blob/main/src/cli/sync/mod.rs) 5 | 6 | Synchronize tools from other version managers with mise 7 | 8 | ## Subcommands 9 | 10 | - [`mise sync node [FLAGS]`](/cli/sync/node.md) 11 | - [`mise sync python [--pyenv] [--uv]`](/cli/sync/python.md) 12 | - [`mise sync ruby [--brew]`](/cli/sync/ruby.md) 13 | -------------------------------------------------------------------------------- /docs/cli/sync/node.md: -------------------------------------------------------------------------------- 1 | # `mise sync node` 2 | 3 | - **Usage**: `mise sync node [FLAGS]` 4 | - **Source code**: [`src/cli/sync/node.rs`](https://github.com/jdx/mise/blob/main/src/cli/sync/node.rs) 5 | 6 | Symlinks all tool versions from an external tool into mise 7 | 8 | For example, use this to import all Homebrew node installs into mise 9 | 10 | This won't overwrite any existing installs but will overwrite any existing symlinks 11 | 12 | ## Flags 13 | 14 | ### `--brew` 15 | 16 | Get tool versions from Homebrew 17 | 18 | ### `--nvm` 19 | 20 | Get tool versions from nvm 21 | 22 | ### `--nodenv` 23 | 24 | Get tool versions from nodenv 25 | 26 | Examples: 27 | 28 | ``` 29 | brew install node@18 node@20 30 | mise sync node --brew 31 | mise use -g node@18 - uses Homebrew-provided node 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/cli/sync/python.md: -------------------------------------------------------------------------------- 1 | # `mise sync python` 2 | 3 | - **Usage**: `mise sync python [--pyenv] [--uv]` 4 | - **Source code**: [`src/cli/sync/python.rs`](https://github.com/jdx/mise/blob/main/src/cli/sync/python.rs) 5 | 6 | Symlinks all tool versions from an external tool into mise 7 | 8 | For example, use this to import all pyenv installs into mise 9 | 10 | This won't overwrite any existing installs but will overwrite any existing symlinks 11 | 12 | ## Flags 13 | 14 | ### `--pyenv` 15 | 16 | Get tool versions from pyenv 17 | 18 | ### `--uv` 19 | 20 | Sync tool versions with uv (2-way sync) 21 | 22 | Examples: 23 | 24 | ``` 25 | pyenv install 3.11.0 26 | mise sync python --pyenv 27 | mise use -g python@3.11.0 - uses pyenv-provided python 28 | 29 | uv python install 3.11.0 30 | mise install python@3.10.0 31 | mise sync python --uv 32 | mise x python@3.11.0 -- python -V - uses uv-provided python 33 | uv run -p 3.10.0 -- python -V - uses mise-provided python 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/cli/sync/ruby.md: -------------------------------------------------------------------------------- 1 | # `mise sync ruby` 2 | 3 | - **Usage**: `mise sync ruby [--brew]` 4 | - **Source code**: [`src/cli/sync/ruby.rs`](https://github.com/jdx/mise/blob/main/src/cli/sync/ruby.rs) 5 | 6 | Symlinks all ruby tool versions from an external tool into mise 7 | 8 | ## Flags 9 | 10 | ### `--brew` 11 | 12 | Get tool versions from Homebrew 13 | 14 | Examples: 15 | 16 | ``` 17 | brew install ruby 18 | mise sync ruby --brew 19 | mise use -g ruby - Use the latest version of Ruby installed by Homebrew 20 | ``` 21 | -------------------------------------------------------------------------------- /docs/cli/tasks/deps.md: -------------------------------------------------------------------------------- 1 | # `mise tasks deps` 2 | 3 | - **Usage**: `mise tasks deps [--hidden] [--dot] [TASKS]…` 4 | - **Source code**: [`src/cli/tasks/deps.rs`](https://github.com/jdx/mise/blob/main/src/cli/tasks/deps.rs) 5 | 6 | Display a tree visualization of a dependency graph 7 | 8 | ## Arguments 9 | 10 | ### `[TASKS]…` 11 | 12 | Tasks to show dependencies for 13 | Can specify multiple tasks by separating with spaces 14 | e.g.: mise tasks deps lint test check 15 | 16 | ## Flags 17 | 18 | ### `--hidden` 19 | 20 | Show hidden tasks 21 | 22 | ### `--dot` 23 | 24 | Display dependencies in DOT format 25 | 26 | Examples: 27 | 28 | ``` 29 | # Show dependencies for all tasks 30 | $ mise tasks deps 31 | 32 | # Show dependencies for the "lint", "test" and "check" tasks 33 | $ mise tasks deps lint test check 34 | 35 | # Show dependencies in DOT format 36 | $ mise tasks deps --dot 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/cli/tasks/edit.md: -------------------------------------------------------------------------------- 1 | # `mise tasks edit` 2 | 3 | - **Usage**: `mise tasks edit [-p --path] ` 4 | - **Source code**: [`src/cli/tasks/edit.rs`](https://github.com/jdx/mise/blob/main/src/cli/tasks/edit.rs) 5 | 6 | Edit a tasks with $EDITOR 7 | 8 | The tasks will be created as a standalone script if it does not already exist. 9 | 10 | ## Arguments 11 | 12 | ### `` 13 | 14 | Tasks to edit 15 | 16 | ## Flags 17 | 18 | ### `-p --path` 19 | 20 | Display the path to the tasks instead of editing it 21 | 22 | Examples: 23 | 24 | ``` 25 | mise tasks edit build 26 | mise tasks edit test 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/cli/test-tool.md: -------------------------------------------------------------------------------- 1 | # `mise test-tool` 2 | 3 | - **Usage**: `mise test-tool [FLAGS] [TOOL]` 4 | - **Source code**: [`src/cli/test_tool.rs`](https://github.com/jdx/mise/blob/main/src/cli/test_tool.rs) 5 | 6 | Test a tool installs and executes 7 | 8 | ## Arguments 9 | 10 | ### `[TOOL]` 11 | 12 | Tool name to test 13 | 14 | ## Flags 15 | 16 | ### `-a --all` 17 | 18 | Test every tool specified in registry.toml 19 | 20 | ### `--all-config` 21 | 22 | Test all tools specified in config files 23 | 24 | ### `--include-non-defined` 25 | 26 | Also test tools not defined in registry.toml, guessing how to test it 27 | 28 | ### `-j --jobs ` 29 | 30 | Number of jobs to run in parallel 31 | [default: 4] 32 | 33 | ### `--raw` 34 | 35 | Directly pipe stdin/stdout/stderr from plugin to user Sets --jobs=1 36 | 37 | Examples: 38 | 39 | ``` 40 | mise test-tool ripgrep 41 | ``` 42 | -------------------------------------------------------------------------------- /docs/cli/uninstall.md: -------------------------------------------------------------------------------- 1 | # `mise uninstall` 2 | 3 | - **Usage**: `mise uninstall [-a --all] [-n --dry-run] [INSTALLED_TOOL@VERSION]…` 4 | - **Source code**: [`src/cli/uninstall.rs`](https://github.com/jdx/mise/blob/main/src/cli/uninstall.rs) 5 | 6 | Removes installed tool versions 7 | 8 | This only removes the installed version, it does not modify mise.toml. 9 | 10 | ## Arguments 11 | 12 | ### `[INSTALLED_TOOL@VERSION]…` 13 | 14 | Tool(s) to remove 15 | 16 | ## Flags 17 | 18 | ### `-a --all` 19 | 20 | Delete all installed versions 21 | 22 | ### `-n --dry-run` 23 | 24 | Do not actually delete anything 25 | 26 | Examples: 27 | 28 | ``` 29 | # will uninstall specific version 30 | $ mise uninstall node@18.0.0 31 | 32 | # will uninstall the current node version (if only one version is installed) 33 | $ mise uninstall node 34 | 35 | # will uninstall all installed versions of node 36 | $ mise uninstall --all node@18.0.0 # will uninstall all node versions 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/cli/unset.md: -------------------------------------------------------------------------------- 1 | # `mise unset` 2 | 3 | - **Usage**: `mise unset [-f --file ] [-g --global] [ENV_KEY]…` 4 | - **Source code**: [`src/cli/unset.rs`](https://github.com/jdx/mise/blob/main/src/cli/unset.rs) 5 | 6 | Remove environment variable(s) from the config file. 7 | 8 | By default, this command modifies `mise.toml` in the current directory. 9 | 10 | ## Arguments 11 | 12 | ### `[ENV_KEY]…` 13 | 14 | Environment variable(s) to remove 15 | e.g.: NODE_ENV 16 | 17 | ## Flags 18 | 19 | ### `-f --file ` 20 | 21 | Specify a file to use instead of `mise.toml` 22 | 23 | ### `-g --global` 24 | 25 | Use the global config file 26 | 27 | Examples: 28 | 29 | ``` 30 | # Remove NODE_ENV from the current directory's config 31 | $ mise unset NODE_ENV 32 | 33 | # Remove NODE_ENV from the global config 34 | $ mise unset NODE_ENV -g 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/cli/version.md: -------------------------------------------------------------------------------- 1 | # `mise version` 2 | 3 | - **Usage**: `mise version [-J --json]` 4 | - **Aliases**: `v` 5 | - **Source code**: [`src/cli/version.rs`](https://github.com/jdx/mise/blob/main/src/cli/version.rs) 6 | 7 | Display the version of mise 8 | 9 | Displays the version, os, architecture, and the date of the build. 10 | 11 | If the version is out of date, it will display a warning. 12 | 13 | ## Flags 14 | 15 | ### `-J --json` 16 | 17 | Print the version information in JSON format 18 | 19 | Examples: 20 | 21 | ``` 22 | mise version 23 | mise --version 24 | mise -v 25 | mise -V 26 | ``` 27 | -------------------------------------------------------------------------------- /docs/cli/where.md: -------------------------------------------------------------------------------- 1 | # `mise where` 2 | 3 | - **Usage**: `mise where ` 4 | - **Source code**: [`src/cli/where.rs`](https://github.com/jdx/mise/blob/main/src/cli/where.rs) 5 | 6 | Display the installation path for a tool 7 | 8 | The tool must be installed for this to work. 9 | 10 | ## Arguments 11 | 12 | ### `` 13 | 14 | Tool(s) to look up 15 | e.g.: ruby@3 16 | if "@<PREFIX>" is specified, it will show the latest installed version 17 | that matches the prefix 18 | otherwise, it will show the current, active installed version 19 | 20 | Examples: 21 | 22 | ``` 23 | # Show the latest installed version of node 24 | # If it is is not installed, errors 25 | $ mise where node@20 26 | /home/jdx/.local/share/mise/installs/node/20.0.0 27 | 28 | # Show the current, active install directory of node 29 | # Errors if node is not referenced in any .tool-version file 30 | $ mise where node 31 | /home/jdx/.local/share/mise/installs/node/20.0.0 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/cli/which.md: -------------------------------------------------------------------------------- 1 | # `mise which` 2 | 3 | - **Usage**: `mise which [FLAGS] [BIN_NAME]` 4 | - **Source code**: [`src/cli/which.rs`](https://github.com/jdx/mise/blob/main/src/cli/which.rs) 5 | 6 | Shows the path that a tool's bin points to. 7 | 8 | Use this to figure out what version of a tool is currently active. 9 | 10 | ## Arguments 11 | 12 | ### `[BIN_NAME]` 13 | 14 | The bin to look up 15 | 16 | ## Flags 17 | 18 | ### `--plugin` 19 | 20 | Show the plugin name instead of the path 21 | 22 | ### `--version` 23 | 24 | Show the version instead of the path 25 | 26 | ### `-t --tool ` 27 | 28 | Use a specific tool@version 29 | e.g.: `mise which npm --tool=node@20` 30 | 31 | Examples: 32 | 33 | ``` 34 | $ mise which node 35 | /home/username/.local/share/mise/installs/node/20.0.0/bin/node 36 | 37 | $ mise which node --plugin 38 | node 39 | 40 | $ mise which node --version 41 | 20.0.0 42 | ``` 43 | -------------------------------------------------------------------------------- /docs/configuration/settings.md: -------------------------------------------------------------------------------- 1 | # Settings 2 | 3 | 6 | 7 | The following is a list of all of mise's settings. These can be set via `mise settings key=value`, 8 | by directly modifying `~/.config/mise/config.toml` or local config, or via environment variables. 9 | 10 | Some of them also can be set via global CLI flags. 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/contact.md: -------------------------------------------------------------------------------- 1 | # Contact 2 | 3 | `mise` is mostly built and maintained by me, [Jeff Dickey](https://jdx.dev). The goal is 4 | to make local development of software easy and consistent across languages. I 5 | have spent many years building dev tools and thinking about the problems that `mise` 6 | addresses. 7 | 8 | I try to use the first-person in these docs since the reality is it's generally me 9 | writing them and I think it makes it more interesting having a bit of my personality 10 | in the text. 11 | 12 | This project is simply a labor of love. I am making it because I want to make 13 | your life as a developer easier. I hope you find it useful. Feedback is a massive 14 | driver for me. If you have anything positive or negative to say-even if it's just 15 | to say hi-please reach out to me either on [Twitter](https://twitter.com/jdxcode), 16 | [Mastodon](https://fosstodon.org/@jdx), [Discord](https://discord.gg/UBa7pJUN7Z), 17 | or `jdx at this domain`. 18 | -------------------------------------------------------------------------------- /docs/core-tools.md: -------------------------------------------------------------------------------- 1 | # Core Tools 2 | 3 | `mise` comes with some plugins built into the CLI written in Rust. These are new and will improve over 4 | time. 5 | 6 | They can be easily overridden by installing an asdf/vfox plugin with the same name, e.g.: `mise plugin install python https://github.com/asdf-community/asdf-python`. 7 | 8 | You can see the core plugins with `mise registry -b core`. 9 | 10 | - [Bun](/lang/bun) 11 | - [Deno](/lang/deno) 12 | - [Elixir](/lang/elixir) 13 | - [Erlang](/lang/erlang) 14 | - [Go](/lang/go) 15 | - [Java](/lang/java) 16 | - [NodeJS](/lang/node) 17 | - [Python](/lang/python) 18 | - [Ruby](/lang/ruby) 19 | - [Rust](/lang/rust) 20 | - [Swift](/lang/swift) 21 | - [Zig](/lang/zig) 22 | -------------------------------------------------------------------------------- /docs/errors.md: -------------------------------------------------------------------------------- 1 | # Errors 2 | 3 | TODO 4 | -------------------------------------------------------------------------------- /docs/intellij-sdk-selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/intellij-sdk-selection.png -------------------------------------------------------------------------------- /docs/lang/bun.md: -------------------------------------------------------------------------------- 1 | # Bun 2 | 3 | `mise` can be used to install and manage multiple versions of [bun](https://bun.sh/) on the same system. 4 | 5 | > The following are instructions for using the bun mise core plugin. This is used when there isn't a 6 | > git plugin installed named "bun". 7 | 8 | The code for this is inside the mise repository at 9 | [`./src/plugins/core/bun.rs`](https://github.com/jdx/mise/blob/main/src/plugins/core/bun.rs). 10 | 11 | ## Usage 12 | 13 | The following installs bun and makes it the global default: 14 | 15 | ```sh 16 | mise use -g bun@0.7 # install bun 0.7.x 17 | mise use -g bun@latest # install latest bun 18 | ``` 19 | 20 | See available versions with `mise ls-remote bun`. 21 | 22 | > [!NOTE] 23 | > Avoid using `bun upgrade` to upgrade bun as `mise` will not be aware of the change. 24 | -------------------------------------------------------------------------------- /docs/lang/elixir.md: -------------------------------------------------------------------------------- 1 | # Elixir 2 | 3 | `mise` can be used to manage multiple [`elixir`](https://elixir-lang.org/) versions on the same system. 4 | 5 | > The following are instructions for using the elixir core plugin. This is used when there isn't a git plugin installed named "elixir". 6 | 7 | The code for this is inside the mise repository at 8 | [`./src/plugins/core/elixir.rs`](https://github.com/jdx/mise/blob/main/src/plugins/core/elixir.rs). 9 | 10 | ## Usage 11 | 12 | Use the latest stable version of elixir: 13 | 14 | ```sh 15 | mise use -g erlang elixir 16 | ``` 17 | 18 | Note that [`erlang`](/lang/erlang.html) is required to install `elixir`. 19 | -------------------------------------------------------------------------------- /docs/lang/swift.md: -------------------------------------------------------------------------------- 1 | # Swift 2 | 3 | `mise` can be used to manage multiple versions of [`swift`](https://swift.org/) on the same system. Swift is supported for macos and linux. 4 | 5 | ## Usage 6 | 7 | Use the latest stable version of swift: 8 | 9 | ```sh 10 | mise use -g swift 11 | swift --version 12 | ``` 13 | 14 | See [a mise guide for Swift developers](https://tuist.dev/blog/2025/02/04/mise) on how to use `mise` with `swift`. 15 | 16 | ## Settings 17 | 18 | 21 | 22 | -------------------------------------------------------------------------------- /docs/lefthook.yml: -------------------------------------------------------------------------------- 1 | pre-commit: 2 | commands: 3 | build: 4 | glob: "*" 5 | run: npm run docs:build 6 | interactive: true 7 | -------------------------------------------------------------------------------- /docs/logo-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/logo-dark.png -------------------------------------------------------------------------------- /docs/logo-dark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/logo-dark@2x.png -------------------------------------------------------------------------------- /docs/logo-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/logo-light.png -------------------------------------------------------------------------------- /docs/logo-light@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/logo-light@2x.png -------------------------------------------------------------------------------- /docs/mise-cookbook/index.md: -------------------------------------------------------------------------------- 1 | # Cookbook 2 | 3 | Here we are sharing a few mise setups that other people have found useful. 4 | 5 | - [C++](cpp.md) 6 | - [Docker](docker.md) 7 | - [Node.JS](nodejs.md) 8 | - [Python](python.md) 9 | - [Ruby](ruby.md) 10 | - [Terraform](terraform.md) 11 | - [Neovim](neovim.md) 12 | 13 | Finally, here is how to create [presets](presets.md) and some [shell tricks](shell-tricks.md) you might find useful. 14 | 15 | ## Contributing 16 | 17 | If you would like to share your setup, please share it in this [cookbook thread](https://github.com/jdx/mise/discussions/3645). 18 | -------------------------------------------------------------------------------- /docs/mise-cookbook/ruby.md: -------------------------------------------------------------------------------- 1 | # Mise + Ruby Cookbook 2 | 3 | Here are some tips on managing Ruby projects with mise. 4 | 5 | ## A Ruby on Rails Project 6 | 7 | ```toml [mise.toml] 8 | min_version = "2024.9.5" 9 | 10 | [env] 11 | # Project information 12 | PROJECT_NAME = "{{ config_root | basename }}" 13 | 14 | [tools] 15 | # Install Ruby with the specified version 16 | ruby = "{{ get_env(name='RUBY_VERSION', default='3.3.3') }}" 17 | 18 | [tasks."bundle:install"] 19 | description = "Install gem dependencies" 20 | run = "bundle install" 21 | 22 | [tasks.server] 23 | description = "Start the Rails server" 24 | alias = "s" 25 | run = "rails server" 26 | 27 | [tasks.test] 28 | description = "Run tests" 29 | alias = "t" 30 | run = "rails test" 31 | 32 | [tasks.lint] 33 | description = "Run lint using Rubocop" 34 | alias = "l" 35 | run = "rubocop" 36 | ``` 37 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mise/docs", 3 | "private": true, 4 | "type": "module", 5 | "devDependencies": { 6 | "vitepress": "1.6.3" 7 | }, 8 | "scripts": { 9 | "docs:dev": "vitepress dev", 10 | "docs:build": "vitepress build", 11 | "docs:preview": "vitepress preview" 12 | }, 13 | "dependencies": { 14 | "@types/markdown-it": "^14.1.2", 15 | "js-toml": "^1.0.1", 16 | "markdown-it": "^14.1.0", 17 | "vitepress-plugin-group-icons": "^1.3.5", 18 | "vitepress-plugin-tabs": "^0.7.0" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/public/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/public/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/public/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/public/android-chrome-512x512.png -------------------------------------------------------------------------------- /docs/public/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/public/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/public/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/public/favicon-16x16.png -------------------------------------------------------------------------------- /docs/public/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/public/favicon-32x32.png -------------------------------------------------------------------------------- /docs/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/public/favicon.ico -------------------------------------------------------------------------------- /docs/public/site.webmanifest: -------------------------------------------------------------------------------- 1 | {"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} 2 | -------------------------------------------------------------------------------- /docs/registry.toml: -------------------------------------------------------------------------------- 1 | ../registry.toml -------------------------------------------------------------------------------- /docs/settings.toml: -------------------------------------------------------------------------------- 1 | ../settings.toml -------------------------------------------------------------------------------- /docs/shims-intellij.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/shims-intellij.png -------------------------------------------------------------------------------- /docs/shims-vscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/shims-vscode.png -------------------------------------------------------------------------------- /docs/tapes/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/tapes/demo.gif -------------------------------------------------------------------------------- /docs/tapes/demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/docs/tapes/demo.mp4 -------------------------------------------------------------------------------- /docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "esnext", 4 | "target": "esnext", 5 | "moduleResolution": "bundler", 6 | "esModuleInterop": true, 7 | "strict": true, 8 | "skipLibCheck": true, 9 | "noUnusedLocals": true, 10 | "resolveJsonModule": true, 11 | "verbatimModuleSyntax": true, 12 | "jsx": "preserve", 13 | "lib": ["esnext", "dom", "dom.iterable"] 14 | }, 15 | "exclude": [ 16 | "**/node_modules/**", 17 | "**/dist/**", 18 | "template", 19 | "bin", 20 | "docs/snippets", 21 | "scripts" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /e2e-win/go.Tests.ps1: -------------------------------------------------------------------------------- 1 | 2 | Describe 'go' { 3 | It 'executes go 1.23.3' { 4 | mise x go@1.23.3 -- where go 5 | mise x go@1.23.3 -- go version | Should -BeLike "go version go1.23.3 windows/*" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /e2e-win/helm.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe 'helm' { 2 | It 'installs helm 3.14.3' { 3 | mise x helm@3.14.3 -- helm version --short | Should -BeLike "v3.14.3*" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /e2e-win/java.Tests.ps1: -------------------------------------------------------------------------------- 1 | 2 | Describe 'java' { 3 | It 'executes java@temurin-21' { 4 | mise x java@temurin-21 -- java --version | Select -Last 1 | Should -BeLike '*Temurin-21.*' 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /e2e-win/node.Tests.ps1: -------------------------------------------------------------------------------- 1 | 2 | Describe 'node' { 3 | It 'executes node 22.0.0' { 4 | mise x node@22.0.0 -- node -v | Should -be "v22.0.0" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /e2e-win/python.Tests.ps1: -------------------------------------------------------------------------------- 1 | 2 | Describe 'python' { 3 | It 'executes python 3.12.0' { 4 | mise x python@3.12.0 -- where python 5 | mise x python@3.12.0 -- python --version | Should -Be "Python 3.12.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /e2e-win/run.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string]$TestName 3 | ) 4 | 5 | $config = New-PesterConfiguration 6 | $config.Run.Path = $PSScriptRoot 7 | $config.Run.Exit = $true 8 | $config.TestResult.Enabled = $true 9 | 10 | if ($TestName) { 11 | $config.Filter.FullName = $TestName 12 | } 13 | 14 | $env:MISE_DEBUG = "1" 15 | $env:PATH = "$PSScriptRoot\..\target\debug;$env:PATH" 16 | 17 | Invoke-Pester -Configuration $config 18 | -------------------------------------------------------------------------------- /e2e-win/rust.Tests.ps1: -------------------------------------------------------------------------------- 1 | 2 | Describe 'rust' { 3 | It 'installs rust 1.83.0' { 4 | $env:MISE_CARGO_HOME = "%TEMP%\.cargo" 5 | $env:MISE_RUSTUP_HOME = "%TEMP%\.rustup" 6 | mise x rust@1.83.0 -- rustc -V | Should -BeLike "rustc 1.83.0*" 7 | Remove-Item Env:MISE_CARGO_HOME 8 | Remove-Item Env:MISE_RUSTUP_HOME 9 | } 10 | 11 | It 'executes rust 1.82.0' { 12 | mise x rust@1.82.0 -- rustc -V | Should -BeLike "rustc 1.82.0*" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /e2e-win/zig.Tests.ps1: -------------------------------------------------------------------------------- 1 | Describe 'zig' { 2 | It 'executes zig 0.13.0' { 3 | mise x zig@0.13.0 -- zig version | Should -be "0.13.0" 4 | } 5 | 6 | It 'executes zig 2024.11.0-mach' { 7 | mise x zig@2024.11.0-mach -- zig version | Should -be "0.14.0-dev.2577+271452d22" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /e2e/.gitignore: -------------------------------------------------------------------------------- 1 | .e2e.mise.toml 2 | .local 3 | .cache 4 | .config 5 | .asdf 6 | .default-go-packages 7 | .venv 8 | ruby/Gemfile 9 | ruby/.ruby-version 10 | Library 11 | /pyproject.toml 12 | /poetry.lock 13 | /test-e2e/ 14 | env.d 15 | source.d 16 | -------------------------------------------------------------------------------- /e2e/backend/test_aqua: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_EXPERIMENTAL=1 4 | 5 | test() { 6 | assert_contains "mise x $1 -- $2" "$3" 7 | } 8 | 9 | test aqua:BurntSushi/ripgrep@14.0.0 "rg --version" "ripgrep 14.0.0" 10 | test age@1.2.0 "age --version" "v1.2.0" 11 | test aqua:helm/helm@3.16.3 "helm version" "v3.16.3" 12 | test aqua:crate-ci/typos@1.27.3 "typos --version" "typos-cli 1.27.3" 13 | -------------------------------------------------------------------------------- /e2e/backend/test_asdf: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise x asdf:jdx/mise-tiny -- mise-tiny" "mise-tiny: v3.1.0" 4 | assert "mise x asdf:https://github.com/jdx/mise-tiny -- mise-tiny" "mise-tiny: v3.1.0" 5 | -------------------------------------------------------------------------------- /e2e/backend/test_asdf_fake_list: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise uninstall --all tiny 4 | mise install tiny@1 tiny@2 5 | mise asdf install tiny 6 | assert "mise asdf list tiny" "1.1.0 7 | 2.1.0 8 | 3.1.0" 9 | -------------------------------------------------------------------------------- /e2e/backend/test_cargo_binstall: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd cargo 3 | 4 | export MISE_CARGO_BINSTALL=1 5 | echo "tools.cargo-binstall = 'latest'" >mise.toml 6 | mise i 7 | assert "mise x cargo:eza@0.18.24 -- eza -v" "eza - A modern, maintained replacement for ls 8 | v0.18.24 [+git] 9 | https://github.com/eza-community/eza" 10 | 11 | export MISE_CARGO_BINSTALL_ONLY=1 12 | cat >mise.toml <~/bin/cargo-binstall <<'EOF' 7 | #!/usr/bin/env bash 8 | echo "token=$GITHUB_TOKEN" 9 | EOF 10 | chmod u+x ~/bin/cargo-binstall 11 | export PATH="$HOME/bin:$PATH" 12 | 13 | # This should reuse the existing GITHUB_TOKEN variable 14 | assert_contains "GITHUB_TOKEN=foobar mise install -f cargo:eza@0.18.24 2>&1" "token=foobar" 15 | 16 | # This should use the GITHUB_API_TOKEN variable 17 | assert_contains "GITHUB_API_TOKEN=foobar mise install -f cargo:eza@0.18.24 2>&1" "token=foobar" 18 | 19 | # This should prefer GITHUB_API_TOKEN 20 | assert_contains "GITHUB_API_TOKEN=foobar GITHUB_TOKEN=barquz mise install -f cargo:eza@0.18.24 2>&1" "token=foobar" 21 | -------------------------------------------------------------------------------- /e2e/backend/test_cargo_compile_git_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd cargo 3 | 4 | assert "mise x cargo:eza-community/eza@tag:v0.18.24 -- eza --version" "eza - A modern, maintained replacement for ls 5 | v0.18.24 [+git] 6 | https://github.com/eza-community/eza" 7 | -------------------------------------------------------------------------------- /e2e/backend/test_cargo_compile_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd cargo 3 | 4 | export MISE_CARGO_BINSTALL=0 5 | assert "mise x cargo:eza@0.18.24 -- eza -v" "eza - A modern, maintained replacement for ls 6 | v0.18.24 [+git] 7 | https://github.com/eza-community/eza" 8 | -------------------------------------------------------------------------------- /e2e/backend/test_cargo_features: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd cargo 3 | 4 | cat <mise.toml 5 | [tools] 6 | "cargo:cargo-edit" = {version = "0.12.3", default-features = "false", features = "add"} 7 | EOF 8 | 9 | mise i cargo:cargo-edit 10 | # TODO: assert feature is working 11 | # assert "mise x cargo:cargo-edit -- cargo-add" "XXXXXX" 12 | -------------------------------------------------------------------------------- /e2e/backend/test_disable_backends: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export MISE_EXPERIMENTAL=1 3 | 4 | assert "mise registry age" "aqua:FiloSottile/age asdf:threkk/asdf-age" 5 | 6 | mise install age 7 | assert_fail "ls $MISE_DATA_DIR/plugins/age" 8 | mise uninstall age 9 | 10 | MISE_DISABLE_BACKENDS=aqua mise install age 11 | ls "$MISE_DATA_DIR/plugins/age" 12 | mise uninstall age 13 | -------------------------------------------------------------------------------- /e2e/backend/test_dotnet: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if ! command -v dotnet >/dev/null 2>&1; then 4 | echo "dotnet is not installed" 5 | exit 0 6 | fi 7 | 8 | export MISE_EXPERIMENTAL=1 9 | 10 | test() { 11 | assert_contains "mise x $1 -- $2" "$3" 12 | } 13 | 14 | assert_not_contains "mise ls-remote dotnet:GitVersion.Tool" "-beta" 15 | test dotnet:GitVersion.Tool@5.12.0 "dotnet-gitversion /version" "5.12.0+Branch.support-5.x.Sha.3f75764963eb3d7956dcd5a40488c074dd9faf9e" 16 | test dotnet:Husky@0.7.2 "husky --version" "v0.7.2" 17 | 18 | # This command is needed if you want to reexcute the ls-remote command 19 | mise cache clear 20 | 21 | export MISE_DOTNET_PACKAGE_FLAGS="prerelease" 22 | 23 | assert_contains "mise ls-remote dotnet:GitVersion.Tool" "-beta" 24 | -------------------------------------------------------------------------------- /e2e/backend/test_gem_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use ruby 4 | assert "mise x gem:rubocop@1.69.0 -- rubocop --version" "1.69.0" 5 | -------------------------------------------------------------------------------- /e2e/backend/test_npm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd npm 3 | 4 | export NPM_CONFIG_FUND=false 5 | 6 | mise use node 7 | assert "mise x npm:prettier@3.1.0 -- prettier -v" "3.1.0" 8 | assert "FORCE_COLOR=0 mise x npm:@antfu/ni@0.21.12 -- ni -v 2>/dev/null | head -n1" "@antfu/ni v0.21.12" 9 | assert_succeed "mise install npm:tldr@3.4.0" 10 | -------------------------------------------------------------------------------- /e2e/backend/test_npm_bun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat >mise.toml </dev/null | head -n1" "@antfu/ni v0.21.12" 12 | assert_succeed "mise install npm:tldr@3.4.0" 13 | -------------------------------------------------------------------------------- /e2e/backend/test_pipx_direct_dependencies: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd python3 3 | 4 | # Create a system pipx that always fail and push it to the front of PATH 5 | cat >"$HOME/bin/pipx" <<'EOF' 6 | #!/usr/bin/env bash 7 | echo "CALL TO SYSTEM pipx! args: $*" >&2 8 | exit 1 9 | EOF 10 | chmod +x "$HOME"/bin/pipx 11 | export PATH="$HOME/bin:$PATH" 12 | 13 | # Just to be sure... 14 | assert_fail "pipx" 15 | 16 | # Use precompiled python 17 | export MISE_PYTHON_COMPILE=0 18 | 19 | # Set up a 2-step installation: pipx@1.5.0 > pipx:mkdocs@1.6.0 20 | cat >.mise.toml </dev/null; then 6 | ln -s "$(which python3.12)" "$HOME/bin/python3" 7 | fi 8 | 9 | # Create a system pipx that always fail and push it to the front of PATH 10 | cat >"$HOME/bin/pipx" <<'EOF' 11 | #!/usr/bin/env bash 12 | echo "CALL TO SYSTEM pipx! args: $*" >&2 13 | exit 1 14 | EOF 15 | chmod +x "$HOME"/bin/pipx 16 | export PATH="$HOME/bin:$PATH" 17 | 18 | # Just to be sure... 19 | assert_fail "pipx" 20 | 21 | # Use precompiled python 22 | export MISE_PYTHON_COMPILE=0 23 | 24 | # Set up a 2-step installation: pipx@1.5.0 > pipx:mkdocs@1.6.0 25 | cat >.mise.toml <.terraform-version 4 | assert_contains "mise tool terraform" "1.10.0" 5 | -------------------------------------------------------------------------------- /e2e/backend/test_vfox_cmake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise x vfox:cmake@3.30.2 -- cmake --version" "cmake version 3.30.2 4 | 5 | CMake suite maintained and supported by Kitware (kitware.com/cmake)." 6 | -------------------------------------------------------------------------------- /e2e/backend/test_vfox_go: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | version="$(mise latest vfox:version-fox/vfox-golang)" 4 | assert "mise i vfox:version-fox/vfox-golang" 5 | assert_contains "mise x vfox:version-fox/vfox-golang -- go version" "go version go$version" 6 | -------------------------------------------------------------------------------- /e2e/backend/test_vfox_kotlin_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use java 4 | assert_contains "mise x vfox:version-fox/vfox-kotlin@2.0.20 -- kotlin -version" "Kotlin version 2.0.20" 5 | -------------------------------------------------------------------------------- /e2e/backend/test_vfox_maven_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # this is flaky 4 | # mise use java 5 | # assert_contains "mise x vfox:version-fox/vfox-maven@3.9.8 -- mvn --version" "Apache Maven 3.9.8" 6 | -------------------------------------------------------------------------------- /e2e/backend/test_vfox_node_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise i vfox:version-fox/vfox-nodejs@23.2.0 4 | assert "mise x vfox:version-fox/vfox-nodejs@23.2.0 -- node -v" "v23.2.0" 5 | -------------------------------------------------------------------------------- /e2e/backend/test_vfox_python_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise i vfox:version-fox/vfox-python@3.12.0 4 | assert "mise x vfox:version-fox/vfox-python@3.12.0 -- python3 -V" "Python 3.12.0" 5 | -------------------------------------------------------------------------------- /e2e/cli/test_activate_aggressive: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | eval "$(mise activate bash)" 4 | export PATH="/added:$PATH" 5 | 6 | assert "mise hook-env -s bash --trace" "" # checking early exit functions 7 | mkdir -p "$MISE_DATA_DIR/installs/dummy/1.0.0/bin" 8 | echo "#!/usr/bin/env bash" >"$MISE_DATA_DIR/installs/dummy/1.0.0/bin/dummy" 9 | chmod +x "$MISE_DATA_DIR/installs/dummy/1.0.0/bin/dummy" 10 | echo "tools.dummy = '1'" >mise.toml 11 | assert_contains "mise hook-env -s bash --trace" "export PATH='/added:$MISE_DATA_DIR/installs/dummy/1.0.0/bin:" 12 | export MISE_ACTIVATE_AGGRESSIVE=1 13 | assert_contains "mise hook-env -s bash --trace" "export PATH='$MISE_DATA_DIR/installs/dummy/1.0.0/bin:/added:" 14 | -------------------------------------------------------------------------------- /e2e/cli/test_activate_path_safety: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | eval "$(mise activate bash)" && eval "$(mise hook-env)" 4 | install -m 0755 /dev/null "$TMPDIR/MISE_PATH_SAFETY_CHECK" 5 | assert_fail "cd '$TMPDIR' && command -v MISE_PATH_SAFETY_CHECK" 6 | -------------------------------------------------------------------------------- /e2e/cli/test_alias: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise alias set tiny xxx 2" 4 | assert_contains "mise alias ls tiny" "tiny xxx 2" 5 | assert "mise alias unset tiny xxx" 6 | assert_not_contains "mise alias ls" "tiny xxx" 7 | 8 | assert "mise config set alias.nushell aqua:nushell/nushell" 9 | assert "mise x nushell -- nu --version" 10 | -------------------------------------------------------------------------------- /e2e/cli/test_backends: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains "mise backends" "cargo" 4 | -------------------------------------------------------------------------------- /e2e/cli/test_bin_paths: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use dummy@latest tiny@latest 4 | assert "mise bin-paths dummy" "$MISE_DATA_DIR/installs/dummy/2.0.0/bin" 5 | assert "mise bin-paths tiny" "$MISE_DATA_DIR/installs/tiny/3.1.0/bin" 6 | assert "mise bin-paths" "$MISE_DATA_DIR/installs/dummy/2.0.0/bin 7 | $MISE_DATA_DIR/installs/tiny/3.1.0/bin" 8 | -------------------------------------------------------------------------------- /e2e/cli/test_chdir: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mkdir -p ./test 4 | cat <./test/mise.toml 5 | [tasks.hello] 6 | run = 'echo "Hello, World!"' 7 | EOF 8 | 9 | assert_contains "mise config --cd $PWD/test ls" "test/mise.toml" 10 | 11 | assert_contains "mise run --cd $PWD/test hello" "Hello, World!" 12 | assert_contains "mise run --cd ./test hello" "Hello, World!" 13 | assert_contains "mise run --cd test hello" "Hello, World!" 14 | -------------------------------------------------------------------------------- /e2e/cli/test_config_ls: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise set FOO=bar" 4 | assert "mise env" 5 | assert "mise cfg --tracked-configs" "$PWD/mise.toml" 6 | -------------------------------------------------------------------------------- /e2e/cli/test_config_set: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo '[tools.node] 4 | version = "latest"' >mise.toml 5 | 6 | assert "cat mise.toml" '[tools.node] 7 | version = "latest"' 8 | 9 | mise config set tools.node.postinstall 'corepack enable' 10 | assert "mise config get tools.node.postinstall" "corepack enable" 11 | assert "mise config get tools.node.version" "latest" 12 | mise config set env._.python.venv.path '.venv' 13 | assert "mise config get env._.python.venv.path" ".venv" 14 | mise config set env._.python.venv.create true 15 | assert "mise config get env._.python.venv.create" "true" 16 | -------------------------------------------------------------------------------- /e2e/cli/test_current: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise i dummy@3 tiny@2 4 | mise use dummy@3 5 | 6 | assert "mise current" "dummy 3" 7 | assert "mise current dummy" "3" 8 | assert "mise current tiny" "" 9 | -------------------------------------------------------------------------------- /e2e/cli/test_doctor: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use dummy@latest 4 | 5 | eval "$(mise activate bash)" && _mise_hook 6 | assert "PATH="" $(which mise) doctor --json" 7 | 8 | mise p add uv 9 | mise use uv 10 | assert_contains "mise doctor" "asdf:uv@" 11 | assert_contains "mise doctor -J" "dummy" 12 | -------------------------------------------------------------------------------- /e2e/cli/test_exec_chdir: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mkdir direnv 4 | 5 | assert "mise x -C $PWD/direnv -- pwd" "$(pwd)/direnv" 6 | assert "mise x -C ./direnv -- pwd" "$(pwd)/direnv" 7 | assert "mise x -C direnv -- pwd" "$(pwd)/direnv" 8 | -------------------------------------------------------------------------------- /e2e/cli/test_fmt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo '[settings] 4 | idiomatic_version_file_enable_tools = [ 5 | "go", "ruby" 6 | ] 7 | 8 | 9 | 10 | [env] 11 | TEST = "Hello World!" 12 | ' >mise.toml 13 | assert_fail "mise fmt --check" "mise ERROR Following config files are not properly formatted" 14 | 15 | mise fmt 16 | assert "mise fmt --check" 17 | assert "cat mise.toml" '[settings] 18 | idiomatic_version_file_enable_tools = ["go", "ruby"] 19 | 20 | 21 | [env] 22 | TEST = "Hello World!"' 23 | -------------------------------------------------------------------------------- /e2e/cli/test_global: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains "mise global dummy@2.0.0" "~/.config/mise/config.toml" 4 | assert "cat ~/.config/mise/config.toml" '[tools] 5 | dummy = "2.0.0"' 6 | 7 | mise i 8 | assert_contains "mise x -- dummy" "2.0.0" 9 | -------------------------------------------------------------------------------- /e2e/cli/test_global_alt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains "MISE_GLOBAL_CONFIG_FILE=~/.mise.global.toml mise global dummy@latest" "~/.mise.global.toml" 4 | assert "cat ~/.mise.global.toml" '[tools] 5 | dummy = "latest"' 6 | 7 | assert_contains "MISE_GLOBAL_CONFIG_FILE=~/.config/mise/.tool-versions mise global dummy@latest" "~/.config/mise/.tool-versions" 8 | assert "cat ~/.config/mise/.tool-versions" 'dummy latest' 9 | 10 | assert_contains "MISE_ASDF_COMPAT=1 mise global dummy@3" "~/.tool-versions" 11 | assert "cat ~/.tool-versions" 'dummy 3' 12 | -------------------------------------------------------------------------------- /e2e/cli/test_hook_env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise i dummy@{1.0.0,1.1.0,2.0.0} 4 | 5 | eval "$(mise activate bash --status)" 6 | 7 | mise use dummy@2.0.0 8 | pushd .. && popd 9 | assert_contains "dummy" "2.0.0" 10 | 11 | mise shell dummy@1.0.0 12 | pushd .. && popd 13 | assert_contains "dummy" "1.0.0" 14 | 15 | # TODO: make "v" prefixes optional 16 | export MISE_DUMMY_VERSION=1.1.0 17 | pushd .. && popd 18 | assert_contains "dummy" "1.1.0" 19 | -------------------------------------------------------------------------------- /e2e/cli/test_install_into: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise install-into node@22.0.0 ./mynode" 4 | assert "./mynode/bin/node -v" "v22.0.0" 5 | -------------------------------------------------------------------------------- /e2e/cli/test_install_raw: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains 'mise i --raw -f dummy@1 2>&1' "~/.local/share/mise/plugins/dummy/bin/install" 4 | assert_contains 'MISE_RAW=1 mise i -f dummy@1 2>&1' "~/.local/share/mise/plugins/dummy/bin/install" 5 | -------------------------------------------------------------------------------- /e2e/cli/test_link: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise install tiny@1.0.1 tiny@3.1.0 4 | mkdir -p tmp/tiny 5 | mise link tiny@9.8.7 tmp/tiny 6 | 7 | assert_contains "mise ls tiny" "tiny 9.8.7 (symlink)" 8 | 9 | mise uninstall tiny@9.8.7 10 | -------------------------------------------------------------------------------- /e2e/cli/test_log_level: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains "mise x dummy@latest --log-level debug -- dummy 2>&1" "DEBUG" 4 | assert_contains "mise x dummy@latest --log-level=debug -- dummy 2>&1" "DEBUG" 5 | assert_contains "mise x dummy@latest --debug -- dummy 2>&1" "DEBUG" 6 | assert_contains "mise x dummy@latest --trace -- dummy 2>&1" "TRACE" 7 | -------------------------------------------------------------------------------- /e2e/cli/test_ls_cache: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export MISE_USE_VERSIONS_HOST=1 3 | 4 | # verify that cache is reused for `mise ls` 5 | # see https://github.com/jdx/mise/issues/2961 6 | 7 | assert_contains "mise -v use bat 2>&1" "GET http://mise-versions.jdx.dev/bat 200 OK" 8 | touch -t 202001010000 "$MISE_CACHE_DIR/bat/"* 9 | assert_not_contains "mise -v ls bat 2>&1" "GET http://mise-versions.jdx.dev/bat 200 OK" 10 | -------------------------------------------------------------------------------- /e2e/cli/test_ls_remote: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains "mise ls-remote dummy" '1.0.0 4 | 1.1.0 5 | 2.0.0' 6 | 7 | assert_contains "mise p list-remote" "elixir" 8 | 9 | assert "mise ls-remote dummy 1" "1.0.0 10 | 1.1.0" 11 | assert "mise ls-remote dummy@2" "2.0.0" 12 | assert "mise ls-remote dummy@sub-1:2" "1.0.0 13 | 1.1.0" 14 | -------------------------------------------------------------------------------- /e2e/cli/test_outdated: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise outdated --json" "{}" 4 | assert "mise outdated" "" 5 | 6 | echo 'dummy 1' >.tool-versions 7 | mise install dummy@1.0.0 8 | 9 | assert_contains "mise ls --installed dummy" "1.0.0" 10 | assert_not_contains "mise ls --installed dummy" "1.1.0" 11 | 12 | #mise outdated dummy 13 | #assert_contains "mise ls --installed dummy" "1.1.0" 14 | #assert_not_contains "mise ls --installed dummy" "1.0.0" 15 | 16 | assert "mise outdated dummy" "dummy 1 1.0.0 1.1.0 ~/workdir/.tool-versions" 17 | assert "mise outdated dummy --bump" "dummy 1 1.0.0 2 2.0.0 ~/workdir/.tool-versions" 18 | 19 | assert "mise outdated dummy --json | jq -r '.dummy.latest'" "1.1.0" 20 | assert "mise outdated dummy --bump --json | jq -r '.dummy.latest'" "2.0.0" 21 | -------------------------------------------------------------------------------- /e2e/cli/test_prune: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise use dummy@2.0.0 tiny@2.0.0" 4 | assert "mise use dummy@3.0.0 tiny@3.0.0" 5 | cd "$(mktemp -d)" || exit 1 # mise should not prune these files even though they're from some other directory 6 | 7 | assert_contains "mise prune --dry-run 2>&1" "mise dummy@2.0.0 [dryrun]" 8 | assert_contains "mise prune --dry-run 2>&1" "mise tiny@2.0.0 [dryrun]" 9 | assert "ls $MISE_DATA_DIR/installs/dummy/2.0.0" 10 | assert "ls $MISE_DATA_DIR/installs/tiny/2.0.0" 11 | assert "mise prune tiny" 12 | assert "ls $MISE_DATA_DIR/installs/dummy/2.0.0" 13 | assert_fail "ls $MISE_DATA_DIR/installs/tiny/2.0.0" 14 | assert "mise prune" 15 | assert_fail "ls $MISE_DATA_DIR/installs/dummy/2.0.0" 16 | assert "ls $MISE_DATA_DIR/installs/dummy/3.0.0" 17 | assert "ls $MISE_DATA_DIR/installs/tiny/3.0.0" 18 | -------------------------------------------------------------------------------- /e2e/cli/test_registry: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise registry gh" "aqua:cli/cli ubi:cli/cli[exe=gh] asdf:bartlomiejdanek/asdf-github-cli" 4 | assert_contains "mise registry" "gh aqua:cli/cli ubi:cli/cli[exe=gh] asdf:bartlomiejdanek/asdf-github-cli" 5 | -------------------------------------------------------------------------------- /e2e/cli/test_search: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise search jq" "jq Command-line JSON processor. https://github.com/jqlang/jq 4 | jqp https://github.com/noahgorstein/jqp 5 | jiq https://github.com/fiatjaf/jiq 6 | gojq https://github.com/itchyny/gojq" 7 | 8 | assert "mise search --match-type contains jq" "gojq https://github.com/itchyny/gojq 9 | jq Command-line JSON processor. https://github.com/jqlang/jq 10 | jqp https://github.com/noahgorstein/jqp" 11 | 12 | assert "mise search --match-type equal jq" "jq Command-line JSON processor. https://github.com/jqlang/jq" 13 | -------------------------------------------------------------------------------- /e2e/cli/test_set: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise set FOO=bar" "" 4 | assert "mise set FOO" "bar" 5 | assert "mise set" "FOO bar ~/workdir/mise.toml" 6 | assert "mise set --rm FOO" "" 7 | assert_fail "mise set FOO" "Environment variable FOO not found" 8 | 9 | assert "mise set --file .test.mise.toml FOO=bar" "" 10 | assert "mise set --file .test.mise.toml FOO" "bar" 11 | -------------------------------------------------------------------------------- /e2e/cli/test_settings_add: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # mise should ignore identical values which have been passed using `add` 4 | assert "mise settings add disable_hints a" "" 5 | assert "mise settings add disable_hints b" "" 6 | assert "mise settings get disable_hints" '["a", "b"]' 7 | assert "mise settings add disable_hints a" "" 8 | assert "grep disable_hints ~/.config/mise/config.toml" 'disable_hints = ["a", "b"]' 9 | 10 | assert "mise settings add idiomatic_version_file_enable_tools python" "" 11 | assert "mise settings add idiomatic_version_file_enable_tools rust" "" 12 | assert "mise settings get idiomatic_version_file_enable_tools" '["python", "rust"]' 13 | assert "mise settings add idiomatic_version_file_enable_tools python,rust,zig" "" 14 | assert "grep idiomatic_version_file_enable_tools ~/.config/mise/config.toml" 'idiomatic_version_file_enable_tools = ["python", "rust", "zig"]' 15 | -------------------------------------------------------------------------------- /e2e/cli/test_settings_unset: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise settings set python.compile true 4 | assert "mise settings get python.compile" "true" 5 | mise settings unset python.compile 6 | assert_fail "mise settings get python.compile" "mise ERROR Unknown setting: python.compile" 7 | -------------------------------------------------------------------------------- /e2e/cli/test_shims: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export PATH="$MISE_DATA_DIR/shims:$PATH" 4 | 5 | assert_fail "which dummy" 6 | 7 | mise i dummy@latest 8 | assert_contains "which dummy" "/mise/shims/dummy" 9 | 10 | mise uninstall -a dummy 11 | assert_fail "which dummy" 12 | -------------------------------------------------------------------------------- /e2e/cli/test_status: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | eval "$(mise activate bash)" 4 | mise use dummy@1.0.0 5 | 6 | mise settings status.show_env=1 7 | assert "mise set FOO=1" 8 | assert "mise hook-env 2>&1 >/dev/null" "mise +FOO" && _mise_hook 9 | assert "mise set FOO=2" 10 | assert "mise hook-env 2>&1 >/dev/null" "mise ~FOO" && _mise_hook 11 | assert "mise set --rm FOO" 12 | assert "mise hook-env 2>&1 >/dev/null" "mise -FOO" && _mise_hook 13 | echo "FOO=3" >.env 14 | assert "mise set _.file=.env" 15 | assert "mise hook-env 2>&1 >/dev/null" "mise +FOO" && _mise_hook 16 | assert "mise set _.path=./node_modules/.bin" 17 | assert "mise hook-env 2>&1 >/dev/null" "mise +./node_modules/.bin" && _mise_hook 18 | 19 | mise settings status.show_tools=1 20 | assert "mise hook-env 2>&1 >/dev/null" "mise +dummy@1.0.0" && _mise_hook 21 | mise use --rm dummy 22 | assert "mise hook-env 2>&1 >/dev/null" "mise -dummy@1.0.0" && _mise_hook 23 | -------------------------------------------------------------------------------- /e2e/cli/test_uninstall: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export CLICOLOR=0 4 | 5 | echo "dummy latest" >.tool-versions 6 | 7 | assert_contains "mise ls dummy" "2.0.0 (missing)" 8 | 9 | mise i dummy@{1.0.0,1.1.0,2.0.0} 10 | assert_contains "mise ls dummy" "1.0.0" 11 | assert_contains "mise ls dummy" "1.1.0" 12 | assert_contains "mise ls dummy" "2.0.0" 13 | 14 | mise uninstall -a dummy@1 15 | assert_not_contains "mise ls dummy" "1.0.0" 16 | assert_not_contains "mise ls dummy" "1.1.0" 17 | assert_contains "mise ls dummy" "2.0.0" 18 | 19 | mise uninstall -a dummy 20 | assert_not_contains "mise ls dummy" "1.1.0" 21 | assert_not_contains "mise ls dummy" "2.0.1" 22 | assert_not_contains "mise ls dummy" "2.1.0" 23 | -------------------------------------------------------------------------------- /e2e/cli/test_use_env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use -e local dummy@1 4 | assert "cat mise.local.toml" '[tools] 5 | dummy = "1"' 6 | assert "rm mise.local.toml" 7 | 8 | MISE_ENV=local mise use dummy@1 # doesn't imply `-e local` for writing 9 | assert "cat mise.toml" '[tools] 10 | dummy = "1"' 11 | -------------------------------------------------------------------------------- /e2e/cli/test_use_retain_opts: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise use dummy[foo=bar]@1.0.0" 4 | assert "cat mise.toml" '[tools] 5 | dummy = { version = "1.0.0", foo = "bar" }' 6 | assert "mise use -g dummy@1.0.0" 7 | assert "cat ~/.config/mise/config.toml" '[tools] 8 | dummy = "1.0.0"' 9 | -------------------------------------------------------------------------------- /e2e/cli/test_version: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise version --json" 4 | -------------------------------------------------------------------------------- /e2e/cli/test_watch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use dummy@latest 4 | mise use -g watchexec@latest 5 | 6 | mise tasks add example -- echo 'running example' 7 | 8 | test_mise_watch() { 9 | local mise_path="$1" 10 | output_file=.watch_output 11 | 12 | rm -f "${output_file}" 13 | 14 | $mise_path watch example -e '.aaa' >"${output_file}" & 15 | PID_TO_KILL=$! 16 | 17 | while ! grep -q "running example" "${output_file}"; do 18 | sleep 0.5 19 | done 20 | 21 | kill -SIGINT $PID_TO_KILL 22 | 23 | assert_contains "cat ${output_file}" "running example" 24 | } 25 | 26 | # Test with original mise 27 | test_mise_watch "mise" 28 | 29 | # Test when mise is not in PATH 30 | original_mise="$(which mise)" 31 | mkdir -p ./bin && mv "$original_mise" ./bin/mise 32 | test_mise_watch "./bin/mise" 33 | mv ./bin/mise "$original_mise" 34 | -------------------------------------------------------------------------------- /e2e/cli/test_where: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | export MISE_EXPERIMENTAL=1 3 | export MISE_LOCKFILE=1 4 | 5 | assert "mise use dummy@3.1.0" 6 | assert "mise where dummy" "$MISE_DATA_DIR/installs/dummy/3.1.0" 7 | assert "mise install dummy@2" 8 | assert "mise where dummy@2" "$MISE_DATA_DIR/installs/dummy/2.0.0" 9 | assert "mise where dummy@3" "$MISE_DATA_DIR/installs/dummy/3.1.0" 10 | assert "mise alias set dummy my/dummy 3" 11 | assert "mise install dummy@my/dummy" 12 | assert "mise where dummy@my/dummy" "$MISE_DATA_DIR/installs/dummy/3" # TODO: this should probably return 3.1.0 13 | assert "mise uninstall dummy@my/dummy" 14 | assert_fail "mise where dummy@1111" "dummy@1111 not installed" 15 | 16 | echo 'tools.dummy = "latest"' >mise.toml 17 | echo 'tools.dummy = "3.0.0"' >mise.lock 18 | assert "mise i" 19 | assert "mise where dummy" "$MISE_DATA_DIR/installs/dummy/3.0.0" 20 | -------------------------------------------------------------------------------- /e2e/cli/test_which: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise use dummy@1.0.0" 4 | assert "mise which dummy" "$MISE_DATA_DIR/installs/dummy/1.0.0/bin/dummy" 5 | assert "mise which --plugin dummy" "dummy" 6 | assert "mise which --version dummy" "1.0.0" 7 | assert "mise which dummy --tool dummy@1.0.0" "$MISE_DATA_DIR/installs/dummy/1.0.0/bin/dummy" 8 | -------------------------------------------------------------------------------- /e2e/config/test_config_enable_tool: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mkdir foo 4 | cat <mise.toml 5 | [tools] 6 | dummy = 'latest' 7 | 8 | [settings] 9 | enable_tools = ["foo"] 10 | EOF 11 | 12 | assert_not_contains "mise tool dummy 2>&1" "Config Source" 13 | -------------------------------------------------------------------------------- /e2e/config/test_config_env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2209 3 | 4 | echo "tools.dummy = '1'" >mise.toml 5 | echo "tools.dummy = '2'" >mise.test.toml 6 | echo "tools.dummy = '3'" >mise.ci.toml 7 | 8 | assert "mise ls dummy" "dummy 1.1.0 (missing) ~/workdir/mise.toml 1" 9 | MISE_ENV=test assert "mise ls dummy" "dummy 2.0.0 (missing) ~/workdir/mise.test.toml 2" 10 | MISE_ENV=ci assert "mise ls dummy" "dummy 3 (missing) ~/workdir/mise.ci.toml 3" 11 | MISE_ENV=ci,test assert "mise ls dummy" "dummy 2.0.0 (missing) ~/workdir/mise.test.toml 2" 12 | MISE_ENV=test,ci assert "mise ls dummy" "dummy 3 (missing) ~/workdir/mise.ci.toml 3" 13 | -------------------------------------------------------------------------------- /e2e/config/test_config_fmt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exit 0 # this isn't working right 4 | cat <mise.toml 5 | env_path = "." 6 | env_file = ".env" 7 | min_version = "0" 8 | [tasks.a] 9 | [tools] 10 | [tasks.c] 11 | [task_config] 12 | [tasks.b] 13 | [_] 14 | [alias] 15 | [env] 16 | [hooks] 17 | [plugins] 18 | [redactions] 19 | [[watch_files]] 20 | patterns = [ "src/**/*.rs" ] 21 | run = "test" 22 | [vars] 23 | [settings] 24 | EOF 25 | 26 | assert "mise fmt" 27 | assert 'cat mise.toml' 'min_version = "0" 28 | env_file = ".env" 29 | env_path = "." 30 | [_] 31 | [env] 32 | [vars] 33 | [hooks] 34 | [[watch_files]] 35 | [tools] 36 | [tasks.a] 37 | [tasks.b] 38 | [tasks.c] 39 | [task_config] 40 | [redactions] 41 | [alias] 42 | [plugins] 43 | [settings]' 44 | -------------------------------------------------------------------------------- /e2e/config/test_config_plugins: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat >mise.toml <mise.toml 4 | [[env]] 5 | A_PATH = "foo: {{ env.PATH }}" 6 | B_PATH = { value = "foo: {{ env.PATH }}", tools = true } 7 | [[env]] 8 | _.path = {value = "tiny-{{env.JDXCODE_TINY}}-tiny", tools = true} 9 | 10 | [tools] 11 | tiny = "1.0.0" 12 | EOF 13 | 14 | mise i 15 | assert_not_contains "mise env | grep A_PATH" "tiny" 16 | assert_contains "mise env | grep B_PATH" "tiny" 17 | 18 | assert_contains "mise dr path" "tiny-1.0.0-tiny" 19 | -------------------------------------------------------------------------------- /e2e/config/test_no_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | touch mise.toml 4 | assert_empty "mise --no-config cfg" 5 | MISE_NO_CONFIG=1 assert_empty "mise cfg" 6 | -------------------------------------------------------------------------------- /e2e/config/test_tool_versions_alt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_USE_TOML=0 4 | export MISE_DEFAULT_TOOL_VERSIONS_FILENAME=.alternate-tool-versions 5 | export MISE_DEFAULT_CONFIG_FILENAME=.MISSING 6 | 7 | cat <"$MISE_DEFAULT_TOOL_VERSIONS_FILENAME" 8 | tiny 3.1.0 9 | EOF 10 | 11 | mise i tiny 12 | assert "mise local" "tiny 3.1.0" 13 | assert_contains "mise exec -- rtx-tiny" "v3.1.0" 14 | 15 | mise local -p tiny@2.0.0 16 | mise i tiny 17 | assert "mise local -p" "tiny 2.0.0" 18 | assert_contains "mise exec -- rtx-tiny" "v2.0.0" 19 | 20 | mise local -p tiny@3.5.0 21 | assert "mise local tiny" "3.5.0" 22 | -------------------------------------------------------------------------------- /e2e/core/test_bun: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <.bun-version 4 | 1.1.21 5 | EOF 6 | 7 | assert "mise i" 8 | assert_contains "mise x bun -- bun -v" "1.1.21" 9 | 10 | require_cmd node 11 | assert_contains 'mise x bun -- bunx cowsay "hello world"' "hello world" 12 | -------------------------------------------------------------------------------- /e2e/core/test_deno: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [[ ${MISE_DISABLE_TOOLS:-} == *deno* ]]; then 4 | warn "Skipping deno tests" 5 | exit 0 6 | fi 7 | 8 | cat <.deno-version 9 | 1.43.3 10 | EOF 11 | 12 | mise i deno 13 | assert_contains "mise x deno -- deno -V" "deno 1.43.3" 14 | -------------------------------------------------------------------------------- /e2e/core/test_erlang_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise use erlang@27.2" 4 | assert_contains "mise x -- erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell" "27" 5 | assert_contains "mise x elixir@1.17.3 -- elixir --version 2>&1" "Elixir 1.17.3" 6 | assert_contains "mise x elixir@1.17.3 -- mix --version 2>&1" "Mix 1.17.3" 7 | -------------------------------------------------------------------------------- /e2e/core/test_go: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_GO_DEFAULT_PACKAGES_FILE="$HOME/.default-go-packages" 4 | 5 | cat >"$MISE_GO_DEFAULT_PACKAGES_FILE" <"go.mod" <.tool-versions 4 | mkdir 21 5 | echo "golang 1.21" >21/.tool-versions 6 | 7 | export MISE_GO_SET_GOPATH=1 8 | 9 | eval "$(mise activate bash)" 10 | _mise_hook 11 | 12 | GO_20=$(mise latest golang@1.20) 13 | GO_21=$(mise latest golang@1.21) 14 | 15 | mise i golang@1.20 golang@1.21 && _mise_hook 16 | 17 | assert "go env GOPATH" "$MISE_DATA_DIR/installs/go/$GO_20/packages" 18 | cd 21 && _mise_hook 19 | assert "go env GOPATH" "$MISE_DATA_DIR/installs/go/$GO_21/packages" 20 | cd .. && _mise_hook 21 | assert "go env GOPATH" "$MISE_DATA_DIR/installs/go/$GO_20/packages" 22 | -------------------------------------------------------------------------------- /e2e/core/test_java: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <.sdkmanrc 4 | java=17.0.2 5 | EOF 6 | mise i java 7 | assert_contains "mise x java -- java -version 2>&1" 'openjdk version "17.0.2"' 8 | rm .sdkmanrc 9 | 10 | cat <.java-version 11 | 17.0.2 12 | EOF 13 | assert_contains "mise x java -- java -version 2>&1" 'openjdk version "17.0.2"' 14 | rm .java-version 15 | -------------------------------------------------------------------------------- /e2e/core/test_java_corretto: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_contains "mise x java@corretto-8 -- java -version 2>&1" "Corretto-8" 4 | -------------------------------------------------------------------------------- /e2e/core/test_node: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_NODE_COREPACK=1 4 | export MISE_NODE_DEFAULT_PACKAGES_FILE="$PWD/.default-npm-packages" 5 | export NPM_CONFIG_FUND=false 6 | 7 | latest=$(mise latest node) 8 | echo "v$latest" >.node-version 9 | echo "zx" >"$MISE_NODE_DEFAULT_PACKAGES_FILE" 10 | 11 | mise i node@lts/hydrogen 12 | mise i -f node 13 | assert_contains "mise x node@lts/hydrogen -- node --version" "v18." 14 | assert "mise x -- node --version" "v$latest" 15 | assert_contains "mise x -- which yarn" "yarn" 16 | assert_contains "mise x -- which zx" "zx" 17 | 18 | mise use nodejs@20.1.0 19 | mise ls 20 | assert "mise x -- node --version" "v20.1.0" 21 | assert_contains "mise ls-remote nodejs" "20.1.0" 22 | mise use --rm node 23 | 24 | # MISE_LEGACY_VERSION_FILE env var 25 | assert_contains "MISE_LEGACY_VERSION_FILE=1 mise current node" "$latest" 26 | assert_not_contains "MISE_LEGACY_VERSION_FILE=0 mise current node" "$latest" 27 | -------------------------------------------------------------------------------- /e2e/core/test_poetry_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # arrange 4 | export MISE_PYTHON_COMPILE=1 5 | export POETRY_HOME="$HOME/.poetry" 6 | 7 | cat >.mise.toml <pyproject.toml <&1" "cpython-" 5 | assert_contains "mise x -- python --version" "Python 3.12.3" 6 | 7 | rm mise.toml 8 | mise rm python@3.12.3 9 | 10 | echo '3.12.3' >.python-version 11 | assert_contains "mise i 2>&1" "mise python@3.12.3" 12 | assert_contains "mise x -- python --version" "Python 3.12.3" 13 | 14 | mise settings idiomatic_version_file_disable_tools python 15 | mise use python@3.13 16 | assert_contains "mise x -- python --version" "Python 3.13" 17 | -------------------------------------------------------------------------------- /e2e/core/test_python_venv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_PYTHON_DEFAULT_PACKAGES_FILE="$HOME/.default-python-packages" 4 | 5 | cat >.mise.toml <subdir/.mise.toml <Gemfile <rust-toolchain.toml 9 | [toolchain] 10 | channel = "1.81.0" 11 | EOF 12 | 13 | assert_contains "mise x -- rustc --version" "rustc 1.81.0" 14 | -------------------------------------------------------------------------------- /e2e/core/test_swift_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_EXPERIMENTAL=1 4 | export MISE_USE_VERSIONS_HOST=0 5 | 6 | MISE_DEBUG=1 mise use swift@6.0.2 7 | assert_contains "mise x -- swift --version" "Swift version 6.0.2" 8 | 9 | assert "mise x spm:nicklockwood/SwiftFormat@0.53.10 -- swiftformat --version" "0.53.10" 10 | assert "mise x spm:https://github.com/nicklockwood/SwiftFormat.git@0.53.10 -- swiftformat --version" "0.53.10" 11 | 12 | # test package with resources (`templates list` command depends on resources being installed) 13 | #assert "mise x spm:SwiftGen/SwiftGen@6.6.2 --verbose -- swiftgen templates list --only colors" "colors: 14 | # - literals-swift4 15 | # - literals-swift5 16 | # - swift4 17 | # - swift5 18 | #--- 19 | #You can also specify custom templates by path, using \`templatePath\` instead of \`templateName\`. 20 | #For more information, see the documentation on GitHub or use \`swiftgen template doc\`. 21 | #" 22 | -------------------------------------------------------------------------------- /e2e/core/test_system_node: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd node 3 | 4 | system_node="$(which node)" 5 | 6 | mise use node@20.0.0 7 | mise_node="$(mise which node)" 8 | 9 | assert "mise x node@system -- which node" "$system_node" 10 | assert "mise x -- which node" "$mise_node" 11 | -------------------------------------------------------------------------------- /e2e/core/test_zig: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise x zig@0.13.0 -- zig version" "0.13.0" 4 | assert "mise x zig@master -- zig version" 5 | assert "mise x zig@2024.11.0-mach -- zig version" "0.14.0-dev.2577+271452d22" 6 | assert "mise x zig@mach-latest -- zig version" 7 | -------------------------------------------------------------------------------- /e2e/core/test_zigmod: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | eval "$(mise activate bash)" && eval "$(mise hook-env)" 4 | mise plugin install https://github.com/kachick/asdf-zigmod 5 | assert_contains "mise x zigmod@latest -- zigmod version" "zigmod" 6 | -------------------------------------------------------------------------------- /e2e/env/test_env_dotenv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat >.mise.toml <mise.toml 4 | [env] 5 | mise.file = ['.test-env'] 6 | EOF 7 | echo FOO_FROM_FILE=foo_from_file >.test-env 8 | echo TEST_ENV2=foo >.test-env2 9 | assert "mise x -- env | grep FOO_FROM_FILE" "FOO_FROM_FILE=foo_from_file" 10 | assert "MISE_ENV_FILE=.test-env2 mise x -- env | grep TEST_ENV2" "TEST_ENV2=foo" 11 | 12 | cat <mise.toml 13 | [env] 14 | _.file = 'not_present' 15 | EOF 16 | assert "mise env" # does not error 17 | 18 | cat <mise.toml 19 | [env] 20 | _.file = ['a', 'b.json'] 21 | EOF 22 | echo 'export A=1' >a 23 | echo '{"B": 2}' >b.json 24 | assert "mise env | grep -v PATH" "export A=1 25 | export B=2" 26 | 27 | cat <mise.toml 28 | [env] 29 | mise.file = ['{{env.HOME}}/.home-test-env'] 30 | EOF 31 | echo FOO_FROM_FILE=foo_from_file_home >~/.home-test-env 32 | assert "mise x -- env | grep FOO_FROM_FILE" "FOO_FROM_FILE=foo_from_file_home" 33 | -------------------------------------------------------------------------------- /e2e/env/test_env_file_glob: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <<'EOF' >.mise.toml 4 | [env] 5 | _.file = "env.d/*.env" 6 | EOF 7 | 8 | mkdir -p env.d 9 | 10 | echo "VAR1=1" >env.d/1.env 11 | echo "VAR2=2" >env.d/2.env 12 | 13 | # mise trust --verbose 14 | mise env -s bash 15 | assert_contains "mise env -s bash" "VAR1=1" 16 | assert_contains "mise env -s bash" "VAR2=2" 17 | -------------------------------------------------------------------------------- /e2e/env/test_env_path: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise use dummy@1.0.0 4 | assert_contains "mise env -s bash | grep PATH" "/installs/dummy/1.0.0/bin" 5 | 6 | mise use dummy@2.0.0 7 | assert_contains "mise env -s bash | grep PATH" "/installs/dummy/2.0.0/bin" 8 | 9 | assert_contains "mise env -s bash dummy@1.0.1 | grep PATH" "/installs/dummy/1.0.1/bin" 10 | 11 | cat <<'EOF' >mise.toml 12 | [env] 13 | _.path = ['a', 'b'] 14 | EOF 15 | assert "mise dr path" "$PWD/a 16 | $PWD/b" 17 | -------------------------------------------------------------------------------- /e2e/env/test_env_profiles: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo 'env.AAA = "main"' >.mise.toml 4 | echo 'env.AAA = "override-1"' >mise.override1.toml 5 | echo 'env.AAA = "override-2"' >mise.override2.toml 6 | 7 | assert "mise env --json | jq -r .AAA" "main" 8 | MISE_ENV=override1 assert "mise env --json | jq -r .AAA" "override-1" 9 | MISE_ENV=override1,override2 assert "mise env --json | jq -r .AAA" "override-2" 10 | 11 | cat <mise.toml 12 | [tasks.print] 13 | run = '{% if mise_env %}echo {{mise_env}}{% endif %}' 14 | EOF 15 | assert "mise run print" "" 16 | MISE_ENV=env1 assert "mise run print" "[env1]" 17 | MISE_ENV=env1,env2 assert "mise run print" "[env1, env2]" 18 | assert "mise --env env3 run print" "[env3]" 19 | assert "mise -E env3,env4 run print" "[env3, env4]" 20 | -------------------------------------------------------------------------------- /e2e/env/test_env_source: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat >"$MISE_CONFIG_DIR/config.toml" <"$MISE_CONFIG_DIR/source.sh" <.mise.toml <source.d/1.sh <source.d/2.sh <mise.toml 4 | [env] 5 | NOW="{{ exec(command='date') }}" 6 | EOF 7 | 8 | now=$(mise env --json | jq -r '.NOW') 9 | sleep 1 10 | assert_not_contains "mise env --json | jq -r '.NOW'" "$now" 11 | 12 | cat <<'EOF' >mise.toml 13 | [env] 14 | NOW="{{ exec(command='date', cache_key='now') }}" 15 | EOF 16 | 17 | now=$(mise env --json | jq -r '.NOW') 18 | sleep 1 19 | assert "mise env --json | jq -r '.NOW'" "$now" 20 | 21 | cat <<'EOF' >mise.toml 22 | [env] 23 | NOW="{{ exec(command='date', cache_duration='2s') }}" 24 | EOF 25 | 26 | now=$(mise env --json | jq -r '.NOW') 27 | sleep 1 28 | assert "mise env --json | jq -r '.NOW'" "$now" 29 | sleep 1 30 | assert_not_contains "mise env --json | jq -r '.NOW'" "$now" 31 | -------------------------------------------------------------------------------- /e2e/env/test_env_tools: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | [env] 5 | FOO={value="bar", tools=true} 6 | EOF 7 | assert_contains "mise hook-env -s bash" "export FOO=bar" 8 | 9 | cat <mise.toml 10 | [env] 11 | WHICH={value="{{ exec(command='which which') }}", tools=true} 12 | EOF 13 | assert_contains "mise hook-env -s bash" "export WHICH=$(which which)" 14 | -------------------------------------------------------------------------------- /e2e/generate/test_generate_bootstrap: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise generate bootstrap -w" 4 | assert "./bin/mise version" 5 | 6 | assert "mise task add xxx -- echo 'running xxx'" 7 | assert "mise generate task-stubs --mise-bin ./bin/mise" 8 | assert "./bin/xxx" "running xxx" 9 | 10 | assert "mise generate bootstrap -l -w" 11 | 12 | # ensure that that the commands don't rely on the global mise bin 13 | orginal_mise="$(which mise)" 14 | mv "$orginal_mise" "orginal_mise" 15 | 16 | assert_contains "./bin/mise tasks ls" "xxx" 17 | 18 | assert_not_contains "MISE_IGNORED_CONFIG_PATHS=$(pwd) ./bin/mise tasks ls" "xxx" 19 | 20 | echo ' 21 | [tasks.other_task] 22 | run = "echo running other_task" 23 | 24 | [tasks.my_task] 25 | run = ["{{mise_bin}} run other_task"] 26 | ' >mise.toml 27 | 28 | assert_contains "./bin/mise run my_task" "running other_task" 29 | 30 | mv "orginal_mise" "$orginal_mise" 31 | -------------------------------------------------------------------------------- /e2e/generate/test_generate_config: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <.tool-versions 4 | node 22 5 | python 3.9 3.10 3.11 6 | EOF 7 | 8 | assert "mise generate config --tool-versions .tool-versions" '[tools] 9 | node = "22" 10 | python = ["3.9", "3.10", "3.11"]' 11 | -------------------------------------------------------------------------------- /e2e/generate/test_generate_task_stubs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise task add xxx -- echo 'running xxx'" 4 | assert "mise generate task-stubs" 5 | assert "./bin/xxx" "running xxx" 6 | -------------------------------------------------------------------------------- /e2e/lockfile/test_lockfile_backend: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_LOCKFILE=1 4 | export MISE_EXPERIMENTAL=1 5 | 6 | assert "mise tool gh --backend" "aqua:cli/cli" 7 | cat <mise.toml 8 | [tools.gh] 9 | version = "1.0.0" 10 | EOF 11 | cat <mise.lock 12 | [tools.gh] 13 | version = "1.0.0" 14 | backend = "ubi:cli/cli[exe=gh]" 15 | EOF 16 | assert "mise tool gh --backend" "ubi:cli/cli[exe=gh]" 17 | -------------------------------------------------------------------------------- /e2e/lockfile/test_lockfile_exec: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export MISE_LOCKFILE=1 4 | export MISE_EXPERIMENTAL=1 5 | 6 | touch mise.lock 7 | assert "mise install tiny@1.0.0" 8 | assert "mise use tiny@1" 9 | assert "mise current tiny" "1.0.0" 10 | assert "mise install tiny@1.0.1" 11 | assert "mise current tiny" "1.0.0" 12 | assert "mise x -- rtx-tiny" "rtx-tiny: v1.0.0 args:" 13 | #TODO: assert "mise x tiny -- rtx-tiny" "rtx-tiny: v1.0.0 args:" 14 | assert "mise x tiny@1.0.1 -- rtx-tiny" "rtx-tiny: v1.0.1 args:" 15 | assert "mise x -- rtx-tiny" "rtx-tiny: v1.0.0 args:" 16 | assert "mise x tiny@3.0.0 -- rtx-tiny" "rtx-tiny: v3.0.0 args:" 17 | -------------------------------------------------------------------------------- /e2e/plugins/test_core_overloading: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise plugin i -f node https://github.com/mise-plugins/mise-tiny 4 | mise i node@latest 5 | assert "mise x node@latest -- rtx-tiny" "rtx-tiny: v3.1.0 args:" 6 | -------------------------------------------------------------------------------- /e2e/plugins/test_install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <.mise.toml 4 | [plugins] 5 | tiny-ref = "https://github.com/mise-plugins/rtx-tiny#c532b140abd4ca00d3e76651b9bd32a980bd483c" 6 | EOF 7 | 8 | # installs with repo in .mise.toml 9 | assert_contains "mise x tiny-ref@v3.1.0 -- rtx-tiny" "v3.1.0" 10 | -------------------------------------------------------------------------------- /e2e/plugins/test_plugin_link: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise plugin link -f tiny-link $MISE_DATA_DIR/plugins/dummy" "" 4 | assert "mise plugin ls" "dummy 5 | tiny-link" 6 | assert "mise plugin uninstall tiny-link" "" 7 | assert "mise plugin ls" "dummy" 8 | -------------------------------------------------------------------------------- /e2e/plugins/test_plugin_update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise plugin install tiny https://github.com/mise-plugins/rtx-tiny.git 4 | mise plugins update tiny 5 | -------------------------------------------------------------------------------- /e2e/plugins/test_poetry_system_python_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # arrange 4 | export POETRY_HOME="$HOME/.poetry" 5 | python_version="$(python3 --version)" 6 | 7 | cat >pyproject.toml <.tool-versions 4 | 5 | mise install tiny 6 | assert_contains "mise ls --installed" "tiny" 7 | 8 | mise plugin uninstall tiny 9 | assert_contains "mise ls --installed" "tiny" 10 | 11 | mise plugin install tiny 12 | assert_contains "mise ls --installed" "tiny" 13 | 14 | mise plugin uninstall tiny --purge 15 | assert_not_contains "mise ls --installed" "tiny" 16 | -------------------------------------------------------------------------------- /e2e/plugins/test_version_range: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert_fail "mise current tiny" 4 | 5 | mise i tiny 6 | 7 | mise local tiny@sub-1:latest 8 | assert "mise current tiny" "2.1.0" 9 | 10 | mise local tiny@sub-1:lts 11 | assert "mise current tiny" "2.1.0" 12 | 13 | mise local tiny@sub-0.1:3.1 14 | assert "mise current tiny" "3.0.1" 15 | -------------------------------------------------------------------------------- /e2e/shell/fish_script: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC1072,SC1065,SC1064,SC1073,SC2103 3 | 4 | set -l fish_trace 1 5 | mise install tiny@3.1.0 tiny@2.0.0 6 | or exit 7 | 8 | echo >.mise.toml ' 9 | [tools] 10 | tiny = "3.1.0" 11 | [env] 12 | FOO = "bar" 13 | ' 14 | 15 | mkdir subdir 16 | echo >subdir/.mise.toml ' 17 | [tools] 18 | tiny = "2.0.0" 19 | [env] 20 | FOO = "quz" 21 | ' 22 | 23 | mise activate --status fish | source 24 | __mise_env_eval 25 | 26 | rtx-tiny | grep "v3.1.0" 27 | or exit 28 | 29 | cd subdir && __mise_env_eval 30 | rtx-tiny | grep "v2.0.0" 31 | or exit 32 | 33 | cd .. && __mise_env_eval 34 | rtx-tiny | grep "v3.1.0" 35 | or exit 36 | 37 | mise shell tiny@3.0.0 && __mise_env_eval 38 | rtx-tiny | grep "v3.0.0" 39 | or exit 40 | 41 | mise deactivate 42 | -------------------------------------------------------------------------------- /e2e/shell/test_bash_legacy_activate: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "tiny 3.1.0" >.tool-versions 4 | mkdir subdir 5 | echo "tiny 2.0.0" >subdir/.tool-versions 6 | 7 | mise install tiny@3.1.0 tiny@2.0.0 8 | 9 | # shellcheck disable=SC1090 10 | eval "$(mise activate -s bash --status)" 11 | 12 | _mise_hook 13 | assert_contains "rtx-tiny" "v3.1.0" 14 | 15 | cd subdir && _mise_hook 16 | assert_contains "rtx-tiny" "v2.0.0" 17 | 18 | cd .. && _mise_hook 19 | assert_contains "rtx-tiny" "v3.1.0" 20 | -------------------------------------------------------------------------------- /e2e/shell/test_fish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd fish 3 | exec fish "$TEST_DIR/fish_script" 4 | -------------------------------------------------------------------------------- /e2e/shell/test_zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | require_cmd zsh 3 | exec zsh "$TEST_DIR/zsh_script" 4 | -------------------------------------------------------------------------------- /e2e/sync/test_sync_nvm: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export NVM_DIR="$PWD/.nvm" 4 | 5 | install_fake_node() { 6 | mkdir -p "$1/bin" 7 | echo "#!/usr/bin/env echo" >"$1/bin/node" 8 | chmod +x "$1/bin/node" 9 | } 10 | 11 | install_fake_node "$NVM_DIR/versions/node/v18.0.0" 12 | mise sync node --nvm 13 | mise ls 14 | assert_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/18.0.0" 15 | 16 | install_fake_node "$NVM_DIR/versions/node/v20.0.0" 17 | install_fake_node "$NVM_DIR/versions/node/v22.0.0" 18 | install_fake_node "$MISE_DATA_DIR/installs/node/20.0.0/bin" 19 | 20 | mise sync node --nvm 21 | mise ls 22 | assert_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/22.0.0" 23 | assert_not_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/20.0.0" 24 | assert_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/18.0.0" 25 | -------------------------------------------------------------------------------- /e2e/sync/test_sync_nvm_slow: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC1091 3 | 4 | export NVM_DIR="$PWD/.nvm" 5 | mkdir -p "$NVM_DIR" 6 | curl -L https://github.com/nvm-sh/nvm/archive/refs/tags/v0.40.0.tar.gz | tar -xz -C "$NVM_DIR" --strip-components=1 7 | . "$NVM_DIR/nvm.sh" 8 | 9 | nvm install 22.0.0 10 | mise sync node --nvm 11 | mise ls 12 | assert_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/22.0.0" 13 | 14 | # mise install node@20.0.0 15 | # nvm install 20.0.0 16 | # nvm install 18.0.0 17 | # mise sync node --nvm 18 | # mise ls 19 | # assert_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/22.0.0" 20 | # assert_not_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/20.0.0" 21 | # assert_contains "mise ls node --json | jq -r '.[] | .symlinked_to | select( . != null)'" "node/18.0.0" 22 | -------------------------------------------------------------------------------- /e2e/sync/test_sync_python_uv: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise use -g uv python@3.11.3" 4 | assert "mise x -- uv python install 3.11.1" 5 | export UV_PYTHON_DOWNLOADS=never 6 | assert "mise sync python --uv" 7 | assert "mise x python@3.11.1 -- python -V" "Python 3.11.1" 8 | assert "mise x -- uv run -p 3.11.3 -- python -V" "Python 3.11.3" 9 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_add: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise task add pre-commit --depends "test" --depends "render" -- echo pre-commit 4 | assert "cat mise.toml" '[tasks.pre-commit] 5 | depends = ["test", "render"] 6 | run = "echo pre-commit"' 7 | 8 | mise task add --file pre-commit --depends "test" --depends "render" -- echo pre-commit 9 | assert "cat mise-tasks/pre-commit" '#!/usr/bin/env bash 10 | #MISE depends=["test", "render"] 11 | set -euxo pipefail 12 | 13 | echo pre-commit' 14 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_config_dir: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | task_config.dir = "{{config_root}}/mywork" 5 | tasks.a.run = "pwd" 6 | EOF 7 | 8 | mkdir -p mywork 9 | assert "mise run a" "$(pwd)/mywork" 10 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_default: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | assert "mise task add --file foo:bar:baz -- echo baz" 4 | assert "mise task add --file foo:bar -- echo bar" 5 | ls -lR . 6 | 7 | assert "mise tasks" "foo:bar 8 | foo:bar:baz" 9 | assert "mise task run foo:bar:baz" "baz" 10 | assert "mise task run foo:bar" "bar" 11 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_depends_post: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ensures depends_post and depends can be used on separate tasks 4 | cat <mise.toml 5 | [tasks.one] 6 | run = "echo one" 7 | 8 | [tasks.two] 9 | depends = ["one"] 10 | run = "echo two" 11 | 12 | [tasks.three] 13 | depends_post = ["two"] 14 | run = "echo three" 15 | EOF 16 | assert "mise task deps" "one 17 | three 18 | two 19 | ├── three 20 | └── one" 21 | assert "mise run three" 22 | 23 | # TODO: this does not work with how mise is designed currently. Tasks can only ever be run once per run session. This will require hefty refactoring if it is ever supported 24 | # uses depends and depends_post on the same task 25 | #cat <mise.toml 26 | #tasks."util:donothing" = "" 27 | #[tasks.hi] 28 | #depends = "util:donothing" 29 | #run = "echo hi" 30 | #depends_post = "util:donothing" 31 | #EOF 32 | #assert "mise run hi" 33 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_deps_circular: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | [tasks.one] 5 | run = "echo one" 6 | depends = ["two"] 7 | 8 | [tasks.two] 9 | depends = ["three"] 10 | run = "echo two" 11 | 12 | [tasks.three] 13 | depends = ["one"] 14 | run = "echo three" 15 | EOF 16 | # this should fail not sure how it works. 17 | assert_fail "mise run one" 18 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_keep_order: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | tasks.a = "echo a" 5 | tasks.b = "echo b" 6 | tasks.c = "echo c" 7 | tasks.all.depends = ['a', 'b', 'c'] 8 | EOF 9 | assert "mise run -o keep-order all" "[a] a 10 | [b] b 11 | [c] c" 12 | 13 | cat <mise.toml 14 | tasks.a = "echo a" 15 | tasks.b = "echo b ; exit 1" 16 | tasks.all.depends = ['a', 'b'] 17 | EOF 18 | assert_fail "mise run -o keep-order all" "[b] b" 19 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_ls_global: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "tasks.mylocal = { run = 'echo mylocal' }" >mise.toml 4 | echo "tasks.myglobal = { run = 'echo myglobal' }" >~/.config/mise/config.toml 5 | 6 | assert "mise tasks" "myglobal 7 | mylocal" 8 | assert "mise tasks --local" "mylocal" 9 | assert "mise tasks --global" "myglobal" 10 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_options: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | tasks.mytask = 'echo {{option(name="foo")}}' 5 | EOF 6 | 7 | assert "mise run mytask --foo bar" "bar" 8 | assert "mise run mytask -- --foo bar" "bar" 9 | assert "mise mytask --foo bar" "bar" 10 | assert "mise mytask -- --foo bar" "bar" 11 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_project_root: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise task add a:b:c --file -- echo \$MISE_PROJECT_ROOT 4 | assert "mise a:b:c" "$PWD" 5 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_run_depends: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | [tasks.build] 5 | run = 'echo build' 6 | [tasks.all] 7 | depends = ['build a', 'build b', 'build c'] 8 | EOF 9 | assert "mise run all | sort" "[build] build a 10 | [build] build b 11 | [build] build c" 12 | 13 | cat <mise.toml 14 | [tasks.build1] 15 | run = 'echo build' 16 | [tasks.build2] 17 | depends = ['build1 a'] 18 | run = 'echo build' 19 | [tasks.all] 20 | depends = ['build1 a', 'build2 b'] 21 | run = "echo all" 22 | EOF 23 | assert "mise run all" "build a 24 | build b 25 | all" 26 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_run_tmpl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | env.BAR = "bar" 5 | tasks.a = "echo {{ env.BAR }}" 6 | EOF 7 | assert "mise run a" "bar" 8 | 9 | cat <mise.toml 10 | env.BAR = "a" 11 | tasks.a = "echo a" 12 | tasks.b.depends = ["{{ env.BAR }}"] 13 | EOF 14 | assert "mise run b" "a" 15 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_skip: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | tasks.a = "echo running a" 5 | tasks.b = "echo running b" 6 | tasks.c = "echo running c" 7 | tasks.all.run = "echo testing!" 8 | tasks.all.depends = ["a", "b", "c"] 9 | EOF 10 | 11 | assert_contains "mise run all" "running b" 12 | MISE_TASK_SKIP=b assert_not_contains "mise run all" "running b" 13 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_standalone: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mytask 4 | #!/usr/bin/env bash 5 | echo "running mytask" 6 | EOF 7 | chmod +x mytask 8 | 9 | assert "mise run ./mytask" "running mytask" 10 | 11 | cat <mise.toml 12 | [tasks.mytask] 13 | file = "./mytask" 14 | EOF 15 | 16 | mkdir -p subdir 17 | cd subdir || exit 1 18 | assert "mise run mytask" "running mytask" 19 | cd .. || exit 1 20 | 21 | cat <mise.toml 22 | tasks.mytask.file = "https://mise.jdx.dev/test/mytask" 23 | EOF 24 | assert "mise run mytask" "running mytask" 25 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_tools: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | [tasks.a] 5 | tools = { tiny = "1" } 6 | run = "rtx-tiny" 7 | [tasks.b] 8 | depends = ["a"] 9 | tools = { tiny = "2" } 10 | run = "rtx-tiny" 11 | EOF 12 | 13 | assert "mise run b" "rtx-tiny: v1.1.0 args: 14 | rtx-tiny: v2.1.0 args:" 15 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_unnest: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <.mise.toml 4 | [tasks.a] 5 | run = 'echo a' 6 | [tasks.b] 7 | run = ['echo b && mise run a'] 8 | EOF 9 | 10 | assert "mise run --output prefix b" "\ 11 | [b] b 12 | [a] a" 13 | 14 | cat <.mise.toml 15 | [tasks.a] 16 | run = 'echo a' 17 | [tasks.b] 18 | run = ['echo b && mise run a'] 19 | [tasks.c] 20 | run = ['echo c && mise run b'] 21 | EOF 22 | 23 | assert "mise run --output prefix c" "\ 24 | [c] c 25 | [b] b 26 | [a] a" 27 | 28 | assert "mise run --no-timings --output prefix c 2>&1" '[c] $ echo c && mise run b 29 | [c] c 30 | [b] $ echo b && mise run a 31 | [b] b 32 | [a] $ echo a 33 | [a] a' 34 | -------------------------------------------------------------------------------- /e2e/tasks/test_task_vars: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | cat <mise.toml 4 | tasks.a.run = "echo foo: {{vars.foo}}" 5 | vars.foo = "bar" 6 | EOF 7 | assert "mise run a" "foo: bar" 8 | 9 | cat <mise.toml 10 | tasks.a.run = "echo foo: {{vars.foo}}" 11 | vars.foo = "{{cwd}}" 12 | EOF 13 | assert "mise run a" "foo: $(pwd)" 14 | 15 | echo '{ "SECRET": "123" }' >.env.json 16 | cat <mise.toml 17 | tasks.a.run = "echo foo: {{vars.SECRET}}" 18 | vars._.file = ".env.json" 19 | EOF 20 | assert "mise run a" "foo: 123" 21 | 22 | cat <mise.toml 23 | tasks.a.run = "echo foo: {{vars.bar}}" 24 | vars.foo = "bar" 25 | vars.bar = "bar: {{vars.foo}}" 26 | EOF 27 | assert "mise run a" "foo: bar: bar" 28 | -------------------------------------------------------------------------------- /e2e/tools/test_runtime_symlinks: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | mise i dummy@1.0.1 dummy@1.0.2 dummy@1.10.0 dummy@2.0.0 dummy@2.1.0 4 | assert "ls -l $MISE_DATA_DIR/installs/dummy | grep '\->' | awk '{print \$(NF-2),\$(NF)}'" "1 ./1.10.0 5 | 1.0 ./1.0.2 6 | 1.10 ./1.10.0 7 | 2 ./2.1.0 8 | 2.0 ./2.0.0 9 | 2.1 ./2.1.0 10 | latest ./2.1.0" 11 | -------------------------------------------------------------------------------- /minisign.key.age: -------------------------------------------------------------------------------- 1 | -----BEGIN AGE ENCRYPTED FILE----- 2 | YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyOGtFYjZaMlN0Z1FvcG8w 3 | VlhIOExmZlVtOS9TVDVobzBBUklCNFBkbHo4CkJxaDYxQjJTYWZkS3dGWmZjY0F0 4 | VEt6Z0k5bkw0RmxBVXZRYjM4RFQ4MWMKLS0tIHo4RFFxeVc1Z1JzVS82aGV4dWkw 5 | THRLeHRlcElEU3RwTlVDVXZ6NmsrVDgKdWCh+DjlUPZL6KSSEShIvEmKH0DioW5g 6 | jSZD9Hyew8s8uIe8z7ioDWM3pMH4+6FdN6jAKlzeyhUTKhyUGdAWL246KUZnlEsl 7 | LCMqYDb2H5eVuP44jsTYi63hqXFIhKAGhlO2fRPSIPufUSJBD0XeqHKbpdBx3iPA 8 | KY6WHC8SDeBpKIsRTUQgFPC4mOn8xKuMpo4ST/5cmLNv/GwQv2j+Tpi2aVNcE8tV 9 | Rr8pnEs2OnIbIKsaQA27MwLh5/bch0UByW5MtTylSGb2veQxsMJVZ+Zkt3CW5WlW 10 | elFgepKlOwCTy0zJxkJfRujJ5FFAO1w0sLzRMYEAg9GgapPCI5LCosFHzBrEPCK6 11 | RNylZXWcPdNbGJ1DSjwSgK4ktttS1tw3vyc/9IAg 12 | -----END AGE ENCRYPTED FILE----- 13 | -------------------------------------------------------------------------------- /minisign.pub: -------------------------------------------------------------------------------- 1 | untrusted comment: minisign public key 64113EDF160FDEC2 2 | RWTC3g8W3z4RZK3V3qv7fa1QY4JEWyBtqIHW+85QlJpZc5yG+uNYNBSZ 3 | -------------------------------------------------------------------------------- /mise.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": ".", 5 | }, 6 | ], 7 | "settings": { 8 | "shellcheck.ignorePatterns": { 9 | "completions/mise.bash": true, 10 | }, 11 | "markdownlint.lintWorkspaceGlobs": [ 12 | "**/*.{md,mkd,mdwn,mdown,markdown,markdn,mdtxt,mdtext,workbook}", 13 | "!**/*.code-search", 14 | "!**/bower_components", 15 | "!**/node_modules", 16 | "!**/.git", 17 | "!**/vendor", 18 | "!**/CHANGELOG.md" 19 | ], 20 | "files.exclude": { 21 | "aqua-registry/**": true 22 | }, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /mise.toml: -------------------------------------------------------------------------------- 1 | #:schema ./schema/mise.json 2 | min_version = "2024.1.1" 3 | 4 | [env] 5 | _.path = ["./target/debug", "./node_modules/.bin"] 6 | 7 | [tools] 8 | "actionlint" = "latest" 9 | bun = "latest" 10 | cargo-binstall = "latest" 11 | "cargo:cargo-edit" = "latest" 12 | "cargo:cargo-insta" = "latest" 13 | "cargo:git-cliff" = "latest" 14 | "cargo:toml-cli" = "latest" 15 | "cargo:usage-cli" = { version = "latest", os = ["linux", "macos"] } 16 | cosign = "latest" 17 | hk = "latest" 18 | "jq" = "latest" 19 | "npm:markdownlint-cli" = "latest" 20 | "npm:prettier" = "3" 21 | "pipx:toml-sort" = "latest" 22 | pkl = "latest" 23 | pre-commit = "latest" 24 | #"python" = { version = "latest", virtualenv = "{{env.HOME}}/.cache/venv" } 25 | "ripgrep" = "latest" 26 | "shellcheck" = "latest" 27 | "shfmt" = "latest" 28 | slsa-verifier = "latest" 29 | taplo = "latest" 30 | wait-for-gh-rate-limit = "latest" 31 | 32 | [task_config] 33 | includes = ["tasks.toml", "xtasks"] 34 | -------------------------------------------------------------------------------- /packaging/alpine/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:edge 2 | 3 | RUN apk add --no-cache sudo build-base alpine-sdk bash direnv glab atools github-cli jq nodejs \ 4 | && apk fix \ 5 | && adduser -D packager \ 6 | && addgroup packager abuild \ 7 | && echo "packager ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ 8 | && mkdir -p /__w && chown packager:packager /__w && chmod 777 /__w 9 | #USER packager 10 | #WORKDIR /home/packager 11 | 12 | HEALTHCHECK CMD abuild -v 13 | -------------------------------------------------------------------------------- /packaging/alpine/README.md: -------------------------------------------------------------------------------- 1 | To generate new release keys, first start the alpine docker container: 2 | 3 | ```bash 4 | docker run -it --rm -v $(pwd):/work/mise ghcr.io/jdx/mise:alpine 5 | ``` 6 | 7 | And inside the container: 8 | 9 | ```bash 10 | sudo su - packager 11 | abuild-keygen -a -n 12 | ``` 13 | 14 | Then store them in GitHub secrets as `ALPINE_PRIV_KEY` and `ALPINE_PUB_KEY`. 15 | Note the name of the private key file, it will be something like `-5f2b2c4e.rsa`. 16 | Save that string as `ALPINE_KEY_ID` as another secret. 17 | 18 | Also, the `ALPINE_GITLAB_TOKEN` needs to be rolled as well, use the [alpine gitlab portal](https://gitlab.alpinelinux.org/-/user_settings/personal_access_tokens) 19 | to generate a new token and store it in Github secrets as `ALPINE_GITLAB_TOKEN`. 20 | -------------------------------------------------------------------------------- /packaging/deb/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:24.04 2 | LABEL maintainer="jdx" 3 | 4 | RUN apt-get update \ 5 | && apt-get install -y \ 6 | build-essential \ 7 | ruby \ 8 | && apt-get clean \ 9 | && rm -rf /var/lib/apt/lists/* 10 | 11 | RUN gem install fpm 12 | -------------------------------------------------------------------------------- /packaging/deb/generate-release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | # shellcheck disable=SC2044 4 | # shellcheck disable=SC2066 5 | # shellcheck disable=SC2086 6 | # shellcheck disable=SC2185 7 | 8 | do_hash() { 9 | HASH_NAME=$1 10 | HASH_CMD=$2 11 | echo "${HASH_NAME}:" 12 | for f in $(find -type f); do 13 | f=$(echo $f | cut -c3-) # remove ./ prefix 14 | if [ "$f" = "Release" ]; then 15 | continue 16 | fi 17 | echo " $(${HASH_CMD} ${f} | cut -d" " -f1) $(wc -c $f)" 18 | done 19 | } 20 | 21 | cat </dev/null 2>&1; then 10 | cargo install zipsign 11 | fi 12 | 13 | mkdir -p ~/.zipsign 14 | echo "$ZIPSIGN" | base64 -d >~/.zipsign/mise.priv 15 | -------------------------------------------------------------------------------- /scripts/test-standalone.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | BASE_DIR="$(pwd)" 5 | RELEASE_DIR="$(pwd)/tmp" 6 | MISE_VERSION="v$(curl -fsSL https://mise.jdx.dev/VERSION)" 7 | export BASE_DIR RELEASE_DIR MISE_VERSION 8 | 9 | mkdir -p "$RELEASE_DIR/$MISE_VERSION" 10 | curl -fsSL "https://mise.jdx.dev/$MISE_VERSION/SHASUMS256.txt" >"$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt" 11 | ./scripts/render-install.sh >tmp/install.sh 12 | chmod +x tmp/install.sh 13 | mise x shellcheck -- shellcheck tmp/install.sh 14 | 15 | ./tmp/install.sh 16 | if [[ ! "$("$HOME/.local/bin/mise" -v)" =~ ^${MISE_VERSION//v/} ]]; then 17 | echo "mise version mismatch" 18 | exit 1 19 | fi 20 | rm -rf "$RELEASE_DIR" 21 | -------------------------------------------------------------------------------- /share/fish/vendor_conf.d/mise-activate.fish: -------------------------------------------------------------------------------- 1 | if [ "$MISE_FISH_AUTO_ACTIVATE" != "0" ] 2 | mise activate fish | source 3 | end 4 | -------------------------------------------------------------------------------- /src/aqua/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod aqua_registry; 2 | pub(crate) mod aqua_template; 3 | -------------------------------------------------------------------------------- /src/assets/bash_zsh_support/README.md: -------------------------------------------------------------------------------- 1 | # bash_zsh_support 2 | 3 | support Zsh function hooks for Bash 4 | -------------------------------------------------------------------------------- /src/assets/bash_zsh_support/chpwd/README.md: -------------------------------------------------------------------------------- 1 | # Bash support for Zsh like chpwd hook 2 | 3 | Implemented based on the description from 4 | 5 | 6 | ## Usage 7 | 8 | 1. load `function.sh` and `load.sh`, eg: 9 | 10 | source chpwd/functions.sh 11 | source chpwd/load.sh 12 | 13 | 2. add the hook - replace `_hook_name` with your function name: 14 | 15 | export -a chpwd_functions # define hooks as an shell array 16 | [[ " ${chpwd_functions[*]} " == *" _hook_name "* ]] || # prevent double addition 17 | chpwd_functions+=(_hook_name) # finally add it to the list 18 | -------------------------------------------------------------------------------- /src/assets/bash_zsh_support/chpwd/function.sh: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | export -a chpwd_functions 3 | function __zsh_like_cd() 4 | { 5 | \typeset __zsh_like_cd_hook 6 | if 7 | builtin "$@" 8 | then 9 | for __zsh_like_cd_hook in chpwd "${chpwd_functions[@]}" 10 | do 11 | if \typeset -f "$__zsh_like_cd_hook" >/dev/null 2>&1 12 | then "$__zsh_like_cd_hook" || break # finish on first failed hook 13 | fi 14 | done 15 | true 16 | else 17 | return $? 18 | fi 19 | } 20 | -------------------------------------------------------------------------------- /src/assets/bash_zsh_support/chpwd/load.sh: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | [[ -n "${ZSH_VERSION:-}" ]] || 3 | { 4 | function cd() { __zsh_like_cd cd "$@" ; } 5 | function popd() { __zsh_like_cd popd "$@" ; } 6 | function pushd() { __zsh_like_cd pushd "$@" ; } 7 | } 8 | -------------------------------------------------------------------------------- /src/build_time.rs: -------------------------------------------------------------------------------- 1 | use chrono::{DateTime, FixedOffset}; 2 | use std::sync::LazyLock as Lazy; 3 | 4 | pub mod built_info { 5 | include!(concat!(env!("OUT_DIR"), "/built.rs")); 6 | } 7 | 8 | pub static BUILD_TIME: Lazy> = 9 | Lazy::new(|| DateTime::parse_from_rfc2822(built_info::BUILT_TIME_UTC).unwrap()); 10 | 11 | pub static TARGET: &str = built_info::TARGET; 12 | -------------------------------------------------------------------------------- /src/cli/args/mod.rs: -------------------------------------------------------------------------------- 1 | pub use backend_arg::BackendArg; 2 | pub use env_var_arg::EnvVarArg; 3 | pub use tool_arg::{ToolArg, ToolVersionType}; 4 | 5 | mod backend_arg; 6 | mod env_var_arg; 7 | mod tool_arg; 8 | -------------------------------------------------------------------------------- /src/cli/backends/mod.rs: -------------------------------------------------------------------------------- 1 | use clap::Subcommand; 2 | use eyre::Result; 3 | 4 | mod ls; 5 | 6 | #[derive(Debug, clap::Args)] 7 | #[clap(about = "Manage backends", visible_alias = "b", aliases = ["backend", "backend-list"])] 8 | pub struct Backends { 9 | #[clap(subcommand)] 10 | command: Option, 11 | } 12 | 13 | #[derive(Debug, Subcommand)] 14 | enum Commands { 15 | Ls(ls::BackendsLs), 16 | } 17 | 18 | impl Commands { 19 | pub fn run(self) -> Result<()> { 20 | match self { 21 | Self::Ls(cmd) => cmd.run(), 22 | } 23 | } 24 | } 25 | 26 | impl Backends { 27 | pub async fn run(self) -> Result<()> { 28 | let cmd = self.command.unwrap_or(Commands::Ls(ls::BackendsLs {})); 29 | 30 | cmd.run() 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/cli/generate/config.rs: -------------------------------------------------------------------------------- 1 | use crate::Result; 2 | use crate::cli::config::generate; 3 | 4 | /// [experimental] Generate a mise.toml file 5 | #[derive(Debug, clap::Args)] 6 | #[clap(verbatim_doc_comment, after_long_help = generate::AFTER_LONG_HELP)] 7 | pub struct Config { 8 | #[clap(flatten)] 9 | generate: generate::ConfigGenerate, 10 | } 11 | 12 | impl Config { 13 | pub async fn run(self) -> Result<()> { 14 | self.generate.run() 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/cli/self_update_stub.rs: -------------------------------------------------------------------------------- 1 | pub struct SelfUpdate {} 2 | 3 | impl SelfUpdate { 4 | pub fn is_available() -> bool { 5 | false 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/cli/sync/mod.rs: -------------------------------------------------------------------------------- 1 | use clap::Subcommand; 2 | use eyre::Result; 3 | 4 | mod node; 5 | mod python; 6 | mod ruby; 7 | 8 | #[derive(Debug, clap::Args)] 9 | #[clap(about = "Synchronize tools from other version managers with mise")] 10 | pub struct Sync { 11 | #[clap(subcommand)] 12 | command: Commands, 13 | } 14 | 15 | #[derive(Debug, Subcommand)] 16 | enum Commands { 17 | Node(node::SyncNode), 18 | Python(python::SyncPython), 19 | Ruby(ruby::SyncRuby), 20 | } 21 | 22 | impl Commands { 23 | pub async fn run(self) -> Result<()> { 24 | match self { 25 | Self::Node(cmd) => cmd.run().await, 26 | Self::Python(cmd) => cmd.run().await, 27 | Self::Ruby(cmd) => cmd.run().await, 28 | } 29 | } 30 | } 31 | 32 | impl Sync { 33 | pub async fn run(self) -> Result<()> { 34 | self.command.run().await 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__env-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: dump 4 | snapshot_kind: text 5 | --- 6 | min_version = "2024.1.1" 7 | [env] 8 | foo="bar" 9 | foo2='qux\nquux' 10 | foo3="qux\nquux" 11 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__env-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | ~/cwd/.test.mise.toml: 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__env-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | MiseToml(~/cwd/.test.mise.toml): ToolRequestSet: { 7 | min_version: "2024.1.1", 8 | env: [ 9 | Val( 10 | "foo", 11 | "bar", 12 | EnvDirectiveOptions { 13 | tools: false, 14 | redact: false, 15 | }, 16 | ), 17 | Val( 18 | "foo2", 19 | "qux\\nquux", 20 | EnvDirectiveOptions { 21 | tools: false, 22 | redact: false, 23 | }, 24 | ), 25 | Val( 26 | "foo3", 27 | "qux\nquux", 28 | EnvDirectiveOptions { 29 | tools: false, 30 | redact: false, 31 | }, 32 | ), 33 | ], 34 | } 35 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__fixture-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.plugins().unwrap() 4 | snapshot_kind: text 5 | --- 6 | { 7 | "node": "https://github.com/jdx/rtx-node", 8 | } 9 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__fixture-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.alias 4 | snapshot_kind: text 5 | --- 6 | { 7 | "node": Alias { 8 | backend: None, 9 | versions: { 10 | "my_custom_node": "18", 11 | }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__fixture-5.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: "replace_path(&format!(\"{:#?}\", &cf))" 4 | snapshot_kind: text 5 | --- 6 | MiseToml(~/fixtures/.mise.toml): ToolRequestSet: terraform@1.0.0 node@18 node@prefix:20 node@ref:master node@path:~/.nodes/18 jq@prefix:1.6 shellcheck@0.9.0 python@3.10.0 python@3.9.0 { 7 | env: [ 8 | Val( 9 | "NODE_ENV", 10 | "production", 11 | EnvDirectiveOptions { 12 | tools: false, 13 | redact: false, 14 | }, 15 | ), 16 | ], 17 | alias: { 18 | "node": Alias { 19 | backend: None, 20 | versions: { 21 | "my_custom_node": "18", 22 | }, 23 | }, 24 | }, 25 | plugins: { 26 | "node": "https://github.com/jdx/rtx-node", 27 | }, 28 | } 29 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__fixture.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.env_entries().unwrap() 4 | snapshot_kind: text 5 | --- 6 | [ 7 | Val( 8 | "NODE_ENV", 9 | "production", 10 | EnvDirectiveOptions { 11 | tools: false, 12 | redact: false, 13 | }, 14 | ), 15 | ] 16 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_alias-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.dump().unwrap() 4 | snapshot_kind: text 5 | --- 6 | [alias.node.versions] 7 | 18 = "18.0.0" 8 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_alias-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | ~/cwd/.test.mise.toml: 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_alias-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | MiseToml(~/cwd/.test.mise.toml): ToolRequestSet: { 7 | alias: { 8 | "node": Alias { 9 | backend: None, 10 | versions: { 11 | "18": "18.0.0", 12 | }, 13 | }, 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_alias.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.alias 4 | snapshot_kind: text 5 | --- 6 | { 7 | "node": Alias { 8 | backend: None, 9 | versions: { 10 | "18": "18.0.0", 11 | }, 12 | }, 13 | } 14 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_plugin-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.dump().unwrap() 4 | snapshot_kind: text 5 | --- 6 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_plugin-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | /tmp/.mise.toml: 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_plugin-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | MiseToml(/tmp/.mise.toml): ToolRequestSet: 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__remove_plugin.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.to_toolset().unwrap() 4 | --- 5 | Toolset { 6 | versions: {}, 7 | source: None, 8 | tera_ctx: OnceCell { 9 | value: None, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__replace_versions-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.dump().unwrap() 4 | snapshot_kind: text 5 | --- 6 | [tools] 7 | node = ["16.0.1", "18.0.1"] 8 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__replace_versions-3.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | /tmp/.mise.toml: node@16.0.1 node@18.0.1 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__replace_versions-4.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | MiseToml(/tmp/.mise.toml): ToolRequestSet: node@16.0.1 node@18.0.1 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__set_alias-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf 4 | snapshot_kind: text 5 | --- 6 | ~/cwd/.test.mise.toml: 7 | -------------------------------------------------------------------------------- /src/config/config_file/snapshots/mise__config__config_file__mise_toml__tests__set_alias.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/config_file/mise_toml.rs 3 | expression: cf.alias 4 | snapshot_kind: text 5 | --- 6 | { 7 | "node": Alias { 8 | backend: None, 9 | versions: { 10 | "16": "16.0.0", 11 | "18": "18.0.1", 12 | "20": "20.0.0", 13 | }, 14 | }, 15 | "python": Alias { 16 | backend: None, 17 | versions: { 18 | "3.10": "3.10.0", 19 | }, 20 | }, 21 | } 22 | -------------------------------------------------------------------------------- /src/config/snapshots/mise__config__tests__load.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/config/mod.rs 3 | expression: config 4 | snapshot_kind: text 5 | --- 6 | Config { 7 | Config Files: [ 8 | "~/cwd/.test-tool-versions", 9 | "~/.test-tool-versions", 10 | "~/config/config.toml", 11 | ], 12 | Aliases: { 13 | "tiny": Alias { 14 | backend: None, 15 | versions: { 16 | "my/alias": "3.0", 17 | }, 18 | }, 19 | }, 20 | } 21 | -------------------------------------------------------------------------------- /src/duration.rs: -------------------------------------------------------------------------------- 1 | pub use std::time::Duration; 2 | 3 | use eyre::{Result, bail}; 4 | use jiff::{Span, civil::date}; 5 | 6 | pub const HOURLY: Duration = Duration::from_secs(60 * 60); 7 | pub const DAILY: Duration = Duration::from_secs(60 * 60 * 24); 8 | pub const WEEKLY: Duration = Duration::from_secs(60 * 60 * 24 * 7); 9 | 10 | pub fn parse_duration(s: &str) -> Result { 11 | match s.parse::() { 12 | Ok(span) => { 13 | // we must provide a relative date to determine the duration with months and years 14 | let duration = span.to_duration(date(2025, 1, 1))?; 15 | if duration.is_negative() { 16 | bail!("duration must not be negative: {}", s); 17 | } 18 | Ok(duration.unsigned_abs()) 19 | } 20 | Err(_) => Ok(Duration::from_secs(s.parse()?)), 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/exit.rs: -------------------------------------------------------------------------------- 1 | use crate::cmd::CmdLineRunner; 2 | #[cfg(unix)] 3 | use nix::sys::signal::SIGTERM; 4 | 5 | pub fn exit(code: i32) -> ! { 6 | #[cfg(unix)] 7 | CmdLineRunner::kill_all(SIGTERM); 8 | 9 | #[cfg(windows)] 10 | CmdLineRunner::kill_all(); 11 | 12 | debug!("exiting with code: {code}"); 13 | std::process::exit(code) 14 | } 15 | -------------------------------------------------------------------------------- /src/fake_asdf_windows.rs: -------------------------------------------------------------------------------- 1 | use std::env::{join_paths, split_paths}; 2 | use std::path::PathBuf; 3 | 4 | use crate::env; 5 | use crate::env::PATH_KEY; 6 | 7 | #[cfg(windows)] 8 | pub fn setup() -> color_eyre::Result { 9 | let path = env::MISE_DATA_DIR.join(".fake-asdf"); 10 | Ok(path) 11 | } 12 | 13 | pub fn get_path_with_fake_asdf() -> String { 14 | let mut path = split_paths(&env::var_os(&*PATH_KEY).unwrap_or_default()).collect::>(); 15 | match setup() { 16 | Ok(fake_asdf_path) => { 17 | path.insert(0, fake_asdf_path); 18 | } 19 | Err(e) => { 20 | warn!("Failed to setup fake asdf: {:#}", e); 21 | } 22 | }; 23 | join_paths(path).unwrap().to_string_lossy().to_string() 24 | } 25 | -------------------------------------------------------------------------------- /src/gpg.rs: -------------------------------------------------------------------------------- 1 | use crate::Result; 2 | use crate::cmd::CmdLineRunner; 3 | use crate::install_context::InstallContext; 4 | 5 | pub fn add_keys_node(ctx: &InstallContext) -> Result<()> { 6 | add_keys(ctx, include_str!("assets/gpg/node.asc")) 7 | } 8 | 9 | pub fn add_keys_swift(ctx: &InstallContext) -> Result<()> { 10 | add_keys(ctx, include_str!("assets/gpg/swift.asc")) 11 | } 12 | 13 | fn add_keys(ctx: &InstallContext, keys: &str) -> Result<()> { 14 | CmdLineRunner::new("gpg") 15 | .arg("--quiet") 16 | .arg("--import") 17 | .stdin_string(keys) 18 | .with_pr(&ctx.pr) 19 | .execute() 20 | } 21 | -------------------------------------------------------------------------------- /src/install_context.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use crate::ui::progress_report::SingleReport; 4 | use crate::{config::Config, toolset::Toolset}; 5 | 6 | pub struct InstallContext { 7 | pub config: Arc, 8 | pub ts: Arc, 9 | pub pr: Box, 10 | pub force: bool, 11 | } 12 | -------------------------------------------------------------------------------- /src/maplit.rs: -------------------------------------------------------------------------------- 1 | #[macro_export] 2 | macro_rules! hashmap { 3 | (@single $($x:tt)*) => (()); 4 | (@count $($rest:expr),*) => (<[()]>::len(&[$(hashmap!(@single $rest)),*])); 5 | 6 | ($($key:expr => $value:expr,)+) => { hashmap!($($key => $value),+) }; 7 | ($($key:expr => $value:expr),*) => { 8 | { 9 | let _cap = hashmap!(@count $($key),*); 10 | let mut _map = ::std::collections::HashMap::with_capacity(_cap); 11 | $( 12 | let _ = _map.insert($key, $value); 13 | )* 14 | _map 15 | } 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /src/minisign.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | use minisign_verify::*; 3 | use std::iter::Iterator; 4 | use std::sync::LazyLock; 5 | 6 | pub static MISE_PUB_KEY: LazyLock = LazyLock::new(|| { 7 | include_str!("../minisign.pub") 8 | .to_string() 9 | .lines() 10 | .last() 11 | .unwrap() 12 | .to_string() 13 | }); 14 | 15 | pub fn verify(pub_key: &str, data: &[u8], sig: &str) -> Result<()> { 16 | let public_key = PublicKey::from_base64(pub_key)?; 17 | let signature = Signature::decode(sig)?; 18 | public_key.verify(data, &signature, false)?; 19 | Ok(()) 20 | } 21 | -------------------------------------------------------------------------------- /src/path.rs: -------------------------------------------------------------------------------- 1 | pub use std::path::*; 2 | 3 | use crate::dirs; 4 | 5 | pub trait PathExt { 6 | /// replaces $HOME with "~" 7 | fn display_user(&self) -> String; 8 | fn mount(&self, on: &Path) -> PathBuf; 9 | fn is_empty(&self) -> bool; 10 | } 11 | 12 | impl PathExt for Path { 13 | fn display_user(&self) -> String { 14 | let home = dirs::HOME.to_string_lossy(); 15 | match cfg!(unix) && self.starts_with(home.as_ref()) && home != "/" { 16 | true => self.to_string_lossy().replacen(home.as_ref(), "~", 1), 17 | false => self.to_string_lossy().to_string(), 18 | } 19 | } 20 | 21 | fn mount(&self, on: &Path) -> PathBuf { 22 | if self.is_empty() { 23 | on.to_path_buf() 24 | } else { 25 | on.join(self) 26 | } 27 | } 28 | 29 | fn is_empty(&self) -> bool { 30 | self.as_os_str().is_empty() 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/plugins/snapshots/mise__plugins__mise_plugin_toml__tests__fixture.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/plugins/mise_plugin_toml.rs 3 | expression: cf.exec_env 4 | snapshot_kind: text 5 | --- 6 | MisePluginTomlScriptConfig { 7 | cache_key: Some( 8 | [ 9 | "{{'1234'}}", 10 | ], 11 | ), 12 | data: None, 13 | } 14 | -------------------------------------------------------------------------------- /src/rand.rs: -------------------------------------------------------------------------------- 1 | use rand::Rng; 2 | use rand::distr::Alphanumeric; 3 | 4 | pub fn random_string(length: usize) -> String { 5 | rand::rng() 6 | .sample_iter(&Alphanumeric) 7 | .take(length) 8 | .map(char::from) 9 | .collect::() 10 | } 11 | -------------------------------------------------------------------------------- /src/redactions.rs: -------------------------------------------------------------------------------- 1 | use indexmap::IndexSet; 2 | 3 | #[derive(Default, Clone, Debug, serde::Deserialize)] 4 | pub struct Redactions(pub IndexSet); 5 | 6 | impl Redactions { 7 | pub fn merge(&mut self, other: Self) { 8 | self.0.extend(other.0); 9 | } 10 | 11 | pub fn render(&mut self, tera: &mut tera::Tera, ctx: &tera::Context) -> eyre::Result<()> { 12 | for r in self.0.clone().drain(..) { 13 | self.0.insert(tera.render_str(&r, ctx)?); 14 | } 15 | Ok(()) 16 | } 17 | 18 | pub fn is_empty(&self) -> bool { 19 | self.0.is_empty() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/result.rs: -------------------------------------------------------------------------------- 1 | pub type Result = eyre::Result; 2 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__bash__tests__deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/bash.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | PROMPT_COMMAND="${PROMPT_COMMAND//_mise_hook;/}" 7 | PROMPT_COMMAND="${PROMPT_COMMAND//_mise_hook/}" 8 | unset _mise_hook 9 | unset mise 10 | unset MISE_SHELL 11 | unset __MISE_DIFF 12 | unset __MISE_SESSION 13 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__bash__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/bash.rs 3 | expression: "replace_path(&bash.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 4 | snapshot_kind: text 5 | --- 6 | export PATH="/some/dir:/2/dir:$PATH" 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__bash__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/bash.rs 3 | expression: "Bash::default().set_env(\"FOO\", \"1\")" 4 | snapshot_kind: text 5 | --- 6 | export FOO=1 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__bash__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/bash.rs 3 | expression: "Bash::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | unset FOO 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__elvish__tests__deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/elvish.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | unset-env MISE_SHELL 7 | unset-env __MISE_DIFF 8 | unset-env __MISE_SESSION 9 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__elvish__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/elvish.rs 3 | expression: "replace_path(&sh.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 4 | snapshot_kind: text 5 | --- 6 | set-env PATH '/some/dir:/2/dir'(get-env PATH) 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__elvish__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/elvish.rs 3 | expression: "Elvish::default().set_env(\"FOO\", \"1\")" 4 | snapshot_kind: text 5 | --- 6 | set-env FOO 1 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__elvish__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/elvish.rs 3 | expression: "Elvish::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | unset-env FOO 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__fish__tests__deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/fish.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | functions --erase __mise_env_eval 7 | functions --erase __mise_env_eval_2 8 | functions --erase __mise_cd_hook 9 | functions --erase mise 10 | set -e MISE_SHELL 11 | set -e __MISE_DIFF 12 | set -e __MISE_SESSION 13 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__fish__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/fish.rs 3 | expression: "replace_path(&sh.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 4 | snapshot_kind: text 5 | --- 6 | set -gx PATH '/some/dir:/2/dir' $PATH 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__fish__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/fish.rs 3 | expression: "Fish::default().set_env(\"FOO\", \"1\")" 4 | snapshot_kind: text 5 | --- 6 | set -gx FOO 1 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__fish__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/fish.rs 3 | expression: "Fish::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | set -e FOO 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__nushell__tests__deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/nushell.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | hide,MISE_SHELL, 7 | hide,__MISE_DIFF, 8 | hide,__MISE_DIFF, 9 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__nushell__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/nushell.rs 3 | expression: "replace_path(&sh.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 4 | snapshot_kind: text 5 | --- 6 | $env.PATH = ($env.PATH | prepend '/some/dir:/2/dir') 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__nushell__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/nushell.rs 3 | expression: "Nushell::default().set_env(\"FOO\", \"1\")" 4 | snapshot_kind: text 5 | --- 6 | set,FOO,1 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__nushell__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/nushell.rs 3 | expression: "Nushell::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | hide,FOO, 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__pwsh__tests__deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/pwsh.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | Remove-Item -ErrorAction SilentlyContinue function:mise 7 | Remove-Item -ErrorAction SilentlyContinue -Path Env:/MISE_SHELL 8 | Remove-Item -ErrorAction SilentlyContinue -Path Env:/__MISE_WATCH 9 | Remove-Item -ErrorAction SilentlyContinue -Path Env:/__MISE_DIFF 10 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__pwsh__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/pwsh.rs 3 | assertion_line: 173 4 | expression: "replace_path(&pwsh.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 5 | snapshot_kind: text 6 | --- 7 | $Env:PATH='/some/dir:/2/dir'+[IO.Path]::PathSeparator+$env:PATH 8 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__pwsh__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/pwsh.rs 3 | assertion_line: 167 4 | expression: "Pwsh::default().set_env(\"FOO\", \"1\")" 5 | snapshot_kind: text 6 | --- 7 | $Env:FOO='1' 8 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__pwsh__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/pwsh.rs 3 | expression: "Pwsh::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | Remove-Item -ErrorAction SilentlyContinue -Path Env:/FOO 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__xonsh__tests__hook_init.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/xonsh.rs 3 | expression: "xonsh.activate(exe, \" --status\".into())" 4 | snapshot_kind: text 5 | --- 6 | from os import environ 7 | import subprocess 8 | from xonsh.built_ins import XSH 9 | 10 | def listen_prompt(): # Hook Events 11 | execx($(/some/dir/mise hook-env --status -s xonsh)) 12 | 13 | envx = XSH.env 14 | envx[ 'MISE_SHELL'] = 'xonsh' 15 | environ['MISE_SHELL'] = envx.get_detyped('MISE_SHELL') 16 | XSH.builtins.events.on_pre_prompt(listen_prompt) # Activate hook: before showing the prompt 17 | 18 | def _mise(args): 19 | if args and args[0] in ('deactivate', 'shell', 'sh'): 20 | execx(subprocess.run(['command', 'mise', *args], stdout=subprocess.PIPE).stdout.decode()) 21 | else: 22 | subprocess.run(['command', 'mise', *args]) 23 | 24 | XSH.aliases['mise'] = _mise 25 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__xonsh__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/xonsh.rs 3 | expression: "replace_path(&sh.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 4 | snapshot_kind: text 5 | --- 6 | from os import environ 7 | from xonsh.built_ins import XSH 8 | 9 | envx = XSH.env 10 | envx[ 'PATH'].add('/some/dir:/2/dir', front=True) 11 | environ['PATH'] = envx.get_detyped('PATH') 12 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__xonsh__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/xonsh.rs 3 | expression: "Xonsh::default().set_env(\"FOO\", \"1\")" 4 | snapshot_kind: text 5 | --- 6 | from os import environ 7 | from xonsh.built_ins import XSH 8 | 9 | envx = XSH.env 10 | envx[ 'FOO'] = '1' 11 | environ['FOO'] = envx.get_detyped('FOO') 12 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__xonsh__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/xonsh.rs 3 | expression: "Xonsh::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | from os import environ 7 | from xonsh.built_ins import XSH 8 | 9 | envx = XSH.env 10 | envx.pop( 'FOO',None) 11 | environ.pop('FOO',None) 12 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__xonsh__tests__xonsh_deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/xonsh.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | import os 7 | from xonsh.built_ins import XSH 8 | 9 | hooks = { 10 | 'on_pre_prompt' : ['listen_prompt'], 11 | } 12 | for hook_type in hooks: 13 | hook_fns = hooks[hook_type] 14 | for hook_fn in hook_fns: 15 | hndl = getattr(XSH.builtins.events, hook_type) 16 | for fn in hndl: 17 | if fn.__name__ == hook_fn: 18 | hndl.remove(fn) 19 | break 20 | 21 | del XSH.aliases['mise'] 22 | del XSH.env['MISE_SHELL'] 23 | del os.environ['MISE_SHELL'] 24 | del XSH.env['__MISE_DIFF'] 25 | del os.environ['__MISE_DIFF'] 26 | del XSH.env['__MISE_SESSION'] 27 | del os.environ['__MISE_SESSION'] 28 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__zsh__tests__deactivate.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/zsh.rs 3 | expression: replace_path(&deactivate) 4 | snapshot_kind: text 5 | --- 6 | precmd_functions=( ${precmd_functions:#_mise_hook} ) 7 | chpwd_functions=( ${chpwd_functions:#_mise_hook} ) 8 | unset -f _mise_hook 9 | unset -f mise 10 | unset MISE_SHELL 11 | unset __MISE_DIFF 12 | unset __MISE_SESSION 13 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__zsh__tests__prepend_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/zsh.rs 3 | expression: "replace_path(&sh.prepend_env(\"PATH\", \"/some/dir:/2/dir\"))" 4 | snapshot_kind: text 5 | --- 6 | export PATH="/some/dir:/2/dir:$PATH" 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__zsh__tests__set_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/zsh.rs 3 | expression: "Zsh::default().set_env(\"FOO\", \"1\")" 4 | snapshot_kind: text 5 | --- 6 | export FOO=1 7 | -------------------------------------------------------------------------------- /src/shell/snapshots/mise__shell__zsh__tests__unset_env.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/shell/zsh.rs 3 | expression: "Zsh::default().unset_env(\"FOO\")" 4 | snapshot_kind: text 5 | --- 6 | unset FOO 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__add_path_to_old_and_new-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: "diff.new.get(\"PATH\").unwrap()" 4 | snapshot_kind: text 5 | --- 6 | /tmp:/foo:/bar:/new 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__add_path_to_old_and_new.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: "diff.old.get(\"PATH\").unwrap()" 4 | snapshot_kind: text 5 | --- 6 | /tmp:/foo:/tmp:/bar:/old 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__dump-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: diff 4 | snapshot_kind: text 5 | --- 6 | DirenvDiff { old: ["a=b"], new: ["c=d"] } 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__dump.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: "&output" 4 | --- 5 | eAGrVipQsqpWSlSyUkpSqtVRygPxkpWslFKUamsBdgEH_Q== 6 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__null_path-2.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: "diff.new.get(\"PATH\").unwrap()" 4 | snapshot_kind: text 5 | --- 6 | /tmp 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__null_path.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: "diff.old.get(\"PATH\").unwrap()" 4 | snapshot_kind: text 5 | --- 6 | /tmp 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__direnv__tests__parse.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/direnv.rs 3 | expression: diff 4 | snapshot_kind: text 5 | --- 6 | DirenvDiff { old: ["FOO=orig"], new: ["DIRENV_DIR=-/private/var/folders/0s/l3b8b_fs7fv5wdpr4lh9bd340000gr/T/tmp.prRveAyl", "DIRENV_FILE=/private/var/folders/0s/l3b8b_fs7fv5wdpr4lh9bd340000gr/T/tmp.prRveAyl/.envrc", "DIRENV_WATCHES=eJxszstK9DAUAOB3ybr0JE2aS3f_4l8KIroSkVxObCUzLScxMyK-u7gSxCf4vscPduvbyhYGB23dN4TuCfJeElIFXqHIYMNzrib3-ZIOUmV1IUnFOecvBPfQTsd40F3Hf-8FRjx3imxgN3tq2wnZIrSZhXNOm4H9v261VbY0esPP4Yd-qN_Ya7rCWPboC9TVE0LaCM8dfCn7BaTOUfKsJztbboLwShqXnQhm8koZTF7LKUqtjEWRuJ1zTEEoaTJ3U5D6r5PTv05PXwEAAP__GahVUg==", "FOO=bar"] } 7 | -------------------------------------------------------------------------------- /src/snapshots/mise__env_diff__tests__diff.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/env_diff.rs 3 | expression: diff.to_patches() 4 | snapshot_kind: text 5 | --- 6 | [ 7 | Change( 8 | "b", 9 | "3", 10 | ), 11 | Add( 12 | "c", 13 | "4", 14 | ), 15 | ] 16 | -------------------------------------------------------------------------------- /src/snapshots/mise__env_diff__tests__from_bash_script.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/env_diff.rs 3 | expression: ed 4 | snapshot_kind: text 5 | --- 6 | EnvDiff { 7 | old: [ 8 | "MODIFIED_VAR=original", 9 | ], 10 | new: [ 11 | "ADDED_VAR=added", 12 | "MODIFIED_VAR=modified", 13 | "MULTILINE_VAR=line1\nline2\nline3", 14 | ], 15 | } 16 | -------------------------------------------------------------------------------- /src/snapshots/mise__env_diff__tests__serialize.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/env_diff.rs 3 | expression: deserialized.to_patches() 4 | snapshot_kind: text 5 | --- 6 | [ 7 | Change( 8 | "b", 9 | "3", 10 | ), 11 | Add( 12 | "c", 13 | "4", 14 | ), 15 | ] 16 | -------------------------------------------------------------------------------- /src/snapshots/mise__hash__tests__hash_sha256.snap: -------------------------------------------------------------------------------- 1 | --- 2 | source: src/hash.rs 3 | expression: hash 4 | snapshot_kind: text 5 | --- 6 | 0b0debe521bb0f275806469aa295bb0fab42f0fbd3a1bea15b3f7ccd06985a4a 7 | -------------------------------------------------------------------------------- /src/toml.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashSet; 2 | 3 | #[macro_export] 4 | macro_rules! parse_error { 5 | ($key:expr, $val:expr, $t:expr) => {{ 6 | use eyre::bail; 7 | 8 | bail!( 9 | r#"expected value of {} to be a {}, got: {}"#, 10 | $crate::ui::style::eyellow($key), 11 | $crate::ui::style::ecyan($t), 12 | $crate::ui::style::eblue($val.to_string().trim()), 13 | ) 14 | }}; 15 | } 16 | 17 | pub fn dedup_toml_array(array: &toml_edit::Array) -> toml_edit::Array { 18 | let mut seen = HashSet::new(); 19 | let mut deduped = toml_edit::Array::new(); 20 | for item in array.iter() { 21 | if seen.insert(item.as_str()) { 22 | deduped.push(item.clone()); 23 | } 24 | } 25 | deduped 26 | } 27 | -------------------------------------------------------------------------------- /src/ui/ctrlc_stub.rs: -------------------------------------------------------------------------------- 1 | pub fn init() {} 2 | 3 | // pub fn add_handler(_func: impl Fn() + Send + Sync + 'static) {} 4 | 5 | pub fn exit_on_ctrl_c(_do_exit: bool) {} 6 | 7 | /// ensures cursor is displayed on ctrl-c 8 | pub fn show_cursor_after_ctrl_c() {} 9 | -------------------------------------------------------------------------------- /src/ui/mod.rs: -------------------------------------------------------------------------------- 1 | pub use prompt::confirm; 2 | 3 | #[cfg_attr(any(test, windows), path = "ctrlc_stub.rs")] 4 | pub mod ctrlc; 5 | pub(crate) mod info; 6 | pub mod multi_progress_report; 7 | pub mod progress_report; 8 | pub mod prompt; 9 | pub mod style; 10 | pub mod table; 11 | pub mod time; 12 | pub mod tree; 13 | -------------------------------------------------------------------------------- /src/ui/time.rs: -------------------------------------------------------------------------------- 1 | use std::time::Duration; 2 | 3 | pub fn format_duration(dur: Duration) -> String { 4 | if dur < Duration::from_millis(1) { 5 | format!("{dur:.0?}") 6 | } else if dur < Duration::from_secs(1) { 7 | format!("{dur:.1?}") 8 | } else { 9 | format!("{dur:.2?}") 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | !data/plugins 3 | cache/ 4 | state/ 5 | cwd/ 6 | test-build-output.txt 7 | -------------------------------------------------------------------------------- /test/.test-tool-versions: -------------------------------------------------------------------------------- 1 | tiny 2 2 | dummy ref:master 3 | -------------------------------------------------------------------------------- /test/config/config.toml: -------------------------------------------------------------------------------- 1 | [env] 2 | TEST_ENV_VAR = 'test-123' 3 | 4 | [alias.tiny.versions] 5 | "my/alias" = '3.0' 6 | 7 | [tasks.configtask] 8 | run = 'echo "configtask:"' 9 | [tasks.lint] 10 | run = 'echo "linting!"' 11 | [tasks.test] 12 | run = 'echo "testing!"' 13 | [settings] 14 | always_keep_download = true 15 | always_keep_install = true 16 | idiomatic_version_file = true 17 | plugin_autoupdate_last_check_duration = "20m" 18 | jobs = 2 19 | -------------------------------------------------------------------------------- /test/config/settings.toml: -------------------------------------------------------------------------------- 1 | experimental = true 2 | verbose = true 3 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/download: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | exit 0 4 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/get-version-from-legacy-file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | get_legacy_version() { 4 | current_directory=$1 5 | version_file="$current_directory/.dummy-version" 6 | 7 | if [ -f "$version_file" ]; then 8 | cat "$version_file" 9 | fi 10 | } 11 | 12 | get_legacy_version "$1" 13 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/help.overview: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "Dummy plugin documentation" 4 | echo 5 | echo "Dummy plugin is a plugin only used for unit tests" 6 | 7 | if [ -n "$ASDF_INSTALL_VERSION" ]; then 8 | echo 9 | echo "Details specific for version $ASDF_INSTALL_VERSION" 10 | fi 11 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/latest-stable: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | get_latest_stable() { 4 | query=$1 5 | 6 | version_list=(1.0.0 1.1.0 2.0.0) 7 | printf "%s\n" "${version_list[@]}" | grep -E "^\s*$query" | tail -1 8 | } 9 | 10 | get_latest_stable "$1" 11 | 12 | if [ "$MISE_FAILURE" = "1" ]; then 13 | echo "error: MISE_FAILURE set" >&2 14 | exit 1 15 | fi 16 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/list-all: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | versions_list=(1.0.0 1.1.0 2.0.0) 4 | echo "${versions_list[@]}" 5 | # Sending message to STD error to ensure that it is ignored 6 | echo "ignore this error" >&2 7 | 8 | if [ "$RTX_FAILURE" = "1" ]; then 9 | echo "error: RTX_FAILURE set" >&2 10 | exit 1 11 | fi 12 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/list-legacy-filenames: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo ".dummy-version .dummyrc" 4 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/parse-legacy-file: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # shellcheck disable=SC2020 4 | tr <"$1" -d "dummy-" 5 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/post-plugin-add: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "plugin add path=${ASDF_PLUGIN_PATH} source_url=${ASDF_PLUGIN_SOURCE_URL}" 4 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/post-plugin-update: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "plugin updated path=${ASDF_PLUGIN_PATH} old git-ref=${ASDF_PLUGIN_PREV_REF} new git-ref=${ASDF_PLUGIN_POST_REF}" 4 | -------------------------------------------------------------------------------- /test/data/plugins/dummy/bin/pre-plugin-remove: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo "plugin-remove ${ASDF_PLUGIN_PATH}" 4 | -------------------------------------------------------------------------------- /test/data/plugins/tiny/.gitignore: -------------------------------------------------------------------------------- 1 | .rtxcache* 2 | -------------------------------------------------------------------------------- /test/data/plugins/tiny/bin/exec-env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu -o pipefail 4 | 5 | JDXCODE_TINY="$(cat "$ASDF_INSTALL_PATH/VERSION")" 6 | export JDXCODE_TINY 7 | -------------------------------------------------------------------------------- /test/data/plugins/tiny/bin/install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu -o pipefail 4 | 5 | echo "$ASDF_INSTALL_VERSION" > "$ASDF_INSTALL_PATH/VERSION" 6 | bin_path="$ASDF_INSTALL_PATH/bin" 7 | mkdir -p "$bin_path" 8 | cat <"$bin_path/rtx-tiny" 9 | #!/usr/bin/env bash 10 | echo rtx-tiny: v"$ASDF_INSTALL_VERSION" args: "\$@" 11 | EOF 12 | chmod +x "$bin_path/rtx-tiny" 13 | -------------------------------------------------------------------------------- /test/data/plugins/tiny/bin/list-aliases: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu -o pipefail 4 | 5 | echo "lts 3.1.0" 6 | echo "lts-prev 2.0.0" 7 | -------------------------------------------------------------------------------- /test/data/plugins/tiny/bin/list-all: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu -o pipefail 4 | 5 | if [ "${RTX_TINY_LIST_ALL_FAIL:-}" = "1" ]; then 6 | echo "RTX_TINY_LIST_ALL_FAIL is set to 1, failing" 7 | exit 1 8 | fi 9 | 10 | echo 1.0.0 11 | echo 1.1.0 12 | echo 1.0.1 13 | echo 2.0.0 14 | echo 2.0.1 15 | echo 2.1.0 16 | echo 3.0.0 17 | echo 3.0.1 18 | echo 3.1.0 19 | -------------------------------------------------------------------------------- /test/data/plugins/tiny/bin/list-legacy-filenames: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo ".tiny-version" 4 | -------------------------------------------------------------------------------- /test/fixtures/.env: -------------------------------------------------------------------------------- 1 | export FOO="foo1" 2 | -------------------------------------------------------------------------------- /test/fixtures/.env2: -------------------------------------------------------------------------------- 1 | export FOO2="foo2" 2 | -------------------------------------------------------------------------------- /test/fixtures/.mise.toml: -------------------------------------------------------------------------------- 1 | [env] 2 | NODE_ENV = 'production' 3 | 4 | [tools] 5 | terraform = '1.0.0' 6 | node = ['18', 'prefix:20', 'ref:master', 'path:~/.nodes/18'] 7 | jq = { prefix = '1.6' } 8 | shellcheck = { version = '0.9.0' } 9 | python = [{ version = '3.10.0', venv = '.venv' }, { version = '3.9.0' }] 10 | 11 | [plugins] 12 | node = 'https://github.com/jdx/rtx-node' 13 | 14 | [settings] 15 | verbose = true 16 | disable_tools = ['disabled_tool'] 17 | legacy_version_file_disable_tools = ['disabled_tool_from_legacy_file'] 18 | 19 | [alias.node.versions] 20 | my_custom_node = '18' 21 | -------------------------------------------------------------------------------- /test/fixtures/exec-env: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | export UNMODIFIED_VAR="unmodified" 4 | export UNMODIFIED_NEWLINE_VAR="hello\nworld" 5 | export UNMODIFIED_SQUOTE_VAR="hello\'world" 6 | export UNMODIFIED_ESCAPE_VAR="hello\\world" 7 | export MODIFIED_VAR="modified" 8 | export ADDED_VAR="added" 9 | export MULTILINE_VAR="line1 10 | line2 11 | line3" 12 | export ESCAPES="\\n\\t\\r\\v\\f\\a\\b\\e\\0\\x1b\\u1234\\U00012345\a\b\e\E\f\n\r\t\v\"?\`\$\g'\0" 13 | export BELL=$'\a' 14 | export BACKSPACE=$'\b' 15 | export ESCAPE=$'\e' 16 | export ESCAPE2=$'\E' 17 | export FORM_FEED=$'\f' 18 | export NEWLINE=$'\n' 19 | export CARRIAGE_RETURN=$'\r' 20 | export TAB=$'\t' 21 | export VERTICAL_TAB=$'\v' 22 | export DOUBLE_QUOTE=$'"' 23 | export SINGLE_QUOTE=$"'" 24 | export QUESTION_MARK=$'?' 25 | export BACKTICK=$'`' 26 | export DOLLAR=$'$' 27 | export G=$'g' 28 | 29 | # shellcheck disable=SC2034 30 | unexported="unexported val" 31 | -------------------------------------------------------------------------------- /test/fixtures/mise.plugin.toml: -------------------------------------------------------------------------------- 1 | #:schema ../../schema/mise.plugin.json 2 | 3 | [exec-env] 4 | cache-key = ["{{'1234'}}"] 5 | -------------------------------------------------------------------------------- /test/fixtures/shorthands.toml: -------------------------------------------------------------------------------- 1 | node = "https://node" 2 | xxxxxx = "https://xxxxxx" 3 | -------------------------------------------------------------------------------- /test/fixtures/signal-test.js: -------------------------------------------------------------------------------- 1 | let i = 3; 2 | 3 | process.on("SIGINT", function () { 4 | if (i > 0) { 5 | console.log(`Got SIGINT. Press Control-D to exit. ${i} times left`); 6 | i--; 7 | } else { 8 | process.exit(); 9 | } 10 | }); 11 | 12 | // wait for 60 seconds 13 | setTimeout(function () {}, 60000); 14 | console.log("Running. Press Control-C to test."); 15 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@tsconfig/node18/tsconfig.json", 3 | "include": ["**/*"], 4 | "exclude": ["node_modules"], 5 | "compilerOptions": { 6 | "outDir": "./build", 7 | "types": ["@withfig/autocomplete-types", "node"] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /xtasks/.hidden-executable: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | echo "this should not show as a task" 5 | -------------------------------------------------------------------------------- /xtasks/.hidden/bar/baz/hidden-executable: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | cargo clippy -- -Dwarnings 5 | cargo fmt --all -- --check 6 | # shellcheck disable=SC2046 7 | prettier -c $(git ls-files '*.yml' '*.yaml') 8 | markdownlint . 9 | actionlint 10 | -------------------------------------------------------------------------------- /xtasks/docs/release: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -xeuo pipefail 3 | #MISE depends=["docs:build"] 4 | #MISE dir="docs" 5 | 6 | aws --version 7 | export AWS_REGION=auto 8 | export AWS_ENDPOINT_URL=https://6e243906ff257b965bcae8025c2fc344.r2.cloudflarestorage.com 9 | 10 | if [ "${DRY_RUN:-true}" = "true" ]; then 11 | aws() { 12 | echo "DRY RUN: aws $*" 13 | } 14 | fi 15 | 16 | if [ $((RANDOM % 30)) -eq 0 ]; then 17 | # delete old assets only roughly 1/30 times 18 | # deleting old assets can break the site for people currently on it 19 | # but it's also good to keep things tidy 20 | aws s3 rm --recursive s3://mise/assets/ 21 | aws s3 rm --recursive --exclude "*" --include "*.html" s3://mise/ 22 | fi 23 | 24 | aws s3 cp --recursive --checksum-algorithm CRC32 .vitepress/dist s3://mise/ 25 | -------------------------------------------------------------------------------- /xtasks/fig/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | -------------------------------------------------------------------------------- /xtasks/fig/src/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/xtasks/fig/src/.gitignore -------------------------------------------------------------------------------- /xtasks/filetask: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # shellcheck disable=SC2154 3 | #USAGE flag "-f --force" help="Overwrite existing " 4 | #USAGE flag "-u --user " help="User to run as" 5 | #USAGE arg "" help="The file to write" default="file.txt" 6 | #USAGE arg "" help="An arg with a default" default="mydefault" 7 | 8 | #MISE description="This is a test build script" 9 | #MISE sources=[".test-tool-versions"] 10 | #MISE outputs=["$MISE_PROJECT_ROOT/test/test-build-output.txt"] 11 | #MISE env={TEST_BUILDSCRIPT_ENV_VAR = "VALID"} 12 | #MISE dir="{{config_root}}" 13 | #MISE alias="ft" 14 | 15 | set -exo pipefail 16 | cd "$MISE_PROJECT_ROOT" || exit 1 17 | echo "running test-build script" 18 | echo "TEST_BUILDSCRIPT_ENV_VAR: $TEST_BUILDSCRIPT_ENV_VAR" >test/test-build-output.txt 19 | echo "ARGS:" "$@" 20 | 21 | echo "usage_force: $usage_force" 22 | echo "usage_user: $usage_user" 23 | echo "usage_file: $usage_file" 24 | -------------------------------------------------------------------------------- /xtasks/filetask.bat: -------------------------------------------------------------------------------- 1 | echo mytask 2 | -------------------------------------------------------------------------------- /xtasks/lint-fix.ps1: -------------------------------------------------------------------------------- 1 | #MISE alias=["format"] 2 | #MISE wait_for=["build", "render:settings"] 3 | $ErrorActionPreference = "Stop" 4 | $PSNativeCommandUseErrorActionPreference = $true 5 | 6 | cargo clippy --fix --allow-staged --allow-dirty -- -Dwarnings 7 | prettier -w . 8 | cargo fmt --all 9 | -------------------------------------------------------------------------------- /xtasks/lint-fix.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #MISE alias=["format", "fix"] 3 | #MISE wait_for=["render:settings"] 4 | set -euxo pipefail 5 | 6 | markdownlint --fix . 7 | taplo fmt 8 | SHELLCHECK_OPTS="--exclude=SC1090 --exclude=SC2046" actionlint 9 | toml-sort -i settings.toml --spaces-indent-inline-array 4 10 | toml-sort -i registry.toml --spaces-indent-inline-array 4 11 | 12 | cat >rustfmt.toml <&1) 5 | status=$? 6 | if ((status)); then 7 | echo "$output" >&2 8 | fi 9 | 10 | exit $status 11 | -------------------------------------------------------------------------------- /xtasks/show-output-on-failure.bat: -------------------------------------------------------------------------------- 1 | %* 2 | -------------------------------------------------------------------------------- /xtasks/test/coverage: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #MISE description="run all tests with coverage report" 3 | 4 | echo "::group::Setup" 5 | set -euxo pipefail 6 | # shellcheck disable=SC1090 7 | if [[ -n ${MISE_GITHUB_BOT_TOKEN:-} ]]; then 8 | export GITHUB_API_TOKEN="$MISE_GITHUB_BOT_TOKEN" 9 | fi 10 | export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$PWD/target}" 11 | export PATH="${CARGO_TARGET_DIR}/debug:$PATH" 12 | 13 | echo "::endgroup::" 14 | echo "::group::mise install" 15 | mise install 16 | mise x -- bun i 17 | echo "::endgroup::" 18 | mise x -- ./e2e/run_all_tests 19 | -------------------------------------------------------------------------------- /xtasks/test/e2e: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | #MISE depends=["build"] 3 | #MISE alias="e" 4 | #MISE description="run end-to-end tests" 5 | set -euo pipefail 6 | 7 | export RUST_TEST_THREADS=1 8 | 9 | if [[ ${1:-all} == all ]]; then 10 | ./e2e/run_all_tests 11 | else 12 | pushd e2e 13 | FILES="$(fd -tf "$1" --and "^test_")" 14 | popd 15 | if [[ -z $FILES ]]; then 16 | echo "Not test matches $1" >&2 17 | exit 1 18 | fi 19 | for FILE in $FILES; do 20 | ./e2e/run_test "$FILE" 21 | done 22 | fi 23 | -------------------------------------------------------------------------------- /xtasks/testtask.ps1: -------------------------------------------------------------------------------- 1 | Write-Host windows 2 | -------------------------------------------------------------------------------- /xtasks/testtask.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo unix 3 | -------------------------------------------------------------------------------- /xtasks/update-descriptions: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euxo pipefail 3 | 4 | for tool in $(mise registry | awk '{print $1}'); do 5 | description="$(mise tool --description "$tool")" 6 | if [ "$description" != "[none]" ]; then 7 | toml set registry.toml "tools.$tool.description" "$description" >registry.toml.tmp 8 | mv registry.toml.tmp registry.toml 9 | fi 10 | done 11 | -------------------------------------------------------------------------------- /zipsign.pub: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jdx/mise/11bda4bda97bd02f6a8cae2c7f345846769ff776/zipsign.pub --------------------------------------------------------------------------------