UV Tool is fun and useful!
I didn’t technically learn all of this today, but I’ve slowly been learning new things about UV almost daily. Here are
some of the awesome things uv tool
can do:
- With
uv tool run
, you can run commands to test things without the need to install them. Example,uv tool run pycowsay "hi"
. This will run thepycowsay
command with the argumenthi
. I was curious if the python package was cached and if so, how it was cached. So I asked, and @charliermarsh said the package is cached and updated frequently. - Is
uv tool run pycowsay "hi"
too long to type? UV has you covered with theuvx
alias, you can useuvx pycowsay "hi"
instead. - Do you have a tool you use all the time and want it installed in its own isolated environment? You can use
uv tool install
to install it. Example,uv tool install ruff
. Curious where it was installed to? You can useuv tool dir
to find out. - Want to upgrade a tool or all tools? You can use
uv tool upgrade ruff
to upgrade theruff
tool oruv tool upgrade --all
to upgrade all tools.
Want more details? Check out UV’s documentation.