in src/huggingface_hub/commands/repo.py [0:0]
def register_subcommand(parser: _SubParsersAction):
repo_parser = parser.add_parser("repo", help="{create} Commands to interact with your huggingface.co repos.")
repo_subparsers = repo_parser.add_subparsers(help="huggingface.co repos related commands")
repo_create_parser = repo_subparsers.add_parser("create", help="Create a new repo on huggingface.co")
repo_create_parser.add_argument(
"repo_id",
type=str,
help="The ID of the repo to create to (e.g. `username/repo-name`). The username is optional and will be set to your username if not provided.",
)
repo_create_parser.add_argument(
"--repo-type",
type=str,
help='Optional: set to "dataset" or "space" if creating a dataset or space, default is model.',
)
repo_create_parser.add_argument(
"--space_sdk",
type=str,
help='Optional: Hugging Face Spaces SDK type. Required when --type is set to "space".',
choices=SPACES_SDK_TYPES,
)
repo_create_parser.add_argument(
"--private",
action="store_true",
help="Whether to create a private repository. Defaults to public unless the organization's default is private.",
)
repo_create_parser.add_argument(
"--token",
type=str,
help="Hugging Face token. Will default to the locally saved token if not provided.",
)
repo_create_parser.add_argument(
"--exist-ok",
action="store_true",
help="Do not raise an error if repo already exists.",
)
repo_create_parser.add_argument(
"--resource-group-id",
type=str,
help="Resource group in which to create the repo. Resource groups is only available for Enterprise Hub organizations.",
)
repo_create_parser.add_argument(
"--type",
type=str,
help="[Deprecated]: use --repo-type instead.",
)
repo_create_parser.add_argument(
"-y",
"--yes",
action="store_true",
help="[Deprecated] no effect.",
)
repo_create_parser.add_argument(
"--organization", type=str, help="[Deprecated] Pass the organization namespace directly in the repo_id."
)
repo_create_parser.set_defaults(func=lambda args: RepoCreateCommand(args))