|
| 1 | +tags:: [[Diataxis/How To]] |
| 2 | + |
| 3 | +- # How to Install Mise for the First Time |
| 4 | + - ## Goal |
| 5 | + - Install and configure mise, a tool for managing programming language runtimes and development tools. |
| 6 | + - ## Preconditions |
| 7 | + - A Unix-like operating system (macOS, Linux, or WSL) |
| 8 | + - Basic familiarity with the command line |
| 9 | + - Git installed (for version control) |
| 10 | + - ## Procedure |
| 11 | + - ### 1. Install the mise CLI |
| 12 | + - Run the following command in your terminal: |
| 13 | + - ~~~ |
| 14 | + curl https://mise.run | sh |
| 15 | + ~~~ |
| 16 | + - This will install mise to `~/.local/bin/mise` |
| 17 | + - Verify the installation: |
| 18 | + - ~~~ |
| 19 | + ~/.local/bin/mise --version |
| 20 | + ~~~ |
| 21 | + - If the curl command fails, try downloading the binary directly from [mise releases](https://github.com/jdx/mise/releases) |
| 22 | + - ### 2. Choose an Activation Method |
| 23 | + - #### Option A: Project-Specific Setup (Recommended for First-Time Users) |
| 24 | + - This option is best if you want to try mise with a specific project first |
| 25 | + - No shell configuration changes required |
| 26 | + - You'll need to prefix commands with `mise exec` or use `mise run` |
| 27 | + - Example: |
| 28 | + - ~~~ |
| 29 | + mise exec -- python --version |
| 30 | + ~~~ |
| 31 | + - #### Option B: Global Setup (Recommended for Regular Users) |
| 32 | + - This option makes mise available system-wide |
| 33 | + - Add the following to your shell's configuration file: |
| 34 | + - For bash (`~/.bashrc`): |
| 35 | + - ~~~ |
| 36 | + echo 'eval "$(~/.local/bin/mise activate bash)"' >> ~/.bashrc |
| 37 | + ~~~ |
| 38 | + - For zsh (`~/.zshrc`): |
| 39 | + - ~~~ |
| 40 | + echo 'eval "$(~/.local/bin/mise activate zsh)"' >> ~/.zshrc |
| 41 | + ~~~ |
| 42 | + - For fish (`~/.config/fish/config.fish`): |
| 43 | + - ~~~ |
| 44 | + echo '~/.local/bin/mise activate fish | source' >> ~/.config/fish/config.fish |
| 45 | + ~~~ |
| 46 | + - Restart your shell or source your configuration file |
| 47 | + - Verify activation: |
| 48 | + - ~~~ |
| 49 | + mise --version |
| 50 | + ~~~ |
| 51 | + - ### 3. Configure Your Projects |
| 52 | + - Create a `mise.toml` file in your project root to manage tools and tasks |
| 53 | + - Basic configuration example: |
| 54 | + - ~~~ |
| 55 | + [tools] |
| 56 | + python = "3.13" |
| 57 | + node = "20" |
| 58 | + |
| 59 | + [tasks] |
| 60 | + test = "pytest" |
| 61 | + lint = "ruff check ." |
| 62 | + ~~~ |
| 63 | + - For more advanced configuration options, see the [mise configuration guide](https://mise.jdx.dev/configuration.html) |
| 64 | + - ## Troubleshooting |
| 65 | + - ### Installation Issues |
| 66 | + - If the curl command fails, try downloading the binary directly from [mise releases](https://github.com/jdx/mise/releases) |
| 67 | + - Ensure `~/.local/bin` is in your PATH |
| 68 | + - ### Activation Issues |
| 69 | + - If `mise` command is not found after activation: |
| 70 | + - Check that the activation line was added correctly to your shell config |
| 71 | + - Verify the path to mise binary (`~/.local/bin/mise`) |
| 72 | + - Try restarting your shell |
| 73 | + - ### Project-Specific Issues |
| 74 | + - If mise doesn't pick up project configuration: |
| 75 | + - Run `mise config ls` to see which config files are active |
| 76 | + - Ensure you're in the project root directory |
| 77 | + - Check that your `mise.toml` file is properly formatted |
| 78 | + - ## Next Steps |
| 79 | + - Learn about [mise configuration](https://mise.jdx.dev/configuration.html) |
| 80 | + - Explore [available tools](https://mise.jdx.dev/tools.html) |
| 81 | + - Read about [task management](https://mise.jdx.dev/tasks.html) |
| 82 | + - ## References |
| 83 | + - [Official mise documentation](https://mise.jdx.dev/) |
| 84 | + - [mise installation guide](https://mise.jdx.dev/installing-mise.html) |
| 85 | + - [mise configuration guide](https://mise.jdx.dev/configuration.html) |
| 86 | + - [mise tools guide](https://mise.jdx.dev/tools.html) |
| 87 | + - [mise tasks guide](https://mise.jdx.dev/tasks.html) |
0 commit comments