Skip to content

/flags/uv/uvx-from

uvx --from PKG CMD: run a tool whose command name differs from the package

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · uv 0.12.19 (bea138450 2026-09-24 aarch64-pc-windows-msvc)updated
tool
uv
command
uvx (uv tool run)
flag
--from PKG[SPEC], --with PKG
default
the package with the same name as the command

uvx ruff check downloads the package ruff into a cached, isolated environment and runs its ruff command, because uvx assumes the command and the package have the same name. When they differ, or when you need a version, extras or a Git source, name the package with --from: uvx --from httpie http example.org, uvx --from 'mypy==1.13.0' dmypy. uvx is short for uv tool run, and nothing is installed into your project or global Python.

Same name, version pin and --from

bash
echo "--- uvx ruff@0.8.0"
uvx -q ruff@0.8.0 --version
echo "--- uvx --from ruff==0.8.0 ruff"
uvx -q --from ruff==0.8.0 ruff --version
echo "--- a command from the mypy package"
uvx -q --from mypy==1.13.0 dmypy --version

Output

--- uvx ruff@0.8.0
ruff 0.8.0
--- uvx --from ruff==0.8.0 ruff
ruff 0.8.0
--- a command from the mypy package
dmypy 1.13.0

dmypy, the mypy daemon client, is a command shipped inside the mypy package; --from mypy==... tells uvx which package provides it. All three runs use cached environments, so repeating them is fast and works offline once the packages are cached.

Forms of --from

CommandMeaning
uvx ruffPackage ruff, command ruff, latest cached or newest version
uvx ruff@0.8.0Shorthand for an exact version when the names match
uvx ruff@latestAlways check for the newest release
uvx --from 'ruff>=0.8,<0.9' ruffAny version specifier
uvx --from 'mypy[reports]' mypyPackage with extras
uvx --from git+https://github.com/org/tool toolDirectly from a Git repository
uvx --from ./path/to/tool toolFrom a local project
uvx --with plugin toolAdd more packages to the tool environment

uvx versus uv tool install versus uv run

  • uvx (uv tool run) runs once in a cached environment; nothing lands on PATH.
  • uv tool install ruff installs the command permanently on PATH, like pipx.
  • uv run runs inside the project environment. Use it for tools that need to import your code, such as pytest or mypy with project dependencies; add one-off packages with uv run --with.

Pitfalls

  • When the command is not provided by the package, uvx says so and lists the commands the package does provide; the fix is the right --from package.
  • Options for uvx go before the command; options after it belong to the tool (uvx ruff check --fix).
  • uvx environments do not see project dependencies. A type checker run with uvx mypy cannot resolve imports of packages that only your project installs; use uv run mypy for that.
  • A bare uvx tool reuses a cached version; add @latest (or --refresh) when you need the newest release.

FAQ

Is uvx the same as uv tool run?

Yes. uvx is an alias of uv tool run with identical options. Both run the tool in a cached, isolated environment that is separate from any project.

How do I run a specific version with uvx?

Use the @ shorthand when the command and package share a name (uvx ruff@0.8.0 check), or --from with any specifier (uvx --from 'ruff==0.8.0' ruff check). uvx ruff@latest forces a check for the newest release.

How do I add a plugin to a tool run with uvx?

Use --with: uvx --with mkdocs-material mkdocs build installs the plugin into the same temporary environment as the tool.

Sources