{
  "slug": "hf-cli-global-output-formatting-flags-apply-to-every-command-f880c917a004",
  "title": "hf CLI global output formatting flags apply to every command",
  "tools": [
    "hf"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-04-30T11:48:16.000Z",
  "announced_at": "2026-04-30T11:48:16.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a script needs structured or ID-only output from an `hf` command, add `--json` or `-q`/`--quiet`; `--format auto` selects `human` in an interactive terminal and `agent` when invoked by an AI agent. The documented formatting guide says most commands accept these global flags.",
    "examples": [
      "hf models ls --search bert --limit 2 --json | jq '.[].id'",
      "hf collections ls --owner nvidia -q",
      "hf <command> --format auto"
    ],
    "gotchas": [
      "Version: v1.13.0",
      "--format <value>: Select output format: `auto` (default), `human`, `agent`, `json`, or `quiet`.",
      "--json: Equivalent to `--format json`; print structured JSON for scripting.",
      "-q, --quiet: Equivalent to `--format quiet`; print IDs one per line.",
      "--search <text>: Filter the models listing by search text; used in the documented example.",
      "--limit <number>: Limit the models listing; used in the documented example.",
      "--owner <owner>: Select the owner for the collections listing; used in the documented example.",
      "Prerequisite: Install the `hf` CLI; the guide says it is shipped with `huggingface_hub` and documents `pip install -U \"huggingface_hub\"`.",
      "Prerequisite: The guide notes that authentication is needed for some Hub interactions, such as accessing private repositories or uploading; it does not state an authentication prerequisite for the listed read commands.",
      "Docs conflict: The current guide describes formatting flags as accepted by “most” `hf` commands, while the v1.13.0 release note says every command accepts them. The guide also says jobs commands may consume formatting flags wherever they appear; use `--` when passing those flags through to a script."
    ]
  },
  "why_it_matters": "When scripting Hub CLI commands from a coding workflow, request JSON or quiet output without checking whether each command declares those options.",
  "before": "Check each command for individually declared `--format`, `--json`, or `-q` / `--quiet` options before using them.",
  "sources": [
    "https://github.com/huggingface/huggingface_hub/releases/tag/v1.13.0",
    "https://huggingface.co/docs/huggingface_hub/main/guides/cli#output-formatting",
    "https://huggingface.co/docs/huggingface_hub/main/guides/cli"
  ],
  "rank": 0.97048,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave2b-20261017",
    "verdict_id": "wave2b-20261017:wave2b-20261017-bb06c8ee38e25564-6:gate",
    "evidence_hash": "8f11d99c2b64c04df88abf2e4573c6956cf9e268985d5a90173daf68c79513ac"
  },
  "review": {
    "draft_hash": "69a5f9e1281274d9fa566c3c953bc1850c125fed27a0a0bb6243cab01f1df614",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave2b-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.97 >= 0.9; 2 needed) and Jev gave 0.78 (>= 0.6 needed)."
  }
}
