sincecutoff.com
← all changes

hf CLI adapts selected command output for coding agents

Introduced 2026-04-02 · score 0.97

HOW TO USE IT

When an agent needs parseable output from a migrated `hf` command, rely on auto-detection or pass `--format agent`, `json`, or `quiet`. Use `agent` for untruncated TSV, `json` for structured output, or `quiet` for IDs only.

hf models ls --limit 5 --format agent
hf models ls --search bert --limit 2 --json
hf models ls --limit 5 --format quiet

WHY THIS HELPS

Inspect Hub models, datasets, Spaces, papers, or authentication details from a coding-agent workflow that needs parseable CLI output.

BEFORE THIS CHANGE

The release note says output was designed for humans, with ANSI colors, padded tables, and truncated cells, making it harder for agents to parse.

REQUIREMENTS AND LIMITATIONS

  • Version: v1.9.0
  • --format <value>: Select output format. Documented values: `auto` (default), `human`, `agent`, `json`, `quiet`. `auto` selects agent output when invoked by an AI agent; `agent` produces untruncated TSV, `json` structured JSON, and `quiet` IDs only. The docs do not say these values are mutually exclusive; they describe one selected format.
  • --json: Alias for `--format json`.
  • -q, --quiet: Alias for `--format quiet`; prints IDs one per line.
  • --limit INTEGER: Limit the number of results returned.
  • --search TEXT: Filter model list by search query.
  • Prerequisite: Install the `huggingface_hub` package or the standalone `hf` CLI installer to use the CLI.
  • Automatic detection and migrated output behavior are described for the listed commands; more commands are to be migrated later.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card