ZVM-ENV(1)

πŸ“¦ version 0.9.4, in nixpkgs unstable

πŸ’… ZVM-ENV(1) β€” zvm-env is giving per-shell Zig

okay so this is the ZVM-ENV(1) page from the User Commands section, and it's literally about zvm-env. bestie, it's giving "your shell can have its own private Zig era" and I'm obsessed. ✨

πŸŽ€ NAME πŸŽ€

zvm-env β€” give the current shell its own Zig version.

πŸ¦‹ SYNOPSIS πŸ¦‹

zvm env [--shell shell] [--use-on-cd]

🌸 DESCRIPTION 🌸

So the way this works: zvm env prints shell code, and when your shell evaluates that code, the shell gets its own private Zig version. no cap. πŸ’–

zvm env creates a per-shell link that points at the current global version β€” like, what ~/.zvm/bin points to β€” exports its path as ZVM_MULTISHELL_PATH, and prepends it to PATH, where it shadows ~/.zvm/bin. If no global version is set, the link points at ~/.zvm/bin itself, so the shell follows the global version until it selects its own. main character energy fr fr.

While ZVM_MULTISHELL_PATH names such a link, zvm-use(1) repoints only that link; other shells and the global default are unchanged. Use zvm use --global to change the default. periodt. πŸ’…

Per-shell links are stored in $ZVM_MULTISHELL_DIR (an absolute path outside the ZVM base directory), otherwise $XDG_STATE_HOME/zvm/multishells, otherwise zvm/multishells in the user cache directory (~/.cache on Linux, ~/Library/Caches on macOS, %LocalAppData% on Windows). Links older than a week whose shell has exited are removed by zvm env and zvm-clean(1). iconic cleanup behavior, honestly. 🧚

✨ OPTIONS ✨

  • --shell shell β€” Emit code for bash, zsh, fish, or powershell (pwsh is accepted). Defaults to the basename of $SHELL; an unrecognised shell is an error. 🫢
  • --use-on-cd β€” Also install a hook that runs whenever the working directory changes. It searches the new directory and then each parent for the nearest //! zvm-lock: line in build.zig or, failing that in the same directory, .minimum_zig_version in build.zig.zon, and switches this shell to that version. If the version is not installed it prints a one-line hint and changes nothing; if no version file is found it does nothing. The hook never prompts and never changes the global version. In bash the hook runs from PROMPT_COMMAND before the next prompt; zsh uses chpwd, fish a PWD variable handler, and PowerShell LocationChangedAction. lowkey a whole vibe check for your directory. πŸ”₯

🌈 EXAMPLES 🌈

drop these in your shell config and let it slay:

eval "$(zvm env --shell bash --use-on-cd)"     # ~/.bashrc
eval "$(zvm env --shell zsh --use-on-cd)"      # ~/.zshrc
zvm env --shell fish --use-on-cd | source      # config.fish
zvm env --shell powershell --use-on-cd | Out-String | Invoke-Expression

πŸ‘‘ SEE ALSO πŸ‘‘

zvm(1), zvm-use(1), zvm-clean(1) β€” go read those too, bestie, iykyk. πŸ’œ


okay that's the whole ZVM-ENV(1) page. this one is serving ZVM v0.9.4, October 2026, ZVM-ENV(1) energy, and yes β€” ate. πŸ’–βœ¨

πŸ“¦ where this page comes from
  • nixpkgs unstable: zvm 0.9.4
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms