Designing the hf CLI as an agent-optimized way to work with the Hub
Hugging Face Blog 1 month ago
Hugging Face redesigned its hf command-line interface to work efficiently with coding agents like Claude Code and Codex, which now drive a significant portion of Hub traffic. Testing showed that agents using the hf CLI consumed 1.3 to 1.8 times fewer tokens than those using curl or the Python SDK directly on complex multi-step tasks, with the CLI achieving 93-94% success rates versus 84-92% without it. The optimized CLI auto-detects agent usage, outputs dense TSV format instead of human-readable tables, and provides chainable next-step hints to reduce the number of commands agents need to execute.