Skip to content

[Feature request] Implement hf repo list command to list models, spaces, and datasets #3613

@hanouticelina

Description

@hanouticelina

Add a new CLI command hf repo list that allows users to list repositories (models, spaces, or datasets) hosted on the Hub with filtering capabilities. This command will basically be a wrap the existing Python API methods list_models(), list_spaces(), and list_datasets().

Proposed API

# List models (default)
hf repo list

# list datasets or spaces
hf repo list --repo-type dataset
hf repo list --repo-type space

# Limit results (default value set to 10)
hf repo list --limit 15

# Filter by task/tag
hf repo list --filter text-classification
hf repo list --filter conversational

# Search by name
hf repo list --search bert

# Filter by author/organization
hf repo list --author google
hf repo list --search embeddingemma --author google

# Sort results
hf repo list --sort likes
hf repo list --sort trending_score
hf repo list --sort downloads:asc   # ascending

Example Output

 > hf repo list --author google --limit 2

[
  {
    "id": "google/gemma-3-4b-it",
    "downloads": 1037748,
    "likes": 1023,
    "trendingScore": 25,
    "createdAt": "2025-02-20T21:20:07Z",
    "private": false,
    "pipeline_tag": "image-text-to-text",
    "library_name": "transformers"
  },
  {
    "id": "google/embeddinggemma-300m",
    "downloads": 953530,
    "likes": 1320,
    "trendingScore": 18,
    "createdAt": "2025-07-17T19:53:55Z",
    "private": false,
    "pipeline_tag": "sentence-similarity",
    "library_name": "sentence-transformers"
  }
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions