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 thepycowsaycommand 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 theuvxalias, 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 installto install it. Example,uv tool install ruff. Curious where it was installed to? You can useuv tool dirto find out. - Want to upgrade a tool or all tools? You can use
uv tool upgrade ruffto upgrade therufftool oruv tool upgrade --allto upgrade all tools.
Want more details? Check out UV’s documentation.