Skip to content

Commit 4a7c755

Browse files
[Docs] Update CLI installation guide (#3536)
* update cli installation guide * Update docs/source/fr/installation.md Co-authored-by: Julien Chaumond <[email protected]> --------- Co-authored-by: Julien Chaumond <[email protected]>
1 parent ffd9764 commit 4a7c755

File tree

4 files changed

+25
-45
lines changed

4 files changed

+25
-45
lines changed

docs/source/de/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ Einige Abhängigkeiten von `huggingface_hub` sind [optional](https://setuptools.
4444

4545
Sie können optionale Abhängigkeiten über `pip` installieren:
4646
```bash
47-
# Abhängigkeiten sowohl für torch-spezifische als auch für CLI-spezifische Funktionen installieren.
48-
pip install 'huggingface_hub[cli,torch]'
47+
# Abhängigkeiten sowohl für torch-spezifische als auch für MCP-spezifische Funktionen installieren.
48+
pip install 'huggingface_hub[mcp,torch]'
4949
```
5050

5151
Hier ist die Liste der optionalen Abhängigkeiten in huggingface_hub:
5252

53-
- `cli`: bietet eine komfortablere CLI-Schnittstelle für huggingface_hub.
53+
- `mcp`: MCP-spezifische Funktionen für huggingface_hub.
5454
- `fastai`, `torch`: Abhängigkeiten, um framework-spezifische Funktionen auszuführen.
5555
- `dev`: Abhängigkeiten, um zur Bibliothek beizutragen. Enthält `testing` (um Tests auszuführen), `typing` (um den Type Checker auszuführen) und `quality` (um Linters auszuführen).
5656

docs/source/en/guides/cli.md

Lines changed: 17 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,9 @@ The `huggingface_hub` Python package comes with a built-in CLI called `hf`. This
1212
1313
## Getting started
1414

15-
First of all, let's install the CLI:
15+
### Standalone installer (Recommended)
1616

17-
```
18-
>>> pip install -U "huggingface_hub"
19-
```
20-
21-
> [!TIP]
22-
> The CLI ships with the core `huggingface_hub` package.
23-
24-
Alternatively, you can install the `hf` CLI with a single command:
17+
You can install the `hf` CLI with a single command:
2518

2619
On macOS and Linux:
2720

@@ -35,23 +28,9 @@ On Windows:
3528
>>> powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"
3629
```
3730

38-
Alternatively, you can install the `hf` CLI with a single command:
39-
40-
On macOS and Linux:
31+
Once installed, you can check that the CLI is correctly set up:
4132

4233
```bash
43-
>>> curl -LsSf https://hf.co/cli/install.sh | sh
44-
```
45-
46-
On Windows:
47-
48-
```powershell
49-
>>> powershell -ExecutionPolicy ByPass -c "irm https://hf.co/cli/install.ps1 | iex"
50-
```
51-
52-
Once installed, you can check that the CLI is correctly setup:
53-
54-
```
5534
>>> hf --help
5635
Usage: hf [OPTIONS] COMMAND [ARGS]...
5736

@@ -67,6 +46,7 @@ Commands:
6746
auth Manage authentication (login, logout, etc.).
6847
cache Manage local cache directory.
6948
download Download files from the Hub.
49+
endpoints Manage Hugging Face Inference Endpoints.
7050
env Print information about the environment.
7151
jobs Run and manage Jobs on the Hub.
7252
repo Manage repos on the Hub.
@@ -81,32 +61,32 @@ If the CLI is correctly installed, you should see a list of all the options avai
8161
> [!TIP]
8262
> The `--help` option is very convenient for getting more details about a command. You can use it anytime to list all available options and their details. For example, `hf upload --help` provides more information on how to upload files using the CLI.
8363
84-
### Other installation methods
64+
### Using uv
8565

86-
#### Using uv
66+
The easiest way to use the `hf` CLI is with [`uvx`](https://docs.astral.sh/uv/concepts/tools/). It always runs the latest version in an isolated environment - no installation needed!
8767

88-
You can install and run the `hf` CLI with [uv](https://docs.astral.sh/uv/).
68+
Make sure `uv` is installed first. See the [uv installation guide](https://docs.astral.sh/uv/getting-started/installation/) for instructions.
8969

90-
Make sure uv is installed (adds `uv` and `uvx` to your PATH):
70+
Then use the CLI directly:
9171

9272
```bash
93-
>>> curl -LsSf https://astral.sh/uv/install.sh | sh
73+
>>> uvx hf auth login
74+
>>> uvx hf download
75+
>>> uvx hf ...
9476
```
9577

96-
Then install the CLI globally and use it anywhere:
78+
> [!TIP]
79+
> `uvx hf` uses the [`hf` PyPI package](https://pypi.org/project/hf/).
9780
98-
```bash
99-
>>> uv tool install "huggingface_hub"
100-
>>> hf auth whoami
101-
```
81+
### Install with pip
10282

103-
Alternatively, run the CLI ephemerally with `uvx` (no global install):
83+
The CLI is also shipped with the core `huggingface_hub` package:
10484

10585
```bash
106-
>>> uvx --from huggingface_hub hf auth whoami
86+
>>> pip install -U "huggingface_hub"
10787
```
10888

109-
#### Using Homebrew
89+
### Using Homebrew
11090

11191
You can also install the CLI using [Homebrew](https://brew.sh/):
11292

docs/source/en/installation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Some dependencies of `huggingface_hub` are [optional](https://setuptools.pypa.io
4646

4747
You can install optional dependencies via `pip`:
4848
```bash
49-
# Install dependencies for both torch-specific and CLI-specific features.
50-
pip install 'huggingface_hub[cli,torch]'
49+
# Install dependencies for both torch-specific and MCP-specific features.
50+
pip install 'huggingface_hub[mcp,torch]'
5151
```
5252

5353
Here is the list of optional dependencies in `huggingface_hub`:

docs/source/fr/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ Toutefois, certaines fonctionnalités de `huggingface_hub` ne seront pas disponi
4848

4949
Vous pouvez installer des dépendances optionnelles via `pip`:
5050
```bash
51-
#Installation des dépendances spécifiques à Pytorch et au CLI.
52-
pip install 'huggingface_hub[cli,torch]'
51+
# Installation des dépendances spécifiques à Pytorch et à MCP.
52+
pip install 'huggingface_hub[mcp,torch]'
5353
```
5454

5555
Voici une liste des dépendances optionnelles dans `huggingface_hub`:
56-
- `cli` fournit une interface d'invite de commande plus pratique pour `huggingface_hub`.
56+
- `mcp`: fonctionnalités spécifiques à MCP pour `huggingface_hub`.
5757
- `fastai`, `torch` sont des dépendances pour utiliser des fonctionnalités spécifiques à un framework.
5858
- `dev` permet de contribuer à la librairie. Cette dépendance inclut `testing` (pour lancer des tests), `typing` (pour lancer le vérifieur de type) et `quality` (pour lancer des linters).
5959

0 commit comments

Comments
 (0)