Designing the hf CLI as an agent-optimized way to work with the Hub
Jun 4, 2026
Summary
This post details the re-architecture of the `hf` CLI to support both human and AI agent usage. Key changes include agent-specific output formats (TSV for agents, rich tables for humans), next-command hints for chaining operations, non-blocking commands that are safe to retry, and discoverable commands with examples. Benchmarking shows a significant reduction in token usage for agents when using the `hf` CLI compared to manual SDK/curl usage. The post also introduces the concept of the `hf-cli` skill for agents.