[CLI] Migrate collections, discussions, extensions, endpoints and webhooks to `out singleton#4057
[CLI] Migrate collections, discussions, extensions, endpoints and webhooks to `out singleton#4057hanouticelina wants to merge 7 commits intomainfrom
collections, discussions, extensions, endpoints and webhooks to `out singleton#4057Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
collections , discussions, extensions, endpoints and webhooks to `out singletoncollections, discussions, extensions, endpoints and webhooks to `out singleton
| comments: Annotated[ | ||
| bool, | ||
| typer.Option( | ||
| "--comments", | ||
| help="Show all comments.", | ||
| ), | ||
| ] = False, | ||
| diff: Annotated[ | ||
| bool, | ||
| typer.Option( | ||
| "--diff", | ||
| help="Show the diff (for pull requests).", | ||
| ), | ||
| ] = False, | ||
| no_color: Annotated[ | ||
| bool, | ||
| typer.Option( | ||
| "--no-color", | ||
| help="Disable colored output.", | ||
| ), | ||
| ] = False, |
There was a problem hiding this comment.
breaking change here: the rich text view defined in _print_discussion_info is replaced by out.dict(details), consistent with all other info commands (models info, datasets info etc). The --comments, --diff, and --no-color flags are removed. Comments and diff are always included in the JSON output. I think it's fine no? a user can just call hf discussions diff to view diffs separately
Co-authored-by: célina <hanouticelina@users.noreply.github.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5566b74. Configure here.
5566b74 to
f6bf21c
Compare
a588ff0 to
f6bf21c
Compare

Part of #3979 (Phase 2)
This PR migrates list and info commands in
collections,discussions,extensions,endpointsandwebhooksto use the out singleton.This PR introduces some notable breaking changes,in addition to those that affects all migrated commands, e.g.
-q/--quietreplaced by--format quiet:hf endpoints ls: (same issue as forhf auth whoami)name,model,status,task,framework,instance,vendor,region), it was fullendpoint.rawwith nested objects when passing--format json.hf discussions info:--comments,--diff,--no-colorflags removedNote
Medium Risk
Changes CLI output formatting and flags across multiple commands (notably replacing
--quiet/-qwith--format quietand alteringhf discussions infooutput/flags), which can break scripts relying on previous text output or options.Overview
Migrates
collections,discussions,extensions,endpoints, andwebhookscommands to use theoutsingleton (--format [agent|auto|human|json|quiet]) instead of ad-hocprint/print_list_output+--quiet/-q.Updates output behavior to be mode-aware (human tables vs agent TSV/JSON), adds per-invocation reset of output state (
HFCliApp.__call__/hfcallback), and adjusts some commands’ structured output (e.g.,hf discussions infonow emits JSON viaout.dictand drops--comments/--diff/--no-color;hf endpoints ls/hf webhooks lspreserve nested fields injson/agentbut flatten for human display). Docs and tests are updated to match the new flags and output semantics, including safeguards thatquietmode doesn’t leak between CLI invocations.Reviewed by Cursor Bugbot for commit a588ff0. Bugbot is set up for automated code reviews on this repo. Configure here.