docs/bootstrap/shell.md
mise can declaratively add shell activation snippets for bash, zsh, and fish
with [bootstrap.mise_shell_activate]. Configure startup-file targets directly
when you want separate shims and normal activation setup:
[bootstrap.mise_shell_activate]
zprofile = "shims"
zshrc = "activate"
bash_profile = "shims"
bashrc = "activate"
fish = "activate"
Use compact table form when you want a shape that can accept future options:
[bootstrap.mise_shell_activate]
zprofile = {enabled = true, mode = "shims"}
zshrc = {enabled = true, mode = "activate"}
Shell keys are shortcuts. For example, zsh = true expands to
zprofile = "shims" and zshrc = "activate".
Any target can use either "activate" or "shims". Boolean true enables the
target with its default mode, and false disables it.
mise bootstrap mise-shell-activate apply writes marker-delimited blocks to the shell rc
file:
| Target | Shell | Default mode | Target file | Block |
|---|---|---|---|---|
bash_profile | bash | shims | ~/.bash_profile | eval "$(mise activate bash --shims)" |
bashrc | bash | activate | ~/.bashrc | eval "$(mise activate bash)" |
zprofile | zsh | shims | ~/.zprofile | eval "$(mise activate zsh --shims)" |
zshrc | zsh | activate | ~/.zshrc | eval "$(mise activate zsh)" |
zshenv | zsh | shims | ~/.zshenv | eval "$(mise activate zsh --shims)" |
fish | fish | activate | ~/.config/fish/config.fish | mise activate fish | source |
The markers are the same edit markers used by Dotfiles:
# >>> mise:activate >>> managed by mise - do not edit between markers
eval "$(mise activate zsh)"
# <<< mise:activate <<<
[bootstrap.mise_shell_activate] follows the same manual, idempotent model as
other bootstrap sections:
zshrc = false without changing zprofile.mise bootstrap mise-shell-activate apply and mise bootstrap apply this section.zshenv by default - zshenv is supported when
configured explicitly, but shell shortcuts do not write it because zsh reads
it for every invocation, including scripts.[dotfiles] already manages the same rc file
as a whole file, or defines an edit for the same target/id such as
"~/.zshrc/activate", mise skips the generated shell activation entry for
that shell.For fully managed rc files or custom activation blocks, use [dotfiles]
directly instead.
mise bootstrap mise-shell-activate status # shows activation block state
mise bootstrap mise-shell-activate status --json # machine-readable
mise bootstrap mise-shell-activate status --missing # exit 1 if anything is out of sync
mise bootstrap mise-shell-activate apply # writes missing/different blocks
mise bootstrap mise-shell-activate apply --dry-run # print the edits instead
mise bootstrap mise-shell-activate apply --yes # skip the confirmation prompt
JSON status entries include target, shell, path, mode, and state.
state is "missing" | "applied" | "differs" | "source_missing". Entries
with state = "differs" also include a reason field.