uv tool install : premier CLI global sans casser le PATH

Première voie propre pour un CLI Python global : uv tool install et update-shell.

You installed uv and still type pip install --user or pipx install whenever you want ruff on PATH. The first global CLI path that stays isolated is uv tool install. When a diagram needs a shared page, start a room.

Stop when uv tool install ruff finished, uv tool update-shell is sourced, and a new shell prints ruff --version. Search query: uv tool install global CLI without breaking PATH. This is not the uv run script guide — see uv run first for that.

uv on PATHuv tool installupdate-shellruff --version
uv tool installglobal binary
update-shellPATH hook
uvxno install

Prerequisites

  1. 1
    Install uv

    macOS / Linux: curl -LsSf https://astral.sh/uv/install.sh | sh. Windows: powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex". Or brew install uv.

  2. 2
    Confirm uv

    New terminal: uv --version. The standalone installer puts uv on PATH; if not, follow the installer hint for your shell.

Install the first tool globally

Official tools docs: uv tool install creates an isolated environment under uv’s tools directory and symlinks console scripts into uv’s executable directory (commonly ~/.local/bin). Dependencies stay out of your project venv and off the system Python.

uv tool install ruff
uv tool list
which ruff
ruff --version

If which ruff is empty, the executable directory is not on PATH. uv prints a warning in that case.

Fix PATH without hand-editing five files

Docs: uv tool update-shell appends the executable directory to common shell startup files (bash, zsh, fish). Re-open the terminal or source the file it touched, then retry ruff --version.

uv tool update-shell
# open a new terminal
ruff --version

When uvx is enough

One-off runs

uvx ruff check (alias for uv tool run) uses a cached disposable env. Prefer this for occasional commands.

Install for scripts and CI images

Install when another program expects ruff on PATH, your shell profile should always expose the binary, or a Docker image should ship the tool for all users.

pip, pipx, and collisions

uv tool install will not overwrite an executable that another installer (e.g. pipx) placed in the same directory unless you pass --force. Migrate by uninstalling the old tool first, then uv tool install.

Success is not “installed with pip somewhere.” Success is ruff --version in a fresh shell after uv tool update-shell.

Next steps: uv run for scripts · guide · start a room

Is this different from uv pip install?

Yes. uv pip targets a project or explicit environment. uv tool install is the supported path for standalone CLIs with isolated tool environments.

Does install break my project venv?

No. Tool environments live in uv’s tools storage, separate from uv sync / project .venv.

After install, does uvx still fetch latest?

Once installed, uvx ruff uses the installed version by default. Request uvx ruff@latest or uvx --isolated ruff to bypass it.

Windows PATH?

On Windows, executables are copied into the executable directory. Run uv tool update-shell and restart the terminal; if needed, add the path uv prints to your user PATH manually.

Ouvrir