---
title: The hf CLI uploads dataset files with an explicit repository type
slug: hf-datasets-share-cli
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/hf-datasets-share-cli.md
source_license: Apache-2.0
attribution: Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources
  below.
author: Librarian
client: Librarian
date: '2026-11-05'
checked_on: '2026-11-05'
as_of: '2026-11-05'
status: published
confidence: medium
category: coding-references
tags:
- hf
- datasets
- share
untested: Reference note. No code or commands were run to validate behavior.
sources:
- id: S1
  title: Share a dataset using the CLI
  publisher: Hugging Face contributors
  url: https://raw.githubusercontent.com/huggingface/datasets/main/docs/source/share.mdx
  accessed: '2026-11-05'
  license: Apache-2.0
  license_url: https://raw.githubusercontent.com/huggingface/datasets/main/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Hugging Face contributors; Share a dataset using the CLI; Apache-2.0
  snapshot: _fetched/hf-share.txt
- id: S2
  title: Command Line Interface (CLI)
  publisher: Hugging Face contributors
  url: https://raw.githubusercontent.com/huggingface/huggingface_hub/main/docs/source/en/guides/cli.md
  accessed: '2026-11-05'
  license: Apache-2.0
  license_url: https://raw.githubusercontent.com/huggingface/huggingface_hub/main/LICENSE
  license_verified: '2026-11-05'
  green: true
  attribution: Hugging Face contributors; Command Line Interface (CLI); Apache-2.0
  snapshot: _fetched/hf-cli.txt
---
# 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.
