Skip to content

[Docs] Fix hf discussions info options that do not exist - #4886

Open
rishabhsai wants to merge 1 commit into
huggingface:mainfrom
rishabhsai:docs-cli-discussions-info-options
Open

[Docs] Fix hf discussions info options that do not exist#4886
rishabhsai wants to merge 1 commit into
huggingface:mainfrom
rishabhsai:docs-cli-discussions-info-options

Conversation

@rishabhsai

@rishabhsai rishabhsai commented Sep 12, 2026

Copy link
Copy Markdown

Summary

  • docs/source/en/guides/cli.md documents --comments and --diff on hf discussions info, but neither exists. The command only takes --type/--repo-type and --token (src/huggingface_hub/cli/discussions.py:154), so copying either line straight out of the guide exits with code 2. docs/source/en/guides/community.md carried the same --comments example in its bash block.
  • The --comments line was also wrong about the default. discussion_info prints the whole get_discussion_details object, so the conversation events are already in the output and there is nothing to opt into. The PR diff has its own subcommand, hf discussions diff, already documented a few sections down, so the guide now points there instead.
  • --no-color is not a flag anywhere in the CLI either. Colour suppression reads the NO_COLOR environment variable (src/huggingface_hub/utils/_terminal.py:102, see https://no-color.org/), so that sentence now says NO_COLOR=1.

What the guide tells you to run today:

$ hf discussions info bigscience/bloom 2 --comments
Usage: hf discussions info [OPTIONS] REPO_ID NUM
Try 'hf discussions info --help' for help.

Error: No such option '--comments'.

Available options for 'hf discussions info':
  --type, --repo-type [model|dataset|space] The type of repository (model, dataset, or space).  [default: model]
  --token TEXT                   A User Access Token generated from https://huggingface.co/settings/tokens.
  -h, --help                     Show this message and exit.

$ hf discussions info username/my-model 5 --diff
Error: No such option '--diff'.

$ hf discussions ls bigscience/bloom --no-color
Error: No such option '--no-color'.

And the events are there without asking for them:

$ HF_TOKEN= hf discussions info bigscience/bloom 2 --format json
{"title": "Updates the BLOOM model card to sync with the updated https://github.com/bigscience-workshop/model_card", "status": "merged", "num": 2, "repo_id": "bigscience/bloom", "repo_type": "model", "author": "meg", "is_pull_request": true, "created_at": "2022-05-25T21:26:41+00:00", "endpoint": "https://huggingface.co", "events": [{"id": "628e9f119202a9acd20d4866", "type": "comment", "created_at": "2022-05-25T21:26:41+00:00", "author": "meg", ...}, {"id": "628e9f12bec8ba3575dbd338", "type": "commit", ...}, {"id": "628ea114312d910ef6f98a37", "type": "status-change", ...}], ...}

#3899 fixed a neighbouring batch of stale examples in the same two guides, so this is the same lane rather than a duplicate of it.

Checked with a script that parses every hf ... line in docs/source/en/**.md and validates it against the live click command tree: the discussions hits are gone, the 5 remaining hits are pre-existing false positives (shell pipes and flags inside quoted --container-args values). grep -n 'no-color\|--comments\|--diff' over both guides is empty, and make style (no regenerated file changed) then make quality are clean.


Note

Low Risk
Documentation-only changes; no runtime or API behavior is modified.

Overview
Updates the CLI and community guides so hf discussions info examples match the real command surface.

hf discussions info no longer documents nonexistent --comments or --diff flags. The text now states that metadata and conversation events are included by default, and directs readers to hf discussions diff for PR diffs. The community guide example drops --comments from the sample command.

Color suppression is documented as NO_COLOR=1 instead of a --no-color flag that the CLI does not expose.

Reviewed by Cursor Bugbot for commit fad5350. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant