Files
cheatsheets/uv/CHEATSHEET.md

66 lines
902 B
Markdown

# uv
## Meta
```yaml
name: uv
repo: https://github.com/astral-sh/uv
description: An extremely fast Python package and project manager, written in Rust.
```
## Install
```shell
curl -LsSf https://astral.sh/uv/install.sh | sh
```
## Update
```shell
uv self update
```
## Usage
### Python
```shell
uv python list
```
### Script
```shell
$ echo 'import requests; print(requests.get("https://example.com"))' > example.py
$ uv add --script example.py requests
Updated `example.py`
```
```shell
$ uv run example.py
Reading inline script metadata from: example.py
Installed 5 packages in 12ms
<Response [200]>
```
### Tool
```shell
$ uvx pycowsay 'hello world!'
Resolved 1 package in 167ms
Installed 1 package in 9ms
+ pycowsay==0.0.0.2
"""
------------
< hello world! >
------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
```