← 返回命令列表

Linux command

uvx 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run Python tool

uvx [ruff] [check] [.]

Run specific version

uvx [package]@[version] [args]

Run with extras

uvx --with [extra] [package]

Run from git

uvx [git+https://github.com/repo/tool]

说明

uvx is a shorthand for uv tool run that executes Python command-line tools in temporary, isolated environments without permanently installing them. It is similar to pipx run but leverages uv's Rust-based resolver for dramatically faster execution. Each invocation creates an ephemeral virtual environment, installs the requested tool and its dependencies, runs the command, and then discards the environment. This ensures tools don't conflict with each other or with project dependencies. Specific versions can be pinned using the @version syntax. uvx is part of the uv Python package manager ecosystem and is useful for running one-off tools like linters, formatters, and code generators without cluttering the system with permanent installations.

参数

--with _EXTRA_
Include extra.
--from _SOURCE_
Install source.
--python _VER_
Python version.

FAQ

What is the uvx command used for?

uvx is a shorthand for uv tool run that executes Python command-line tools in temporary, isolated environments without permanently installing them. It is similar to pipx run but leverages uv's Rust-based resolver for dramatically faster execution. Each invocation creates an ephemeral virtual environment, installs the requested tool and its dependencies, runs the command, and then discards the environment. This ensures tools don't conflict with each other or with project dependencies. Specific versions can be pinned using the @version syntax. uvx is part of the uv Python package manager ecosystem and is useful for running one-off tools like linters, formatters, and code generators without cluttering the system with permanent installations.

How do I run a basic uvx example?

Run `uvx [ruff] [check] [.]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --with _EXTRA_ do in uvx?

Include extra.