uv tool update-shell
Ensure that the tool executable directory is on thePATH.
Aliases
uv tool ensurepath- Alternative name for the same command
Usage
Description
If the tool executable directory is not present on thePATH, uv will attempt to add it to the relevant shell configuration files.
If the shell configuration files already include a blurb to add the executable directory to the path, but the directory is not present on the PATH, uv will exit with an error.
The tool executable directory is determined according to the XDG standard and can be retrieved with uv tool dir --bin.
After running this command, you need to restart your shell or source your shell configuration file for the changes to take effect.
When to Use
Run this command when:- You’ve just installed your first tool with
uv tool install - You get “command not found” errors after installing a tool
- You’ve installed uv and want to ensure tools can be run from anywhere
- You’re setting up a new development environment
Examples
Add tool directory to PATH
Apply changes immediately
Check if update is needed
What Gets Modified
The command modifies your shell configuration file by adding the tool directory to yourPATH. The specific file depends on your shell:
Bash
Modifies~/.bashrc (Linux) or ~/.bash_profile (macOS):
Zsh
Modifies~/.zshrc:
Fish
Modifies~/.config/fish/config.fish:
PowerShell (Windows)
Modifies PowerShell profile:Tool Executable Directory
The tool executable directory location varies by platform:Unix/Linux/macOS
Determined by the following environment variables, in order:$UV_TOOL_BIN_DIR(if set)$XDG_BIN_HOME(if set)$XDG_DATA_HOME/../bin(ifXDG_DATA_HOMEis set)$HOME/.local/bin(default)
Windows
%LOCALAPPDATA%\uv\bin
Finding your tool directory
Behavior Details
Already configured
If the configuration is already present, uv will report this:Configuration exists but not in current PATH
If the shell configuration file contains the correct entry but your currentPATH doesn’t include it:
Multiple shells
If you use multiple shells, run the command in each:Verification
After runninguv tool update-shell and restarting your shell:
Check PATH includes tool directory
Test with an installed tool
Check shell configuration
Troubleshooting
Changes not taking effect
If tools are still not found after runningupdate-shell:
Permission errors
If you get permission errors when modifying shell configuration:Multiple PATH entries
If you’ve runupdate-shell multiple times, you might have duplicate entries:
Custom shell location
If you use a non-standard shell configuration location:Container/Docker environments
In containerized environments, you might need to add the PATH directly:Tool directory on non-standard location
If using a custom tool directory viaUV_TOOL_BIN_DIR:
Best Practices
First-time setup
When setting up uv on a new system:Team onboarding
Include in your project’s setup documentation:CI/CD environments
In CI/CD, explicitly set PATH instead of usingupdate-shell:
Manual Configuration
If you prefer to manually configure your PATH orupdate-shell doesn’t work for your setup:
See Also
- uv tool install - Install tools
- uv tool dir - Show tool directories
- uv tool list - List installed tools