ZVM-ENV(1)
π
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 β¨
--shellshell β Emit code forbash,zsh,fish, orpowershell(pwshis 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 inbuild.zigor, failing that in the same directory,.minimum_zig_versioninbuild.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. Inbashthe hook runs fromPROMPT_COMMANDbefore the next prompt;zshuseschpwd,fishaPWDvariable handler, and PowerShellLocationChangedAction. 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
- Copyright 2026 Tristan Isham. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms