Shell Activation experimental
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 shell 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 <<<Semantics
[bootstrap.mise_shell_activate] follows the same manual, idempotent model as other bootstrap sections:
- Per-target override - a project config can override a global setting for one startup file with
zshrc = falsewithout changingzprofile. - Manual application only - mise never edits shell rc files implicitly. Only
mise bootstrap shell applyandmise bootstrapapply this section. - Marker-owned edits - mise only owns the block between its markers. Other content in the rc file is left untouched.
- Shims stay out of
zshenvby default -zshenvis supported when configured explicitly, but shell shortcuts do not write it because zsh reads it for every invocation, including scripts. - Explicit dotfiles win - if
[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.
Commands
mise bootstrap shell status # shows activation block state
mise bootstrap shell status --json # machine-readable
mise bootstrap shell status --missing # exit 1 if anything is out of sync
mise bootstrap shell apply # writes missing/different blocks
mise bootstrap shell apply --dry-run # print the edits instead
mise bootstrap shell apply --yes # skip the confirmation promptJSON 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.