Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ By leveraging these plugins, you can streamline your workflow and tackle coding
| golang | The Go programming language, along with its tools and standard libraries. |
| jump | Jump helps you navigate faster by learning your habits. |
| kubectl | Command-line tool for interacting with Kubernetes clusters. |
| [mise](mise) | [mise](https://mise.jdx.dev) is a polyglot tool version manager for Node.js, Python, Ruby, Go, and more. |
| npm | Package manager for Node.js facilitating installation and management of project dependencies. |
| nvm | Node.js version manager allowing easy switching between different Node.js versions. |
| progress | Insufficient information provided to give a precise description. |
Expand Down
56 changes: 56 additions & 0 deletions plugins/mise/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# mise plugin

Add [oh-my-bash](https://ohmybash.github.io) integration with [mise](https://mise.jdx.dev), a polyglot tool version manager for Node.js, Python, Ruby, Go, and more. mise is a faster, drop-in replacement for [asdf](https://asdf-vm.com) that also supports `.tool-versions` files.

## Installation

1. [Install mise](https://mise.jdx.dev/getting-started.html) by running the following:

```bash
curl https://mise.run | sh
```

2. Enable the plugin by adding it to your oh-my-bash `plugins` definition in `~/.bashrc`.

```sh
plugins=(mise)
```

The plugin resolves the mise binary automatically — no manual `eval` line in `~/.bashrc` is needed. It checks the following locations in order:

1. `mise` on `$PATH` (system package managers: apt, brew, dnf, pacman, etc.)
2. `$MISE_INSTALL_PATH` (custom install path set at install time)
3. `~/.local/bin/mise` (default location for `curl https://mise.run | sh`)

## Configuration

### Quiet mode

By default, mise may print a message when activated. To suppress this, set the following variable **before** the `source` line in your `~/.bashrc`:

```sh
OMB_PLUGIN_MISE_QUIET=true
```

## Aliases

All aliases target the resolved mise binary, so they work regardless of whether mise is on `$PATH`.

| Alias | Command | Description |
|--------|-------------------|------------------------------------------|
| `mi` | `mise install` | Install tool versions defined in config |
| `mu` | `mise use` | Set a tool version in the config file |
| `mr` | `mise run` | Run a task defined in `mise.toml` |
| `mex` | `mise exec` | Run a command in the mise environment |
| `mls` | `mise ls` | List installed tool versions |
| `mlsr` | `mise ls-remote` | List available remote versions |

## Usage

See the [mise documentation](https://mise.jdx.dev/getting-started.html) for full usage:

```bash
mi node@22 # mise install node@22
mu node@lts # mise use node@lts
mex -- node --version
```
37 changes: 37 additions & 0 deletions plugins/mise/mise.plugin.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! bash oh-my-bash.module
# Description: Integrate mise (https://mise.jdx.dev), a polyglot tool version manager
#
# @var[opt] OMB_PLUGIN_MISE_QUIET set to 'true' to suppress mise activation output

# Resolve the mise binary: check PATH first, then the default install location
# used by the official installer (curl https://mise.run | sh), then any custom
# install path set via MISE_INSTALL_PATH.
_omb_plugin_mise_bin=
if _omb_util_command_exists mise; then
_omb_plugin_mise_bin=mise
elif [[ -x "${MISE_INSTALL_PATH:-}" ]]; then
_omb_plugin_mise_bin=$MISE_INSTALL_PATH
elif [[ -x "$HOME/.local/bin/mise" ]]; then
_omb_plugin_mise_bin=$HOME/.local/bin/mise
fi

if [[ -n $_omb_plugin_mise_bin ]]; then
if [[ ${OMB_PLUGIN_MISE_QUIET-} == true ]]; then
eval "$("$_omb_plugin_mise_bin" activate bash --quiet)"
else
eval "$("$_omb_plugin_mise_bin" activate bash)"
fi

# Use the resolved binary path in aliases so they work even when mise is
# not yet on $PATH (e.g. installed via MISE_INSTALL_PATH or ~/.local/bin).
local _omb_plugin_mise_bin_q
printf -v _omb_plugin_mise_bin_q '%q' "$_omb_plugin_mise_bin"
alias mi="$_omb_plugin_mise_bin_q install"
alias mu="$_omb_plugin_mise_bin_q use"
alias mr="$_omb_plugin_mise_bin_q run"
alias mex="$_omb_plugin_mise_bin_q exec"
alias mls="$_omb_plugin_mise_bin_q ls"
alias mlsr="$_omb_plugin_mise_bin_q ls-remote"
unset -v _omb_plugin_mise_bin_q
fi
unset _omb_plugin_mise_bin
Comment thread
qodo-free-for-open-source-projects[bot] marked this conversation as resolved.