gitea.cli.repository.list
list
List repositories command.
Gitea serves an organization's repositories and a user's at two different
endpoints - /orgs/{owner}/repos and /users/{owner}/repos - and an owner's
name does not say which of the two it is. --owner-type says it, defaulting to
an organization, rather than the command guessing from the name or spending a
request asking the instance what kind of account it found.
The two kinds are an enum rather than a pair of strings compared where they are used, so the value the option accepts and the value the command branches on cannot come to differ, and neither kind is the one that "everything else" falls back to: a value that is neither is refused rather than read as an organization.
Classes
gitea.cli.repository.list.OwnerType
Bases: StrEnum
What kind of account --owner names, and so which endpoint answers for it.
Functions:
gitea.cli.repository.list.list_command
list_command(
ctx: Context,
owner: Annotated[
str,
Option(
"--owner",
help="Owner whose repositories are listed.",
),
],
owner_type: Annotated[
OwnerType,
Option(
"--owner-type",
help="Whether --owner names an organization or a user account. Gitea serves the two at different endpoints.",
),
] = OwnerType.ORGANIZATION,
page: Annotated[
int | None,
Option(
"--page", help="The page number for pagination."
),
] = None,
limit: Annotated[
int | None,
Option(
"--limit",
help="The number of repositories per page.",
),
] = None,
account_name: Annotated[
str | None,
Option(
"--account-name",
help="Name of the account to use for authentication.",
),
] = None,
token: Annotated[
str | None,
Option(
"--token",
help="Token for authentication. If not provided, the token from the specified account will be used.",
),
] = None,
base_url: Annotated[
str | None,
Option(
"--base-url",
help="Base URL of the Gitea platform. If not provided, the base URL from the specified account will be used.",
),
] = None,
) -> None
List the repositories of an owner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ctx
|
Context
|
The Typer context. |
required |
owner
|
Annotated[str, Option('--owner', help='Owner whose repositories are listed.')]
|
The owner whose repositories are listed. |
required |
owner_type
|
Annotated[OwnerType, Option('--owner-type', help='Whether --owner names an organization or a user account. Gitea serves the two at different endpoints.')]
|
Whether the owner is an organization or a user account. |
ORGANIZATION
|
page
|
Annotated[int | None, Option('--page', help='The page number for pagination.')]
|
The page number for pagination. |
None
|
limit
|
Annotated[int | None, Option('--limit', help='The number of repositories per page.')]
|
The number of repositories per page. |
None
|
account_name
|
Annotated[str | None, Option('--account-name', help='Name of the account to use for authentication.')]
|
Name of the account to use for authentication. |
None
|
token
|
Annotated[str | None, Option('--token', help='Token for authentication. If not provided, the token from the specified account will be used.')]
|
Token for authentication. |
None
|
base_url
|
Annotated[str | None, Option('--base-url', help='Base URL of the Gitea platform. If not provided, the base URL from the specified account will be used.')]
|
Base URL of the Gitea platform. |
None
|