[v1.9.0] Agent-Aware CLI, Spaces Volumes, and more
Hugging Face Spaces now support mounting volumes, giving your Space direct filesystem access to models, datasets, and storage buckets. This replaces the deprecated persistent storage feature.
from huggingface_hub import HfApi, Volume
api = HfApi()
api.set_space_volumes(
repo_id="username/my-space",
volumes=[
Volume(type="model", source="username/my-model", mount_path="/models", read_only=True),
Volume(type="bucket", source="username/my-bucket", mount_path="/data"),
],
)
Volumes can also be set at creation time via create_repo(space_volumes=...) and duplicate_repo(space_volumes=...), and from the CLI with the --volume / -v flag:
# Create a Space with volumes mounted
hf repos create my-space --type space --space-sdk gradio \
-v hf://gpt2:/models -v hf://buckets/org/b:/data
# Duplicate a Space with volumes
hf repos duplicate org/my-space my-space --type space \
-v hf://gpt2:/models -v hf://buckets/org/b:/data
hf CLI Now Auto-Detects AI Agents and Adapts Its OutputAI coding agents (Claude Code, Cursor, Codex, Copilot, Gemini, ...) increasingly use the hf CLI to interact with the Hub. Until now, the output was designed for humans - ANSI colors, padded tables, emoji booleans, truncated cells - making it hard for agents to parse reliably.
Starting with v1.9, the CLI automatically detects when it's running inside an agent and adapts its output: no ANSI, no truncation, tab-separated tables, compact JSON, full timestamps. No configuration needed - it just works. This is only a first step toward making the hf CLI the primary entry point to the Hugging Face Hub for AI agents!
Agent mode is auto-detected but you can also force a mode explicitly with --format:
hf models ls --limit 5 # auto-detect
hf models ls --limit 5 --format agent # force agent-friendly output
hf models ls --limit 5 --format json # structured JSON
hf models ls --limit 5 --format quiet # IDs only, great for piping
Here's what an agent sees compared to a human:
hf auth whoami
# Human
ā Logged in
user: Wauplin
orgs: huggingface, awesome-org
# Agent
user=Wauplin orgs=huggingface,awesome-org
# JSON
{"user": "Wauplin", "orgs": ["huggingface", "awesome-org"]}
hf models ls --author google --limit 3
# Human
ID DOWNLOADS TRENDING_SCORE
-------------------------- --------- --------------
google/embeddinggemma-300m 1213145 17
google/gemma-3-4b-it 1512637 16
google/gemma-3-27b-it 988618 12
# Agent (TSV, no truncation, no ANSI)
id downloads trending_score
google/embeddinggemma-300m 1213145 17
google/gemma-3-4b-it 1512637 16
google/gemma-3-27b-it 988618 12
hf models info google/gemma-3-27b-it
# Human ā pretty-printed JSON (indent=2)
{
"id": "google/gemma-3-27b-it",
"author": "google",
...
}
# Agent ā compact JSON (~40% fewer tokens)
{"id": "google/gemma-3-27b-it", "author": "google", "card_data": ...}
Commands migrated so far: hf models ls|info, hf datasets ls|info|parquet|sql, hf spaces ls|info, hf papers ls|search|info, hf auth whoami. More commands will be migrated soon
out output singleton with agent/human mode rendering by @hanouticelina in #4005models, datasets, spaces, papers to out singleton by @hanouticelina in #4026FormatWithAutoOpt with callback to auto-set output mode by @hanouticelina in #4028out output singleton by @hanouticelina in #4020The hf skills add command now supports installing skills directly from the Hugging Face skills marketplace (https://github.com/huggingface/skills) - pre-built tools that give AI agents new capabilities.
# Install a marketplace skill
hf skills add gradio
# Install with Claude Code integration
hf skills add huggingface-gradio --claude
# Upgrade all installed skills
hf skills upgrade
hf CLI skill description for better agent triggering by @hanouticelina in #3973summary field to hf papers search CLI output by @Wauplin in #4006HF_HUB_DISABLE_SYMLINKS env variable to force no-symlink cache by @Wauplin in #4032bool/int cross-type confusion in @strict dataclass validation by @Wauplin in #3992CLAUDE.md symlink pointing to AGENTS.md by @hanouticelina in #4013match/case statements where appropriate by @hanouticelina in #4012ty type-checking errors after latest release by @hanouticelina in #3978Fetched April 7, 2026