Hub documentation

Agents and the hf CLI

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Agents and the hf CLI

Coding agents like Claude Code, OpenAI Codex, or Open Code are excellent at using the CLI to interact with the Hub through the hf command-line interface. Search for models, datasets, Spaces, and papers. Download models, upload files, manage repositories, and run compute jobs.

This is a quick guide on agents that use the CLI. For more detailed information, see the CLI Reference itself.

Skills

Hugging Face Skills are available for the CLI to help your agents interact with the Hub. Skills give agents relevant instructions for how to use the CLI. See the Skills Guide for available skills and usage. That said, most agents can get by using the CLI directly without Skills. Worst case scenario, they will rely on documentation and trial and error to get commands right. Skills will make your agents more efficient and productive.

Installation

Make sure the hf CLI is installed on your system.

Standalone Installer (Recommended)

macOS / Linux
Windows
curl -LsSf https://hf.co/cli/install.sh | bash

Alternative Methods

# Using pip
pip install -U huggingface_hub

# Using Homebrew (macOS)
brew install huggingface-cli

# Using uvx (no install needed)
uvx hf --help

Verify Installation

hf --help

Hugging Face Skills for the CLI

Hugging Face Skills are available for the CLI to help you interact with the Hub. Skills give agents relevant instructions for how to use the CLI. See the Skills Guide for available skills and usage.

# start claude 
claude

# install the skills marketplace plugin
/plugin marketplace add huggingface/skills

# install the hugging face cli skill
/plugin install hugging-face-cli@huggingface/skills

With Skills installed, your agent can use the CLI to interact with the Hub.

For example, you could use Claude Code to search for datasets:

"What datasets are available for sentiment analysis?"

Or, you could use OpenAI Codex to create pull requests:

"Open a PR with evaluation results from the results.csv file to my/my-model repo on the Hub."

Resources

Update on GitHub