Run any command with additional enviroment variable
If I want to run uv
with an environment variable UV_HTTP_TIMEOUT
of value 1000
. The following can be used in bash:
UV_HTTP_TIMEOUT=1000 uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --verbose
I think on powershell the syntax is
$env:FOO = 'BAR'; ./myscript
So the above would be
$env:UV_HTTP_TIMEOUT=1000; uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --verbose