Skip to content

gh

gh documentation

Gh

Gh(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R]

Classes:

Name Description
Auth
Issue
Label
Pr
Release
Repo
Run
Workflow
Api

Methods:

Name Description
__call__

Work seamlessly with GitHub from the command line.

flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
auth Auth[_R]
issue Issue[_R]
label Label[_R]
pr Pr[_R]
release Release[_R]
repo Repo[_R]
run Run[_R]
workflow Workflow[_R]
api Api[_R]
argv Gh[Argv]

auth instance-attribute

auth: Auth[_R]

issue instance-attribute

issue: Issue[_R]

label instance-attribute

label: Label[_R]

pr instance-attribute

pr: Pr[_R]

release instance-attribute

release: Release[_R]

repo instance-attribute

repo: Repo[_R]

run instance-attribute

run: Run[_R]

workflow instance-attribute

workflow: Workflow[_R]

api instance-attribute

api: Api[_R]

argv property

argv: Gh[Argv]

Auth

Auth(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
Login
Status

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
login Login[_R2]
status Status[_R2]
argv Auth[Argv]

login instance-attribute

login: Login[_R2]

status instance-attribute

status: Status[_R2]

argv property

argv: Auth[Argv]

Login

Login(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Authenticate with a GitHub host.

Attributes:

Name Type Description
argv Login[Argv]
argv property
argv: Login[Argv]
__call__
__call__(*, clipboard: ValuedFlag = ..., expiring: ValuedFlag = ..., git_protocol: Value = ..., hostname: Value = ..., insecure_storage: ValuedFlag = ..., scopes: Value = ..., skip_ssh_key: ValuedFlag = ..., web: ValuedFlag = ..., with_token: ValuedFlag = ..., **flags: Any) -> _R3

Authenticate with a GitHub host.

Parameters:

Name Type Description Default
clipboard ValuedFlag

Copy one-time OAuth device code to clipboard. Value optional: True for the bare flag, or pass one.

...
expiring ValuedFlag

Prefer expiring credentials that gh refreshes automatically, if the host supports them. Value optional: True for the bare flag, or pass one. Added in 2.103.0.

...
git_protocol Value

The protocol to use for git operations on this host: {ssh|https}.

...
hostname Value

The hostname of the GitHub instance to authenticate with.

...
insecure_storage ValuedFlag

Save authentication credentials in plain text instead of credential store. Value optional: True for the bare flag, or pass one.

...
scopes Value

Additional authentication scopes to request.

...
skip_ssh_key ValuedFlag

Skip generate/upload SSH key prompt. Value optional: True for the bare flag, or pass one.

...
web ValuedFlag

Open a browser to authenticate. Value optional: True for the bare flag, or pass one.

...
with_token ValuedFlag

Read token from standard input. Value optional: True for the bare flag, or pass one.

...

Status

Status(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Display active account and authentication state on each known GitHub

Attributes:

Name Type Description
argv Status[Argv]
argv property
argv: Status[Argv]
__call__
__call__(*, active: ValuedFlag = ..., hostname: Value = ..., jq: Value = ..., json: Value = ..., no_refresh: ValuedFlag = ..., show_token: ValuedFlag = ..., template: Value = ..., **flags: Any) -> _R3

Display active account and authentication state on each known GitHub host.

Parameters:

Name Type Description Default
active ValuedFlag

Display the active account only. Value optional: True for the bare flag, or pass one.

...
hostname Value

Check only a specific hostname's auth status.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
no_refresh ValuedFlag

Do not automatically refresh expired tokens. Value optional: True for the bare flag, or pass one. Added in 2.103.0.

...
show_token ValuedFlag

Display the auth token. Value optional: True for the bare flag, or pass one.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Issue

Issue(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
Create
List
View

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
create Create[_R2]
list List[_R2]
view View[_R2]
argv Issue[Argv]

create instance-attribute

create: Create[_R2]

list instance-attribute

list: List[_R2]

view instance-attribute

view: View[_R2]

argv property

argv: Issue[Argv]

Create

Create(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Create an issue on GitHub.

Attributes:

Name Type Description
argv Create[Argv]
argv property
argv: Create[Argv]
__call__
__call__(*, assignee: Value = ..., attach: Value = ..., blocked_by: Value = ..., blocking: Value = ..., body: Value = ..., body_file: Value = ..., editor: ValuedFlag = ..., label: Value = ..., milestone: Value = ..., parent: Value = ..., project: Value = ..., recover: Value = ..., repo: Value = ..., template: Value = ..., title: Value = ..., type: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

Create an issue on GitHub.

Parameters:

Name Type Description Default
assignee Value

Assign people by their login.

...
attach Value

Attach an image or video file, in '#' format. Added in 2.99.0.

...
blocked_by Value

Mark the new issue as blocked by these issue numbers or URLs. Added in 2.94.0.

...
blocking Value

Mark the new issue as blocking these issue numbers or URLs. Added in 2.94.0.

...
body Value

Supply a body.

...
body_file Value

Read body text from file (use "-" to read from standard input).

...
editor ValuedFlag

Skip prompts and open the text editor to write the title and body in. Value optional: True for the bare flag, or pass one.

...
label Value

Add labels by name.

...
milestone Value

Add the issue to a milestone by name.

...
parent Value

Add the new issue as a sub-issue of the specified parent number or URL. Added in 2.94.0.

...
project Value

Add the issue to projects by title.

...
recover Value

Recover input from a failed run of create.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Template name to use as starting body text.

...
title Value

Supply a title.

...
type Value

Set the issue type by name. Added in 2.94.0.

...
web ValuedFlag

Open the browser to create an issue. Value optional: True for the bare flag, or pass one.

...

List

List(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

List issues in a GitHub repository. By default, this only lists open

Attributes:

Name Type Description
argv List[Argv]
argv property
argv: List[Argv]
__call__
__call__(*, app: Value = ..., assignee: Value = ..., author: Value = ..., jq: Value = ..., json: Value = ..., label: Value = ..., limit: Value = ..., mention: Value = ..., milestone: Value = ..., repo: Value = ..., search: Value = ..., state: Value = ..., template: Value = ..., type: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

List issues in a GitHub repository. By default, this only lists open issues.

Parameters:

Name Type Description Default
app Value

Filter by GitHub App author.

...
assignee Value

Filter by assignee.

...
author Value

Filter by author (use --app to filter by a GitHub App).

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
label Value

Filter by label.

...
limit Value

Maximum number of issues to fetch. Defaults to 30.

...
mention Value

Filter by mention.

...
milestone Value

Filter by milestone number or title.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
search Value

Search issues with query.

...
state Value

Filter by state: {open|closed|all}. Defaults to open.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
type Value

Filter by issue type name. Added in 2.94.0.

...
web ValuedFlag

List issues in the web browser. Value optional: True for the bare flag, or pass one.

...

View

View(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Display the title, body, and other information about an issue.

Attributes:

Name Type Description
argv View[Argv]
argv property
argv: View[Argv]
__call__
__call__(*args: str | PathLike[str], comments: ValuedFlag = ..., jq: Value = ..., json: Value = ..., repo: Value = ..., template: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

Display the title, body, and other information about an issue.

Parameters:

Name Type Description Default
comments ValuedFlag

View issue comments. Value optional: True for the bare flag, or pass one.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
web ValuedFlag

Open an issue in the browser. Value optional: True for the bare flag, or pass one.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Label

Label(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
Create
List

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
create Create[_R2]
list List[_R2]
argv Label[Argv]

create instance-attribute

create: Create[_R2]

list instance-attribute

list: List[_R2]

argv property

argv: Label[Argv]

Create

Create(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Create a new label on GitHub, or update an existing one with

Attributes:

Name Type Description
argv Create[Argv]
argv property
argv: Create[Argv]
__call__
__call__(name: str | PathLike[str], /, *args: str | PathLike[str], color: Value = ..., description: Value = ..., force: ValuedFlag = ..., repo: Value = ..., **flags: Any) -> _R3

Create a new label on GitHub, or update an existing one with --force.

Parameters:

Name Type Description Default
color Value

Color of the label.

...
description Value

Description of the label.

...
force ValuedFlag

Update the label color and description if label already exists. Value optional: True for the bare flag, or pass one.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...

List

List(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Display labels in a GitHub repository.

Attributes:

Name Type Description
argv List[Argv]
argv property
argv: List[Argv]
__call__
__call__(*, jq: Value = ..., json: Value = ..., limit: Value = ..., order: Value = ..., repo: Value = ..., search: Value = ..., sort: Value = ..., template: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

Display labels in a GitHub repository.

Parameters:

Name Type Description Default
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
limit Value

Maximum number of labels to fetch. Defaults to 30.

...
order Value

Order of labels returned: {asc|desc}. Defaults to asc.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
search Value

Search label names and descriptions.

...
sort Value

Sort fetched labels: {created|name}. Defaults to created.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
web ValuedFlag

List labels in the web browser. Value optional: True for the bare flag, or pass one.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Pr

Pr(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
Checkout
Create
List
Merge
View

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
checkout Checkout[_R2]
create Create[_R2]
list List[_R2]
merge Merge[_R2]
view View[_R2]
argv Pr[Argv]

checkout instance-attribute

checkout: Checkout[_R2]

create instance-attribute

create: Create[_R2]

list instance-attribute

list: List[_R2]

merge instance-attribute

merge: Merge[_R2]

view instance-attribute

view: View[_R2]

argv property

argv: Pr[Argv]

Checkout

Checkout(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Check out a pull request in git

Attributes:

Name Type Description
argv Checkout[Argv]
argv property
argv: Checkout[Argv]
__call__
__call__(*args: str | PathLike[str], branch: Value = ..., detach: ValuedFlag = ..., force: ValuedFlag = ..., recurse_submodules: ValuedFlag = ..., repo: Value = ..., worktree: Value = ..., **flags: Any) -> _R3

Check out a pull request in git

Parameters:

Name Type Description Default
branch Value

Local branch name to use. Defaults to [the name of the head branch].

...
detach ValuedFlag

Checkout PR with a detached HEAD. Value optional: True for the bare flag, or pass one.

...
force ValuedFlag

Reset the existing local branch to the latest state of the pull request. Value optional: True for the bare flag, or pass one.

...
recurse_submodules ValuedFlag

Update all submodules after checkout. Value optional: True for the bare flag, or pass one.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
worktree Value

Check out the pull request into a worktree at the given path. Added in 2.98.0.

...

Create

Create(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Create a pull request on GitHub.

Attributes:

Name Type Description
argv Create[Argv]
argv property
argv: Create[Argv]
__call__
__call__(*, assignee: Value = ..., attach: Value = ..., base: Value = ..., body: Value = ..., body_file: Value = ..., draft: ValuedFlag = ..., dry_run: ValuedFlag = ..., editor: ValuedFlag = ..., fill: ValuedFlag = ..., fill_first: ValuedFlag = ..., fill_verbose: ValuedFlag = ..., head: Value = ..., label: Value = ..., milestone: Value = ..., no_maintainer_edit: ValuedFlag = ..., project: Value = ..., recover: Value = ..., repo: Value = ..., reviewer: Value = ..., template: Value = ..., title: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

Create a pull request on GitHub.

Parameters:

Name Type Description Default
assignee Value

Assign people by their login.

...
attach Value

Attach an image or video file, in '#' format. Added in 2.99.0.

...
base Value

The branch into which you want your code merged.

...
body Value

Body for the pull request.

...
body_file Value

Read body text from file (use "-" to read from standard input).

...
draft ValuedFlag

Mark pull request as a draft. Value optional: True for the bare flag, or pass one.

...
dry_run ValuedFlag

Print details instead of creating the PR. Value optional: True for the bare flag, or pass one.

...
editor ValuedFlag

Skip prompts and open the text editor to write the title and body in. Value optional: True for the bare flag, or pass one.

...
fill ValuedFlag

Use commit info for title and body. Value optional: True for the bare flag, or pass one.

...
fill_first ValuedFlag

Use first commit info for title and body. Value optional: True for the bare flag, or pass one.

...
fill_verbose ValuedFlag

Use commits msg+body for description. Value optional: True for the bare flag, or pass one.

...
head Value

The branch that contains commits for your pull request. Defaults to [current branch].

...
label Value

Add labels by name.

...
milestone Value

Add the pull request to a milestone by name.

...
no_maintainer_edit ValuedFlag

Disable maintainer's ability to modify pull request. Value optional: True for the bare flag, or pass one.

...
project Value

Add the pull request to projects by title.

...
recover Value

Recover input from a failed run of create.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
reviewer Value

Request reviews from people or teams by their handle.

...
template Value

Template file to use as starting body text.

...
title Value

Title for the pull request.

...
web ValuedFlag

Open the web browser to create a pull request. Value optional: True for the bare flag, or pass one.

...

List

List(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

List pull requests in a GitHub repository. By default, this only

Attributes:

Name Type Description
argv List[Argv]
argv property
argv: List[Argv]
__call__
__call__(*, app: Value = ..., assignee: Value = ..., author: Value = ..., base: Value = ..., draft: ValuedFlag = ..., head: Value = ..., jq: Value = ..., json: Value = ..., label: Value = ..., limit: Value = ..., repo: Value = ..., search: Value = ..., state: Value = ..., template: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

List pull requests in a GitHub repository. By default, this only lists open PRs.

Parameters:

Name Type Description Default
app Value

Filter by GitHub App author.

...
assignee Value

Filter by assignee.

...
author Value

Filter by author (use --app to filter by a GitHub App).

...
base Value

Filter by base branch.

...
draft ValuedFlag

Filter by draft state. Value optional: True for the bare flag, or pass one.

...
head Value

Filter by head branch (":" syntax not supported).

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
label Value

Filter by label.

...
limit Value

Maximum number of items to fetch. Defaults to 30.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
search Value

Search pull requests with query.

...
state Value

Filter by state: {open|closed|merged|all}. Defaults to open.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
web ValuedFlag

List pull requests in the web browser. Value optional: True for the bare flag, or pass one.

...

Merge

Merge(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Merge a pull request on GitHub.

Attributes:

Name Type Description
argv Merge[Argv]
argv property
argv: Merge[Argv]
__call__
__call__(*args: str | PathLike[str], admin: ValuedFlag = ..., author_email: Value = ..., auto: ValuedFlag = ..., body: Value = ..., body_file: Value = ..., delete_branch: ValuedFlag = ..., disable_auto: ValuedFlag = ..., match_head_commit: Value = ..., merge: ValuedFlag = ..., rebase: ValuedFlag = ..., repo: Value = ..., squash: ValuedFlag = ..., subject: Value = ..., **flags: Any) -> _R3

Merge a pull request on GitHub.

Parameters:

Name Type Description Default
admin ValuedFlag

Use administrator privileges to merge a pull request that does not meet requirements. Value optional: True for the bare flag, or pass one.

...
author_email Value

Email text for merge commit author.

...
auto ValuedFlag

Automatically merge only after necessary requirements are met. Value optional: True for the bare flag, or pass one.

...
body Value

Body text for the merge commit.

...
body_file Value

Read body text from file (use "-" to read from standard input).

...
delete_branch ValuedFlag

Delete the local and remote branch after merge. Value optional: True for the bare flag, or pass one.

...
disable_auto ValuedFlag

Disable auto-merge for this pull request. Value optional: True for the bare flag, or pass one.

...
match_head_commit Value

Commit SHA that the pull request head must match to allow merge.

...
merge ValuedFlag

Merge the commits with the base branch. Value optional: True for the bare flag, or pass one.

...
rebase ValuedFlag

Rebase the commits onto the base branch. Value optional: True for the bare flag, or pass one.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
squash ValuedFlag

Squash the commits into one commit and merge it into the base branch. Value optional: True for the bare flag, or pass one.

...
subject Value

Subject text for the merge commit.

...

View

View(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Display the title, body, and other information about a pull request.

Attributes:

Name Type Description
argv View[Argv]
argv property
argv: View[Argv]
__call__
__call__(*args: str | PathLike[str], comments: ValuedFlag = ..., jq: Value = ..., json: Value = ..., repo: Value = ..., template: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

Display the title, body, and other information about a pull request.

Parameters:

Name Type Description Default
comments ValuedFlag

View pull request comments. Value optional: True for the bare flag, or pass one.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
web ValuedFlag

Open a pull request in the browser. Value optional: True for the bare flag, or pass one.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Release

Release(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
Create
List
Upload
View

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
create Create[_R2]
list List[_R2]
upload Upload[_R2]
view View[_R2]
argv Release[Argv]

create instance-attribute

create: Create[_R2]

list instance-attribute

list: List[_R2]

upload instance-attribute

upload: Upload[_R2]

view instance-attribute

view: View[_R2]

argv property

argv: Release[Argv]

Create

Create(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Create a new GitHub Release for a repository.

Attributes:

Name Type Description
argv Create[Argv]
argv property
argv: Create[Argv]
__call__
__call__(*args: str | PathLike[str], discussion_category: Value = ..., draft: ValuedFlag = ..., fail_on_no_commits: ValuedFlag = ..., generate_notes: ValuedFlag = ..., latest: ValuedFlag = ..., notes: Value = ..., notes_file: Value = ..., notes_from_tag: ValuedFlag = ..., notes_start_tag: Value = ..., prerelease: ValuedFlag = ..., repo: Value = ..., target: Value = ..., title: Value = ..., verify_tag: ValuedFlag = ..., **flags: Any) -> _R3

Create a new GitHub Release for a repository.

Parameters:

Name Type Description Default
discussion_category Value

Start a discussion in the specified category.

...
draft ValuedFlag

Save the release as a draft instead of publishing it. Value optional: True for the bare flag, or pass one.

...
fail_on_no_commits ValuedFlag

Fail if there are no commits since the last release (no impact on the first release). Value optional: True for the bare flag, or pass one.

...
generate_notes ValuedFlag

Automatically generate title and notes for the release via GitHub Release Notes API. Value optional: True for the bare flag, or pass one.

...
latest ValuedFlag

Mark this release as "Latest" . Value optional: True for the bare flag, or pass one. Defaults to [automatic based on date and version].

...
notes Value

Release notes.

...
notes_file Value

Read release notes from file (use "-" to read from standard input).

...
notes_from_tag ValuedFlag

Fetch notes from the tag annotation or message of commit associated with tag. Value optional: True for the bare flag, or pass one.

...
notes_start_tag Value

Tag to use as the starting point for generating release notes.

...
prerelease ValuedFlag

Mark the release as a prerelease. Value optional: True for the bare flag, or pass one.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
target Value

Target branch or full commit SHA. Defaults to [main branch].

...
title Value

Release title.

...
verify_tag ValuedFlag

Abort in case the git tag doesn't already exist in the remote repository. Value optional: True for the bare flag, or pass one.

...

List

List(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

List releases in a repository

Attributes:

Name Type Description
argv List[Argv]
argv property
argv: List[Argv]
__call__
__call__(*, exclude_drafts: ValuedFlag = ..., exclude_pre_releases: ValuedFlag = ..., jq: Value = ..., json: Value = ..., limit: Value = ..., order: Value = ..., repo: Value = ..., template: Value = ..., **flags: Any) -> _R3

List releases in a repository

Parameters:

Name Type Description Default
exclude_drafts ValuedFlag

Exclude draft releases. Value optional: True for the bare flag, or pass one.

...
exclude_pre_releases ValuedFlag

Exclude pre-releases. Value optional: True for the bare flag, or pass one.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
limit Value

Maximum number of items to fetch. Defaults to 30.

...
order Value

Order of releases returned: {asc|desc}. Defaults to desc.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...

Upload

Upload(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Upload asset files to a GitHub Release.

Attributes:

Name Type Description
argv Upload[Argv]
argv property
argv: Upload[Argv]
__call__
__call__(tag: str | PathLike[str], /, *args: str | PathLike[str], clobber: ValuedFlag = ..., repo: Value = ..., **flags: Any) -> _R3

Upload asset files to a GitHub Release.

Parameters:

Name Type Description Default
clobber ValuedFlag

Delete and re-upload existing assets of the same name. Value optional: True for the bare flag, or pass one.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...

View

View(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

View information about a GitHub Release.

Attributes:

Name Type Description
argv View[Argv]
argv property
argv: View[Argv]
__call__
__call__(*args: str | PathLike[str], jq: Value = ..., json: Value = ..., repo: Value = ..., template: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

View information about a GitHub Release.

Parameters:

Name Type Description Default
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
web ValuedFlag

Open the release in the browser. Value optional: True for the bare flag, or pass one.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Repo

Repo(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
Clone
View

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
clone Clone[_R2]
view View[_R2]
argv Repo[Argv]

clone instance-attribute

clone: Clone[_R2]

view instance-attribute

view: View[_R2]

argv property

argv: Repo[Argv]

Clone

Clone(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Clone a GitHub repository locally. Pass additional git clone flags

Attributes:

Name Type Description
argv Clone[Argv]
argv property
argv: Clone[Argv]
__call__
__call__(repository: str | PathLike[str], /, *args: str | PathLike[str], no_upstream: ValuedFlag = ..., upstream_remote_name: Value = ..., **flags: Any) -> _R3

Clone a GitHub repository locally. Pass additional git clone flags by listing

Parameters:

Name Type Description Default
no_upstream ValuedFlag

Do not add an upstream remote when cloning a fork. Value optional: True for the bare flag, or pass one.

...
upstream_remote_name Value

Upstream remote name when cloning a fork. Defaults to upstream.

...

View

View(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Display the description and the README of a GitHub repository.

Attributes:

Name Type Description
argv View[Argv]
argv property
argv: View[Argv]
__call__
__call__(*args: str | PathLike[str], branch: Value = ..., jq: Value = ..., json: Value = ..., template: Value = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

Display the description and the README of a GitHub repository.

Parameters:

Name Type Description Default
branch Value

View a specific branch of the repository.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
web ValuedFlag

Open a repository in the browser. Value optional: True for the bare flag, or pass one.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Run

Run(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
List
View
Watch

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
list List[_R2]
view View[_R2]
watch Watch[_R2]
argv Run[Argv]

list instance-attribute

list: List[_R2]

view instance-attribute

view: View[_R2]

watch instance-attribute

watch: Watch[_R2]

argv property

argv: Run[Argv]

List

List(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

List recent workflow runs.

Attributes:

Name Type Description
argv List[Argv]
argv property
argv: List[Argv]
__call__
__call__(*, all: ValuedFlag = ..., branch: Value = ..., commit: Value = ..., created: Value = ..., event: Value = ..., jq: Value = ..., json: Value = ..., limit: Value = ..., repo: Value = ..., status: Value = ..., template: Value = ..., user: Value = ..., workflow: Value = ..., **flags: Any) -> _R3

List recent workflow runs.

Parameters:

Name Type Description Default
all ValuedFlag

Include disabled workflows. Value optional: True for the bare flag, or pass one.

...
branch Value

Filter runs by branch.

...
commit Value

Filter runs by the SHA of the commit.

...
created Value

Filter runs by the date it was created.

...
event Value

Filter runs by which event triggered the run.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
limit Value

Maximum number of runs to fetch. Defaults to 20.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
status Value

Filter runs by status: {queued|completed|in_progress|requested|waiting|pending|action_required|cancelled|failure|neutral|skipped|stale|startup_failure|success|timed_out}.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
user Value

Filter runs by user who triggered the run.

...
workflow Value

Filter runs by workflow.

...

View

View(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

View a summary of a workflow run.

Attributes:

Name Type Description
argv View[Argv]
argv property
argv: View[Argv]
__call__
__call__(*args: str | PathLike[str], attempt: Value = ..., exit_status: ValuedFlag = ..., job: Value = ..., jq: Value = ..., json: Value = ..., log: ValuedFlag = ..., log_failed: ValuedFlag = ..., repo: Value = ..., template: Value = ..., verbose: ValuedFlag = ..., web: ValuedFlag = ..., **flags: Any) -> _R3

View a summary of a workflow run.

Parameters:

Name Type Description Default
attempt Value

The attempt number of the workflow run.

...
exit_status ValuedFlag

Exit with non-zero status if run failed. Value optional: True for the bare flag, or pass one.

...
job Value

View a specific job ID from a run.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
log ValuedFlag

View full log for either a run or specific job. Value optional: True for the bare flag, or pass one.

...
log_failed ValuedFlag

View the log for any failed steps in a run or specific job. Value optional: True for the bare flag, or pass one.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
verbose ValuedFlag

Show job steps. Value optional: True for the bare flag, or pass one.

...
web ValuedFlag

Open run in the browser. Value optional: True for the bare flag, or pass one.

...

Watch

Watch(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Watch a run until it completes, showing its progress.

Attributes:

Name Type Description
argv Watch[Argv]
argv property
argv: Watch[Argv]
__call__
__call__(run_id: str | PathLike[str], /, *args: str | PathLike[str], compact: ValuedFlag = ..., exit_status: ValuedFlag = ..., interval: Value = ..., repo: Value = ..., **flags: Any) -> _R3

Watch a run until it completes, showing its progress.

Parameters:

Name Type Description Default
compact ValuedFlag

Show only relevant/failed steps. Value optional: True for the bare flag, or pass one.

...
exit_status ValuedFlag

Exit with non-zero status if run fails. Value optional: True for the bare flag, or pass one.

...
interval Value

Refresh interval in seconds. Defaults to 3.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Workflow

Workflow(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Classes:

Name Description
List
Run

Methods:

Name Description
__call__
flags

Bind tool-level global options before the subcommand.

Attributes:

Name Type Description
list List[_R2]
run Run[_R2]
argv Workflow[Argv]

list instance-attribute

list: List[_R2]

run instance-attribute

run: Run[_R2]

argv property

argv: Workflow[Argv]

List

List(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

List workflow files, hiding disabled workflows by default.

Attributes:

Name Type Description
argv List[Argv]
argv property
argv: List[Argv]
__call__
__call__(*, all: ValuedFlag = ..., jq: Value = ..., json: Value = ..., limit: Value = ..., repo: Value = ..., template: Value = ..., **flags: Any) -> _R3

List workflow files, hiding disabled workflows by default.

Parameters:

Name Type Description Default
all ValuedFlag

Include disabled workflows. Value optional: True for the bare flag, or pass one.

...
jq Value

Filter JSON output using a jq expression.

...
json Value

Output JSON with the specified fields.

...
limit Value

Maximum number of workflows to fetch. Defaults to 50.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...

Run

Run(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R3]

Methods:

Name Description
__call__

Create a workflow_dispatch event for a given workflow.

Attributes:

Name Type Description
argv Run[Argv]
argv property
argv: Run[Argv]
__call__
__call__(*args: str | PathLike[str], field: Value = ..., json: ValuedFlag = ..., raw_field: Value = ..., ref: Value = ..., repo: Value = ..., **flags: Any) -> _R3

Create a workflow_dispatch event for a given workflow.

Parameters:

Name Type Description Default
field Value

Add a string parameter in key=value format, respecting @ syntax (see "gh help api").

...
json ValuedFlag

Read workflow inputs as JSON via STDIN. Value optional: True for the bare flag, or pass one.

...
raw_field Value

Add a string parameter in key=value format.

...
ref Value

Branch or tag name which contains the version of the workflow file you'd like to run.

...
repo Value

Select another repository using the [HOST/]OWNER/REPO format.

...

__call__

__call__(*args: Any, **flags: Any) -> _R2

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.

Api

Api(name: str, *base: str, in_process: bool = False, path: str = '', entry: str = '', single_dash: bool = False, version_argv: tuple[str, ...] = ('--version',), policy: dict[str, Any] | None = None)

Bases: Tool[_R2]

Methods:

Name Description
__call__

Makes an authenticated HTTP request to the GitHub API and prints the

Attributes:

Name Type Description
argv Api[Argv]

argv property

argv: Api[Argv]

__call__

__call__(*args: str | PathLike[str], allow_escape_sequences: ValuedFlag = ..., cache: Value = ..., field: Value = ..., header: Value = ..., hostname: Value = ..., include: ValuedFlag = ..., input: Value = ..., jq: Value = ..., method: Value = ..., paginate: ValuedFlag = ..., preview: Value = ..., raw_field: Value = ..., silent: ValuedFlag = ..., slurp: ValuedFlag = ..., template: Value = ..., verbose: ValuedFlag = ..., **flags: Any) -> _R2

Makes an authenticated HTTP request to the GitHub API and prints the response.

Parameters:

Name Type Description Default
allow_escape_sequences ValuedFlag

Allow printing terminal escape sequences. Value optional: True for the bare flag, or pass one. Added in 2.97.0.

...
cache Value

Cache the response, e.g. "3600s", "60m", "1h".

...
field Value

Add a typed parameter in key=value format (use "@" or "@-" to read value from file or stdin).

...
header Value

Add a HTTP request header in key:value format.

...
hostname Value

The GitHub hostname for the request. Defaults to github.com.

...
include ValuedFlag

Include HTTP response status line and headers in the output. Value optional: True for the bare flag, or pass one.

...
input Value

The file to use as body for the HTTP request (use "-" to read from standard input).

...
jq Value

Query to select values from the response using jq syntax.

...
method Value

The HTTP method for the request. Defaults to GET.

...
paginate ValuedFlag

Make additional HTTP requests to fetch all pages of results. Value optional: True for the bare flag, or pass one.

...
preview Value

Opt into GitHub API previews (names should omit '-preview').

...
raw_field Value

Add a string parameter in key=value format.

...
silent ValuedFlag

Do not print the response body. Value optional: True for the bare flag, or pass one.

...
slurp ValuedFlag

Use with "--paginate" to return an array of all pages of either JSON arrays or objects. Value optional: True for the bare flag, or pass one.

...
template Value

Format JSON output using a Go template; see "gh help formatting".

...
verbose ValuedFlag

Include full HTTP request and response in the output. Value optional: True for the bare flag, or pass one.

...

__call__

__call__(*args: str | PathLike[str], **flags: Any) -> _R

Work seamlessly with GitHub from the command line.

flags

flags(**flags: Any) -> Self

Bind tool-level global options before the subcommand.

tools.docker.flags(host=...) puts a tool's own options ahead of the verb, where they belong.