uvx

  • uvx 与 uv 的关系类似 pipx 与 pip 的关系

uvx command invokes a tool without installing it:

➜ uvx ruff
Installed 1 package in 5ms
Ruff: An extremely fast Python linter and code formatter.

Usage: ruff [OPTIONS] <COMMAND>
... ...

uvx pycowsay hello from uv:

Installed 1 package in 8ms

  -------------
< hello from uv >
  -------------
   \   ^__^
    \  (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||

执行 http 命令:

$ uvx --from httpie http https://www.baidu.com
HTTP/1.1 200 OK
Accept-Ranges: bytes
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 227
Content-Type: text/html
Date: Tue, 11 Mar 2025 11:45:37 GMT
P3p: CP=" OTI DSP COR IVA OUR IND COM ", CP=" OTI DSP COR IVA OUR IND COM "
Pragma: no-cache
Server: BWS/1.1
Set-Cookie: BD_NOT_HTTPS=1; path=/; Max-Age=300
Set-Cookie: BIDUPSID=AA25793A0DA2579A9625A048FB5D4DB9; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: PSTM=1741693537; expires=Thu, 31-Dec-37 23:55:55 GMT; max-age=2147483647; path=/; domain=.baidu.com
Set-Cookie: BAIDUID=AA25793A0DA2579AD302CFCB61871C94:FG=1; max-age=31536000; expires=Wed, 11-Mar-26 11:45:37 GMT; domain=.baidu.com; path=/; version=1; comment=bd
Traceid: 1741693537041124890616202303862579725118
X-Ua-Compatible: IE=Edge,chrome=1
X-Xss-Protection: 1;mode=block

<html>
<head>
    <script>
        location.replace(location.href.replace("https://","http://"));
    </script>
</head>
<body>
    <noscript><meta http-equiv="refresh" content="0;url=http://www.baidu.com/"></noscript>
</body>
</html>