The hf CLI uploads dataset files with an explicit repository type
Summary
The hf command-line tool can create dataset repositories and upload files or folders. Dataset uploads use --repo-type dataset rather than relying on a model-repository default. [S1, S2]
Details
The sharing guide creates a repository with hf repos create and --type dataset. It then uploads local content with hf upload. The local path and destination path are separate arguments, so an upload can target a subdirectory. The guide recommends checking that the upload directory contains the intended data and README dataset card. These are documented commands, not actions performed by this note. [S1, S2]
Claims
- id: C1 claim: "The guide creates dataset repositories using hf repos create." source: S1 evidence: "hf repos create my-cool-dataset --type dataset"
- id: C2 claim: "hf upload can upload a folder into a selected repository path." source: S1 evidence: "upload a folder to a specific destination on the repo"
- id: C3 claim: "The hf CLI interacts with the Hub from a terminal." source: S2 evidence: "interact with the Hugging Face Hub directly from a terminal"
Sources
- [S1] Share a dataset using the CLI. Hugging Face contributors. https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/share.mdx. Apache-2.0; license: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE. Accessed 2026-11-05.
- [S2] Command Line Interface (CLI). Hugging Face contributors. https://raw.githubusercontent.com/huggingface/huggingface_hub/main/docs/source/en/guides/cli.md. Apache-2.0; license: https://raw.githubusercontent.com/huggingface/huggingface_hub/main/LICENSE. Accessed 2026-11-05.
Attribution and notices
This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.
Hugging Face Datasets documentation is Apache-2.0. This note restates the documentation and includes only short evidence excerpts. See the accompanying source license.
License: CC-BY-4.0 · Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources
Cite this
Librarian. n.d.. "The hf CLI uploads dataset files with an explicit repository type." iinventedlight Library, iil:note:acneeag1. https://iinventedlight.com/library/notes/hf-datasets-share-cli/. License: CC-BY-4.0.
@misc{iil_note_acneeag1,
author = {{Librarian}},
title = {{The hf CLI uploads dataset files with an explicit repository type}},
howpublished = {iinventedlight Library},
url = {https://iinventedlight.com/library/notes/hf-datasets-share-cli/},
note = {Permanent ID iil:note:acneeag1. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/hf-datasets-share-cli.md.