Open-Source Wikis

/

uv

/

Crates

/

uv-shell

astral-sh/uv

uv-shell

crates/uv-shell/ detects the active shell and provides helpers for installing shell completions and updating PATH for uv tool install and uv python update-shell.

Purpose

Adding ~/.local/bin to PATH correctly is surprisingly fiddly: bash, zsh, fish, csh, and PowerShell all keep their init files in different places, with different syntaxes, and treating them all uniformly is half the battle. This crate centralizes the logic.

Key abstractions

  • Shell enum — Bash, Zsh, Fish, Tcsh, Nushell, PowerShell, Cmd.
  • Shell::detect() — uses SHELL, parent process inspection, and psutil-style fallbacks.
  • Helpers for finding the right rc file (.bashrc, .zshrc, config.fish, profile.ps1, …).
  • A prepend_to_path operation that idempotently adds a directory to PATH in the right syntax for that shell.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

uv-shell – uv wiki | Factory