zuke.tools.gh
@zuke/gh 1.15.0: @zuke/gh — typed GitHub tooling for Zuke builds: the gh (GitHub CLI) task wrapper plus githubWorkflow, a wait trigger that dispatches and awaits an external GitHub Actions workflow.
zuke on PyPI ↗ 77 symbols
Symbols
class GhApiSettings(ToolSettings) Settings for GhTasks.api, mirroring the real gh api flags: --method, --field, --raw-field, --header, --jq, and --silent.
-
method(verb: str) -> SelfThe HTTP method (
--method, e.g."PUT";ghdefaults to GET). -
field(key: str, value: str | float | bool) -> SelfAdd a typed body parameter (
--field key=value). Repeatable. -
raw_field(key: str, value: str) -> SelfAdd a string body parameter (
--raw-field key=value). Repeatable. -
header(name: str, value: str) -> SelfAdd a request header (
--header key:value). Repeatable. -
jq(expression: str) -> SelfFilter the response through a jq expression (
--jq). -
silent() -> SelfDo not print the response body (
--silent).
class GhAppTokenSettings(Settings) Settings for GhAppTokenApi.appToken.
-
app_id(id: str | float) -> SelfThe GitHub App's id (the
App IDon its settings page). -
private_key(pem: str) -> SelfThe app's private key, as the PEM's contents — GitHub issues PKCS#1 (
BEGIN RSA PRIVATE KEY); PKCS#8 is accepted too. -
owner(login: str) -> SelfThe user or organisation the app is installed on.
-
repositories(*names: str) -> SelfScope the token to these repositories (names only, without the owner). Omit to cover every repository the installation can reach — prefer naming them, so a leaked token is narrow.
-
permission(name: str, level: Literal['read', 'write', 'admin']) -> SelfRequest one permission, e.g.
.permission("contents", "write"). Repeatable. Narrowing to what the target needs beats inheriting the app's full set; requesting more than the installation grants is an error from GitHub. The API names multi-word permissions with underscores (pull_requests), so a hyphen is normalised to one. That spelling is the trap here:create-github-app-tokentakes its inputs aspermission-pull-requests, and passing that form straight through is rejected as a permission the installation does not grant — which reads as a misconfigured app rather than a misspelled key. -
base_url(url: str) -> SelfUse a different REST base (GitHub Enterprise Server).
class GhAppTokenSourceSettings(Settings) Settings for GhAppTokenApi.appTokenSource.
-
app(app_id: str, private_key: str) -> SelfThe App's credentials — its numeric id and the PEM contents of its private key, as the build's parameters (
.secret()for the key). Either one unset at call time means "no App": the source yields the fallback. Both are read when the token is first needed, never at construction, so parameters declared on the build resolve first. -
repository(slug: str) -> SelfThe repository to mint for, as
owner/name. Defaults to the repository the run is on,GITHUB_REPOSITORY. Name it to refuse minting anywhere else: a run whoseGITHUB_REPOSITORYis another repository then gets the fallback, with a warning, rather than a token for this one minted into a build running elsewhere. -
permission(name: str, level: Literal['read', 'write', 'admin']) -> SelfNarrow the token to one permission, e.g.
.permission("contents", "write"). Repeatable. Without any, the token holds the installation's whole grant, which is the App's configured permissions — the sane default for an App set up for one job. A hyphenated name is accepted as the mint accepts it. -
fallback(token: str) -> SelfThe token yielded when no App is configured or the mint fails. Defaults to
GITHUB_TOKENfrom the environment — the workflow's own token, so a build that names an App still posts, asgithub-actions[bot], wherever the App is absent. -
base_url(url: str) -> SelfUse a different REST base for the mint (GitHub Enterprise Server).
class GhBodySettings(GhCommandSettings) Base for the commands that take message text: pr create, pr comment, pr edit, issue create, issue comment.
gh spells it --body for the text and --body-file for a file, with - meaning standard input — the same pair on every one of them.
-
body(text: str) -> SelfThe message text (
--body). -
body_file(path: str) -> SelfRead the message from a file (
--body-file);-reads standard input.
class GhCacheDeleteSettings(GhCommandSettings) Settings for gh cache delete.
-
selector(id_or_key: str | float) -> SelfThe cache to delete, by its id or its key.
-
all() -> SelfDelete every cache (
--all), narrowed by ref when one is set. -
ref(name: str) -> SelfRestrict the deletion to one ref (
--ref). -
succeed_on_no_caches() -> SelfExit zero when there was nothing to delete (
--succeed-on-no-caches).
class GhCacheListSettings(GhReadSettings) Settings for gh cache list.
-
key(prefix: str) -> SelfOnly caches whose key starts with this (
--key). -
ref(name: str) -> SelfOnly caches for this ref (
--ref), e.g.refs/heads/master. -
sort(field: Literal['created_at', 'last_accessed_at', 'size_in_bytes']) -> SelfWhat to order by (
--sort); gh's default islast_accessed_at. -
order(direction: Literal['asc', 'desc']) -> SelfThe direction (
--order):ascordesc. -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 30.
class GhCommandSettings(GhSettings) Base for a typed gh subcommand: it contributes the command path (the group, the verb, and any operand) and its own flags, and inherits everything else from "./settings.ts".GhSettings.
class GhContentsSettings(Settings) Settings for creating or updating one file.
owner/repo and the token fall back to the Actions environment, so a job that already has them names only the file.
-
path(value: str) -> SelfThe file's path inside the repository, e.g.
Formula/app.rb(required). Relative,/-separated, with no.or..segment. -
content(text: str) -> SelfThe file's new content, as text (required). Written as UTF-8.
-
message(text: str) -> SelfThe commit message (required).
-
branch(name: str) -> SelfThe branch to write on. Defaults to the repository's default branch.
-
repo(slug: str) -> Selfowner/repo. Defaults toGITHUB_REPOSITORY. -
token(value: str) -> SelfThe token to authenticate with — needs
contents: writeon the repository. Defaults toGITHUB_TOKEN. -
base_url(url: str) -> SelfThe API root, for GitHub Enterprise.
class GhIssueCloseSettings(GhCommandSettings) Settings for gh issue close.
-
selector(value: str | float) -> SelfThe issue — its number or URL (required).
-
comment(text: str) -> SelfLeave a closing comment (
--comment). -
reason(value: Literal['completed', 'not planned', 'duplicate']) -> SelfWhy it is closed (
--reason). -
duplicate_of(number_or_url: str | float) -> SelfWhich issue it duplicates (
--duplicate-of), by number or URL.
class GhIssueCommentSettings(GhBodySettings) Settings for gh issue comment.
-
selector(value: str | float) -> SelfThe issue — its number or URL (required).
-
edit_last() -> SelfEdit your most recent comment instead of adding one (
--edit-last). -
create_if_none() -> SelfWith editLast, post a new comment when there is none (
--create-if-none). -
delete_last() -> SelfDelete your most recent comment (
--delete-last). -
yes() -> SelfSkip the confirmation a delete otherwise prompts for (
--yes).
class GhIssueCreateSettings(GhBodySettings) Settings for gh issue create.
-
title(text: str) -> SelfThe issue's title (
--title). -
assignee(*logins: str) -> SelfAssign someone by login (
--assignee),@mefor yourself; repeatable. -
label(*names: str) -> SelfAdd a label by name (
--label); repeatable. -
project(*titles: str) -> SelfAdd to a project by title (
--project); repeatable. -
milestone(name: str) -> SelfAdd to a milestone by name (
--milestone). -
type_(name: str) -> SelfSet the issue type by name (
--type). -
parent(number_or_url: str | float) -> SelfFile it as a sub-issue of this number or URL (
--parent). -
template_name(name: str) -> SelfThe issue template to start the body from (
--template).
class GhIssueListSettings(GhWebReadSettings) Settings for gh issue list.
-
state(value: Literal['open', 'closed', 'all']) -> SelfFilter by state (
--state):open,closed, orall. -
author(login: str) -> SelfFilter by author (
--author). -
app(name: str) -> SelfFilter by the GitHub App that opened it (
--app). -
assignee(login: str) -> SelfFilter by assignee (
--assignee). -
mention(login: str) -> SelfFilter by who is mentioned (
--mention). -
milestone(name_or_number: str) -> SelfFilter by milestone number or title (
--milestone). -
type_(name: str) -> SelfFilter by issue type (
--type). -
label(*names: str) -> SelfFilter by label (
--label); repeatable. -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 30. -
search(query: str) -> SelfFilter with a search query (
--search).
class GhIssueViewSettings(GhWebReadSettings) Settings for gh issue view.
-
selector(value: str | float) -> SelfThe issue — its number or URL (required).
-
comments() -> SelfInclude the comments (
--comments).
class GhLabelCloneSettings(GhCommandSettings) Settings for gh label clone.
-
source(slug: str) -> SelfThe repository to copy the labels from, as
owner/name(required). -
force() -> SelfOverwrite labels of the same name in the destination (
--force).
class GhLabelCreateSettings(GhCommandSettings) Settings for gh label create.
-
name(value: str) -> SelfThe label's name (required).
-
color(hex: str) -> SelfIts colour (
--color), as a hex triplet; gh accepts it with or without#. -
description(text: str) -> SelfIts description (
--description). -
force() -> SelfUpdate the label when it already exists rather than failing (
--force).
class GhLabelDeleteSettings(GhCommandSettings) Settings for gh label delete.
-
name(value: str) -> SelfThe label to delete (required).
-
yes() -> SelfSkip the confirmation a delete otherwise prompts for (
--yes).
class GhLabelEditSettings(GhCommandSettings) Settings for gh label edit.
-
name(value: str) -> SelfThe label to edit, by its current name (required).
-
new_name(value: str) -> SelfRename it (
--name). -
color(hex: str) -> SelfSet its colour (
--color). -
description(text: str) -> SelfSet its description (
--description).
class GhLabelListSettings(GhWebReadSettings) Settings for gh label list.
-
search(query: str) -> SelfSearch names and descriptions (
--search). -
sort(field: Literal['created', 'name']) -> SelfWhat to order by (
--sort); gh's default iscreated. -
order(direction: Literal['asc', 'desc']) -> SelfThe direction (
--order):ascordesc. -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 30.
class GhPrChecksSettings(GhPrReadSettings) Settings for gh pr checks.
-
watch() -> SelfKeep watching until the checks finish (
--watch). A target that watches blocks until CI is done, so pair it with.killAfter(...)unless the wait is the point. -
fail_fast() -> SelfStop watching at the first failure (
--fail-fast). -
required() -> SelfOnly the checks marked required (
--required). -
interval(seconds: float) -> SelfHow often to refresh while watching (
--interval), in seconds.
class GhPrCloseSettings(GhCommandSettings) Settings for gh pr close.
-
selector(value: str | float) -> SelfThe pull request — number, URL, or branch; defaults to the current branch's.
-
comment(text: str) -> SelfLeave a closing comment (
--comment). -
delete_branch() -> SelfDelete the branch afterwards (
--delete-branch).
class GhPrCommentSettings(GhPrTargetSettings) Settings for gh pr comment.
-
edit_last() -> SelfEdit your most recent comment instead of adding one (
--edit-last). -
create_if_none() -> SelfWith editLast, post a new comment when there is none (
--create-if-none). -
delete_last() -> SelfDelete your most recent comment (
--delete-last). -
yes() -> SelfSkip the confirmation a delete otherwise prompts for (
--yes).
class GhPrCreateSettings(GhBodySettings) Settings for gh pr create.
-
title(text: str) -> SelfThe pull request's title (
--title). -
base(branch: str) -> SelfThe branch to merge into (
--base). -
head(branch: str) -> SelfThe branch holding the commits (
--head). -
assignee(*logins: str) -> SelfAssign someone by login (
--assignee),@mefor yourself; repeatable. -
label(*names: str) -> SelfAdd a label by name (
--label); repeatable. -
reviewer(*handles: str) -> SelfRequest a review from a person or team (
--reviewer); repeatable. -
milestone(name: str) -> SelfAdd to a milestone by name (
--milestone). -
project(*titles: str) -> SelfAdd to a project by title (
--project); repeatable. -
draft() -> SelfOpen it as a draft (
--draft). -
fill() -> SelfTake the title and body from the commits (
--fill). -
fill_first() -> SelfTake them from the first commit only (
--fill-first). -
fill_verbose() -> SelfTake the body from every commit's message (
--fill-verbose). -
dry_run() -> SelfPrint what would be created without creating it (
--dry-run). -
no_maintainer_edit() -> SelfRefuse maintainer edits to the branch (
--no-maintainer-edit). -
template_file(path: str) -> SelfA template file to seed the body from (
--template).
class GhPrEditSettings(GhPrTargetSettings) Settings for gh pr edit.
-
title(text: str) -> SelfSet the title (
--title). -
base(branch: str) -> SelfChange the base branch (
--base). -
add_label(*names: str) -> SelfAdd a label (
--add-label); repeatable. -
remove_label(*names: str) -> SelfRemove a label (
--remove-label); repeatable. -
add_assignee(*logins: str) -> SelfAdd an assignee (
--add-assignee); repeatable. -
remove_assignee(*logins: str) -> SelfRemove an assignee (
--remove-assignee); repeatable. -
add_reviewer(*handles: str) -> SelfRequest a review (
--add-reviewer); repeatable. -
remove_reviewer(*handles: str) -> SelfDrop a review request (
--remove-reviewer); repeatable. -
add_project(*titles: str) -> SelfAdd to a project by title (
--add-project); repeatable. -
remove_project(*titles: str) -> SelfTake it off a project by title (
--remove-project); repeatable. -
milestone(name: str) -> SelfSet the milestone (
--milestone). -
remove_milestone() -> SelfClear the milestone (
--remove-milestone).
class GhPrListSettings(GhWebReadSettings) Settings for gh pr list.
-
state(value: Literal['open', 'closed', 'merged', 'all']) -> SelfFilter by state (
--state):open,closed,merged, orall. -
base(branch: str) -> SelfFilter by base branch (
--base). -
head(branch: str) -> SelfFilter by head branch (
--head). -
author(login: str) -> SelfFilter by author (
--author). -
app(name: str) -> SelfFilter by the GitHub App that opened it (
--app). -
assignee(login: str) -> SelfFilter by assignee (
--assignee). -
label(*names: str) -> SelfFilter by label (
--label); repeatable. -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 30. -
search(query: str) -> SelfFilter with a search query (
--search). -
draft() -> SelfOnly draft pull requests (
--draft).
class GhPrMergeSettings(GhPrTargetSettings) Settings for gh pr merge.
-
merge() -> SelfMerge with a merge commit (
--merge). -
squash() -> SelfSquash the commits into one (
--squash). -
rebase() -> SelfRebase the commits onto the base (
--rebase). -
auto() -> SelfMerge once the requirements are met (
--auto). -
disable_auto() -> SelfTurn auto-merge off again (
--disable-auto). -
admin() -> SelfMerge with administrator privileges (
--admin). -
delete_branch() -> SelfDelete the branch afterwards (
--delete-branch). -
subject(text: str) -> SelfThe merge commit's subject (
--subject). -
author_email(address: str) -> SelfThe merge commit's author email (
--author-email). -
match_head_commit(sha: str) -> SelfRefuse the merge unless the head is still this commit (
--match-head-commit) — the guard against merging a PR that moved between the check and the merge.
class GhPrReadSettings(GhWebReadSettings) Base for the pr commands that read one pull request and can print JSON — view and checks — so the operand has one implementation across them.
-
selector(value: str | float) -> SelfThe pull request — number, URL, or branch; defaults to the current branch's.
class GhPrTargetSettings(GhBodySettings) Base for the pr commands that take a pull request and post text — merge, comment, and edit — so the operand and the --body pair have one implementation across them.
-
selector(value: str | float) -> SelfThe pull request — its number, URL, or branch name. Omit it to act on the PR for the current branch, as gh does.
class GhPrViewSettings(GhPrReadSettings) Settings for gh pr view.
-
comments() -> SelfInclude the comments (
--comments).
class GhReadSettings(GhCommandSettings) Base for the commands that can print JSON: pr list, pr view, pr checks, issue list, issue view, release list, release view.
gh requires an explicit field list for --json, which is why the value-returning tasks pin one rather than leaving it to the caller.
A …ListEntries reader parses the array --json prints, so .jq(...) and .template(...) — which replace that array with whatever they render — belong on the plain …List task instead.
-
json(*fields: str) -> SelfEmit JSON with these fields (
--json), which gh requires by name — there is no "all fields" form. -
jq(expression: str) -> SelfFilter the JSON with a jq expression (
--jq). -
template(text: str) -> SelfFormat the JSON through a Go template (
--template).
class GhReleaseAssetSettings(Settings) Settings for GhReleaseAssetApi.uploadReleaseAsset.
-
file(path: str) -> SelfThe file to upload (required).
-
name(value: str) -> SelfThe asset's name on the release. Defaults to the file's base name.
-
content_type(value: str) -> SelfThe asset's
content-type. Defaults by extension (.tar.gz/.tgz,.zip,.json), then toapplication/octet-stream. -
repo(slug: str) -> SelfThe
owner/repoto upload to. Defaults toGITHUB_REPOSITORY. -
tag(value: str) -> SelfAttach to the release with this tag instead of the latest release.
-
refresh() -> SelfReplace an asset the release already carries when its bytes differ from the file's — compared by the sha256 digest the API reports — instead of keeping it. An asset whose digest matches, or whose digest the API does not report, is still kept: without a comparison to trust, replacement would churn a published release's assets on every run, which is exactly what the default protects. For an asset that must track its source across runs (an extension archive, a docs bundle) on a long-lived release.
-
token(value: str) -> SelfThe token to authenticate with — needs
contents: write. Defaults toGITHUB_TOKENin the environment, so it never has to reach argv. -
base_url(url: str) -> SelfUse a different REST base (GitHub Enterprise Server).
class GhReleaseCreateSettings(GhCommandSettings) Settings for gh release create.
-
tag(name: str) -> SelfThe tag to release (required); gh creates it when it does not exist.
-
files(*paths: str) -> SelfAsset files to attach (positional); repeatable. gh reads a
#labelsuffix on a path as the asset's display label. -
title(text: str) -> SelfThe release title (
--title). -
notes(text: str) -> SelfThe release notes (
--notes). -
notes_file(path: str) -> SelfRead the notes from a file (
--notes-file);-reads standard input. -
generate_notes() -> SelfHave GitHub write the title and notes (
--generate-notes). -
notes_from_tag() -> SelfTake the notes from the tag's annotation (
--notes-from-tag). -
notes_start_tag(name: str) -> SelfGenerate notes starting from this tag (
--notes-start-tag). -
draft() -> SelfSave it as a draft rather than publishing (
--draft). -
prerelease() -> SelfMark it a prerelease (
--prerelease). -
latest() -> SelfMark it the latest release (
--latest). -
target(branch_or_sha: str) -> SelfThe branch or commit to tag (
--target). -
discussion_category(name: str) -> SelfOpen a discussion in this category (
--discussion-category). -
verify_tag() -> SelfAbort unless the tag already exists on the remote (
--verify-tag). -
fail_on_no_commits() -> SelfFail when there are no commits since the last release (
--fail-on-no-commits).
class GhReleaseDeleteSettings(GhCommandSettings) Settings for gh release delete.
-
tag(name: str) -> SelfThe release to delete, by tag (required).
-
cleanup_tag() -> SelfDelete the git tag as well (
--cleanup-tag). -
yes() -> SelfSkip the confirmation prompt (
--yes).
class GhReleaseDownloadSettings(GhCommandSettings) Settings for gh release download.
-
tag(name: str) -> SelfThe release's tag; gh takes the latest release when it is omitted.
-
pattern(*globs: str) -> SelfOnly assets matching this glob (
--pattern); repeatable. -
dir(path: str) -> SelfThe directory to download into (
--dir). -
output(path: str) -> SelfWrite a single asset to this file (
--output);-writes standard output. -
archive(format: Literal['zip', 'tar.gz']) -> SelfDownload the source archive instead of the assets (
--archive). -
clobber() -> SelfOverwrite files that already exist (
--clobber). -
skip_existing() -> SelfLeave files that already exist alone (
--skip-existing).
class GhReleaseEditSettings(GhCommandSettings) Settings for gh release edit.
-
tag(name: str) -> SelfThe release to edit, by its current tag (required).
-
new_tag(name: str) -> SelfMove the release to a different tag (
--tag). -
title(text: str) -> SelfSet the title (
--title). -
notes(text: str) -> SelfSet the notes (
--notes). -
notes_file(path: str) -> SelfRead the notes from a file (
--notes-file);-reads standard input. -
draft() -> SelfMake it a draft (
--draft). -
prerelease() -> SelfMark it a prerelease (
--prerelease). -
latest() -> SelfMark it the latest release (
--latest). -
target(branch_or_sha: str) -> SelfChange the target branch or commit (
--target). -
discussion_category(name: str) -> SelfOpen a discussion in this category when publishing (
--discussion-category). -
verify_tag() -> SelfAbort unless the tag exists on the remote (
--verify-tag).
class GhReleaseEnsureSettings(Settings) Settings for ensuring a release exists.
owner/repo and the token fall back to the Actions environment, so a job that already has them names only the release.
-
tag(value: str) -> SelfThe tag to release (required). It should already exist. GitHub creates a missing tag on the default branch rather than refusing, so a typo here publishes a tag as well as a release — which is why the caller that reconciles a backlog reads its tags from git rather than composing them.
-
name(text: str) -> SelfThe release title (required), e.g.
Zuke Build v1.2.3. -
body(text: str) -> SelfThe release notes (required); pass
""for a release with none. -
latest(value: bool | None=None) -> SelfMove the repository's "Latest release" pointer onto this release. Off unless asked, which is the opposite of GitHub's own default — it treats a new release as latest unless told otherwise. The default is inverted because the first thing this is used for is back-filling releases a pipeline missed, and those are created oldest-first: taking GitHub's default would walk the pointer backwards through the backlog and leave it on whichever release was created last, which is the oldest one. Naming it explicitly costs the one caller that wants it a method call, and costs the ones that do not want it nothing at all.
-
repo(slug: str) -> Selfowner/repo. Defaults toGITHUB_REPOSITORY. -
token(value: str) -> SelfThe token to authenticate with — needs
contents: write. Defaults toGITHUB_TOKEN. -
base_url(url: str) -> SelfThe API root, for GitHub Enterprise.
class GhReleaseLatestSettings(Settings) Settings for marking a release as latest.
owner/repo and the token fall back to the Actions environment, so a job that already has them needs to name only the tag.
-
tag(value: str) -> SelfThe tag whose release the pointer should name (required).
-
repo(slug: str) -> Selfowner/repo. Defaults toGITHUB_REPOSITORY. -
token(value: str) -> SelfThe token to authenticate with — needs
contents: write. Defaults toGITHUB_TOKEN. -
base_url(url: str) -> SelfThe API root, for GitHub Enterprise.
class GhReleaseListSettings(GhReadSettings) Settings for gh release list.
-
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 30. -
order(direction: Literal['asc', 'desc']) -> SelfThe order they come back in (
--order):ascordesc. -
exclude_drafts() -> SelfLeave out drafts (
--exclude-drafts). -
exclude_pre_releases() -> SelfLeave out prereleases (
--exclude-pre-releases).
class GhReleaseUploadSettings(GhCommandSettings) Settings for gh release upload.
-
tag(name: str) -> SelfThe release's tag (required).
-
files(*paths: str) -> SelfAsset files to attach (required); repeatable. gh reads a
#labelsuffix on a path as the asset's display label. -
clobber() -> SelfReplace an asset of the same name (
--clobber).
class GhReleaseViewSettings(GhWebReadSettings) Settings for gh release view.
-
tag(name: str) -> SelfThe release's tag; gh shows the latest release when it is omitted.
class GhRepoArchiveSettings(GhRepoCommandSettings) Settings for gh repo archive and gh repo unarchive.
-
repository(slug: str) -> SelfThe repository; gh acts on the current one otherwise.
-
unarchive() -> SelfRestore an archived repository instead —
gh repo unarchive. -
yes() -> SelfSkip the confirmation gh otherwise prompts for (
--yes).
class GhRepoCloneSettings(GhRepoCommandSettings) Settings for gh repo clone.
-
repository(slug: str) -> SelfThe repository, as
owner/nameor a URL (required). -
directory(path: str) -> SelfThe directory to clone into; gh names it after the repository otherwise.
-
upstream_remote_name(name: str) -> SelfThe remote name for a fork's parent (
--upstream-remote-name). -
no_upstream() -> SelfDo not add the upstream remote when cloning a fork (
--no-upstream). -
git_args(*args: str) -> SelfFlags for the underlying
git clone, which gh takes after a--separator —.gitArgs("--depth=1")for a shallow clone.
class GhRepoCommandSettings(GhCommandSettings) Base for the gh repo commands that neither print JSON nor take --repo. GhRepoListSettings and GhRepoViewSettings do print JSON, so they extend the read bases and call refuseRepoFlag themselves.
class GhRepoCreateSettings(GhRepoCommandSettings) Settings for gh repo create.
-
name(value: str) -> SelfThe repository's name, or
owner/nameto create it elsewhere (required). -
visibility(value: Literal['public', 'private', 'internal']) -> SelfHow visible it is:
--public,--private, or--internal(required). -
description(text: str) -> SelfIts description (
--description). -
homepage(url: str) -> SelfIts homepage (
--homepage). -
team(name: str) -> SelfGrant an organization team access (
--team). -
template(slug: str) -> SelfBase it on a template repository (
--template). -
gitignore(name: str) -> SelfStart from a gitignore template (
--gitignore). -
license(name: str) -> SelfAdd an open-source license (
--license). -
source(path: str) -> SelfCreate it from a local repository (
--source). -
remote(name: str) -> SelfThe remote name for the new repository (
--remote). -
clone() -> SelfClone it after creating it (
--clone). -
push() -> SelfPush the local commits to it (
--push). -
add_readme() -> SelfAdd a README (
--add-readme). -
include_all_branches() -> SelfCopy every branch of the template, not just its default (
--include-all-branches). -
disable_issues() -> SelfTurn issues off (
--disable-issues). -
disable_wiki() -> SelfTurn the wiki off (
--disable-wiki).
class GhRepoDeleteSettings(GhRepoCommandSettings) Settings for gh repo delete.
-
repository(slug: str) -> SelfThe repository to delete, as
owner/name(required — see below). -
yes() -> SelfSkip the confirmation a delete otherwise prompts for (
--yes).
class GhRepoEditSettings(GhRepoCommandSettings) Settings for gh repo edit.
-
repository(slug: str) -> SelfThe repository to edit; gh edits the current one otherwise.
-
description(text: str) -> SelfSet the description (
--description). -
homepage(url: str) -> SelfSet the homepage (
--homepage). -
default_branch(name: str) -> SelfSet the default branch (
--default-branch). -
visibility(value: Literal['public', 'private', 'internal']) -> SelfChange the visibility (
--visibility), which needs acceptVisibilityChangeConsequences. -
accept_visibility_change_consequences() -> SelfAcknowledge what a visibility change does (
--accept-visibility-change-consequences). -
add_topic(*names: str) -> SelfAdd a topic (
--add-topic); repeatable. -
remove_topic(*names: str) -> SelfRemove a topic (
--remove-topic); repeatable. -
enable_issues(enabled: bool | None=None) -> SelfTurn issues on or off (
--enable-issues). -
enable_wiki(enabled: bool | None=None) -> SelfTurn the wiki on or off (
--enable-wiki). -
enable_projects(enabled: bool | None=None) -> SelfTurn projects on or off (
--enable-projects). -
enable_discussions(enabled: bool | None=None) -> SelfTurn discussions on or off (
--enable-discussions). -
enable_auto_merge(enabled: bool | None=None) -> SelfTurn auto-merge on or off (
--enable-auto-merge). -
enable_merge_commit(enabled: bool | None=None) -> SelfAllow or forbid merge commits (
--enable-merge-commit). -
enable_squash_merge(enabled: bool | None=None) -> SelfAllow or forbid squash merges (
--enable-squash-merge). -
enable_rebase_merge(enabled: bool | None=None) -> SelfAllow or forbid rebase merges (
--enable-rebase-merge). -
delete_branch_on_merge(enabled: bool | None=None) -> SelfDelete the head branch after a merge, or stop (
--delete-branch-on-merge). -
allow_forking(enabled: bool | None=None) -> SelfAllow or forbid forking (
--allow-forking). -
allow_update_branch(enabled: bool | None=None) -> SelfAllow or forbid updating a pull request branch (
--allow-update-branch). -
enable_secret_scanning(enabled: bool | None=None) -> SelfTurn secret scanning on or off (
--enable-secret-scanning). -
enable_secret_scanning_push_protection(enabled: bool | None=None) -> SelfTurn push protection on or off (
--enable-secret-scanning-push-protection).
class GhRepoForkSettings(GhRepoCommandSettings) Settings for gh repo fork.
-
repository(slug: str) -> SelfThe repository to fork; gh forks the current one otherwise.
-
org(name: str) -> SelfCreate the fork in an organization (
--org). -
fork_name(value: str) -> SelfName the fork something else (
--fork-name). -
remote_name(value: str) -> SelfThe remote name to add for the fork (
--remote-name). -
clone() -> SelfClone the fork after creating it (
--clone). -
remote() -> SelfAdd a git remote for the fork (
--remote). -
default_branch_only() -> SelfFork only the default branch (
--default-branch-only). -
git_args(*args: str) -> SelfFlags for the underlying
git clone, passed after a--separator.
class GhRepoListSettings(GhReadSettings) Settings for gh repo list.
-
owner(login: str) -> SelfWhose repositories to list; gh lists your own when it is omitted.
-
language(name: str) -> SelfFilter by primary language (
--language). -
topic(*names: str) -> SelfFilter by topic (
--topic); repeatable. -
visibility(value: Literal['public', 'private', 'internal']) -> SelfFilter by visibility (
--visibility). -
archived() -> SelfOnly archived repositories (
--archived). -
no_archived() -> SelfLeave archived repositories out (
--no-archived). -
fork() -> SelfOnly forks (
--fork). -
source() -> SelfOnly repositories that are not forks (
--source). -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 30.
class GhRepoRenameSettings(GhCommandSettings) Settings for gh repo rename.
-
new_name(value: str) -> SelfThe repository's new name, without the owner (required).
-
yes() -> SelfSkip the confirmation a rename otherwise prompts for (
--yes).
class GhRepoSetDefaultSettings(GhRepoCommandSettings) Settings for gh repo set-default.
-
repository(slug_or_remote: str) -> SelfThe repository to make the default, as
owner/nameor a remote name. -
unset() -> SelfForget the current default instead (
--unset). -
view() -> SelfReport the current default instead (
--view).
class GhRepoSyncSettings(GhRepoCommandSettings) Settings for gh repo sync.
-
destination(slug: str) -> SelfThe repository to update; gh syncs the local one otherwise.
-
source(slug: str) -> SelfWhere to sync from (
--source); gh uses the fork's parent otherwise. -
branch(name: str) -> SelfThe branch to sync (
--branch); gh uses the default branch otherwise. -
force() -> SelfHard-reset the destination branch onto the source (
--force).
class GhRepoViewSettings(GhWebReadSettings) Settings for gh repo view.
-
repository(slug: str) -> SelfThe repository, as
owner/name; gh uses the current one otherwise. -
branch(name: str) -> SelfView a particular branch (
--branch).
class GhRunCancelSettings(GhRunTargetSettings) Settings for gh run cancel.
-
force() -> SelfCancel a run the ordinary request will not stop (
--force).
class GhRunDeleteSettings(GhRunTargetSettings) Settings for gh run delete.
class GhRunDownloadSettings(GhRunTargetSettings) Settings for gh run download.
-
name(*names: str) -> SelfOnly artifacts with this exact name (
--name); repeatable. -
pattern(*globs: str) -> SelfOnly artifacts matching this glob (
--pattern); repeatable. -
dir(path: str) -> SelfThe directory to download into (
--dir); gh's default is the cwd.
class GhRunListSettings(GhReadSettings) Settings for gh run list.
-
all() -> SelfInclude runs of disabled workflows (
--all). -
branch(name: str) -> SelfFilter by branch (
--branch). -
commit(sha: str) -> SelfFilter by the commit that triggered them (
--commit). -
created(query: str) -> SelfFilter by creation date (
--created), in GitHub's date-query syntax. -
event(name: str) -> SelfFilter by the event that triggered them (
--event). -
status(value: Literal['queued', 'completed', 'in_progress', 'requested', 'waiting', 'pending', 'action_required', 'cancelled', 'failure', 'neutral', 'skipped', 'stale', 'startup_failure', 'success', 'timed_out']) -> SelfFilter by status or conclusion (
--status). -
user(login: str) -> SelfFilter by the user who triggered them (
--user). -
workflow(name_or_id: str) -> SelfFilter by workflow, by name, id, or file name (
--workflow). -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 20.
class GhRunRerunSettings(GhRunTargetSettings) Settings for gh run rerun.
-
failed() -> SelfRerun only the failed jobs and their dependencies (
--failed). -
job(job_id: str | float) -> SelfRerun one job and its dependencies (
--job), by job id. -
debug() -> SelfRerun with debug logging enabled (
--debug).
class GhRunTargetSettings(GhCommandSettings) Base for the run commands that name one run. gh prompts for a run when the operand is omitted, so unlike a pull request there is no useful default.
-
selector(run_id: str | float) -> SelfThe run — its id (required).
class GhRunViewSettings(GhWebReadSettings) Settings for gh run view.
-
selector(run_id: str | float) -> SelfThe run — its id; gh shows a picker without one.
-
attempt(number: float) -> SelfView an earlier attempt (
--attempt). -
job(job_id: str | float) -> SelfView one job of the run (
--job), by job id. -
log() -> SelfPrint the full log (
--log). -
log_failed() -> SelfPrint only the failed steps' log (
--log-failed). -
exit_status() -> SelfExit non-zero when the run failed (
--exit-status). -
verbose() -> SelfInclude the individual job steps (
--verbose).
class GhRunWatchSettings(GhRunTargetSettings) Settings for gh run watch.
-
compact() -> SelfReport only the relevant and failed steps (
--compact). -
exit_status() -> SelfExit non-zero when the run fails (
--exit-status). -
interval(seconds: float) -> SelfSeconds between refreshes (
--interval); gh's default is 3.
class GhSarifSettings(Settings) Settings for GhSarifApi.uploadSarif.
-
file(path: str) -> SelfThe SARIF report to upload (required).
-
repo(slug: str) -> SelfThe
owner/repoto upload for. Defaults toGITHUB_REPOSITORY. -
commit(sha: str) -> SelfThe commit SHA the results describe. Defaults to
GITHUB_SHA. -
ref(ref: str) -> SelfThe full ref the results describe (
refs/heads/main). Defaults toGITHUB_REF. -
token(value: str) -> SelfThe token to authenticate with — needs
security-events: write. Defaults toGITHUB_TOKENin the environment, so it never has to reach argv. -
checkout_uri(uri: str) -> SelfThe URI of the checkout the results are relative to (
file:///…). -
base_url(url: str) -> SelfUse a different REST base (GitHub Enterprise Server).
class GhSecretDeleteSettings(GhSecretScopeSettings) Settings for gh secret delete.
-
name(value: str) -> SelfThe secret's name (required).
class GhSecretListSettings(GhReadSettings) Settings for gh secret list.
-
app(name: Literal['actions', 'agents', 'codespaces', 'dependabot']) -> SelfWhich application's secrets to list (
--app). -
org(name: str) -> SelfList an organization's secrets (
--org). -
environment(name: str) -> SelfList an environment's secrets (
--env). -
user() -> SelfList your own secrets (
--user).
class GhSecretScopeSettings(GhCommandSettings) Base for the secret commands that name one scope: the application, and whether the secret belongs to a repository, an organization, an environment, or the authenticated user.
-
app(name: Literal['actions', 'agents', 'codespaces', 'dependabot']) -> SelfWhich application reads it (
--app); gh's default isactions. -
org(name: str) -> SelfScope it to an organization (
--org). -
environment(name: str) -> SelfScope it to a deployment environment (
--env). -
user() -> SelfScope it to the authenticated user (
--user). -
repositories(*names: str) -> SelfShare an organization secret with these repositories (
--repos). -
visibility(value: Literal['all', 'private', 'selected']) -> SelfThe visibility of an organization secret (
--visibility).
class GhSecretSetSettings(GhSecretScopeSettings) Settings for gh secret set.
-
name(value: str) -> SelfThe secret's name (required).
-
body(value: str) -> SelfThe secret's value (
--body). Omit it and gh reads standard input, which keeps the value out of the process's arguments — see the module docs. -
env_file(path: str) -> SelfRead names and values from a dotenv file (
--env-file). -
no_store() -> SelfPrint the encrypted value instead of storing it (
--no-store). -
no_repos_selected() -> SelfShare the organization secret with no repositories (
--no-repos-selected).
class GhSettings(SubcommandSettings) Settings for a gh invocation.
-
repo(slug: str) -> SelfTarget repository as
OWNER/REPO(-R/--repo).
class GhTasks Typed task functions for GitHub: the gh CLI and the REST-only operations.
-
static async app_token(ctx: ServiceContext, configure: Callable[[GhAppTokenSettings], GhAppTokenSettings] | None=None) -> objectMint a GitHub App installation token, scoped to the repositories and permissions the settings request. The returned token is registered with the Actions log masker, so it is safe to pass onward through
env. -
static async app_token_source(ctx: ServiceContext, configure: Callable[[GhAppTokenSourceSettings], GhAppTokenSourceSettings] | None=None) -> objectA token source for the App: a function that mints the installation token the first time it is called and returns the same token after, or yields
GITHUB_TOKENwhen the App is not configured — the credential a build hands to an AI reviewer's.commentToken(...)so its reviews post as the App where it is installed and asgithub-actions[bot]everywhere else. Nothing runs until the first call. `ts appId = parameter("GitHub App id").env("REVIEW_APP_ID"); appKey = parameter("GitHub App key").secret().env("REVIEW_APP_KEY"); botToken = GhTasks.appTokenSource((s) => s.app(this.appId, this.appKey));` -
static async upload_sarif(ctx: ServiceContext, configure: Callable[[GhSarifSettings], GhSarifSettings] | None=None) -> objectUpload a SARIF report to GitHub code scanning, so its findings land in the repository's Security tab. Needs a token with
security-events: write. -
static async upload_release_asset(ctx: ServiceContext, configure: Callable[[GhReleaseAssetSettings], GhReleaseAssetSettings] | None=None) -> objectAttach a file to a GitHub release — the latest release by default, or the one named by
.tag(...). Idempotent: an asset the release already carries under the same name is kept as-is (unless.refresh()asks for one with different bytes to be replaced), and a repository with no releases resolves tostate: "no-release"rather than throwing. Needs a token withcontents: write. -
static async mark_release_latest(ctx: ServiceContext, configure: Callable[[GhReleaseLatestSettings], GhReleaseLatestSettings] | None=None) -> objectPoint the repository's "Latest release" at the release for
.tag(...). Idempotent, and quiet about it: a pointer already on the tag's release is left untouched rather than re-written, so an unattended pipeline can run this unconditionally without churning the release's audit history. A tag with no release resolves tostate: "no-release"rather than throwing — the release may be cut by a later, human step — while a tag that does not exist at all is an error, because the caller named it. Needs a token withcontents: write. -
static async ensure_release(ctx: ServiceContext, configure: Callable[[GhReleaseEnsureSettings], GhReleaseEnsureSettings] | None=None) -> objectPublish a release for
.tag(...)unless it already has one. Reads the tag's release first and returnsstate: "exists"when there is one, writing nothing — so an unattended pipeline can run this on every push without overwriting notes a maintainer wrote by hand. Needs a token withcontents: write. -
static async create_or_update_file(ctx: ServiceContext, configure: Callable[[GhContentsSettings], GhContentsSettings] | None=None) -> objectWrite one file through the contents API, creating it or replacing its content — or, when it already holds exactly this content, writing nothing and reporting
unchanged. A write that loses a race (the file changed between the read and the write) is read once more: if the file now holds this content the result isunchanged, otherwise the conflict is raised rather than overwritten. -
static async pr_create(ctx: ServiceContext, configure: Callable[[GhPrCreateSettings], GhPrCreateSettings] | None=None) -> ExecResultOpen a pull request:
gh pr create. Needs theghbinary and its auth; "./pull_request.ts".GhPullRequestApi.pullRequest is the REST path, which needs a token instead. -
static async pr_list(ctx: ServiceContext, configure: Callable[[GhPrListSettings], GhPrListSettings] | None=None) -> ExecResultList pull requests:
gh pr list. -
static async pr_list_entries(ctx: ServiceContext, configure: Callable[[GhPrListSettings], GhPrListSettings] | None=None) -> objectThe pull requests as parsed GhPullRequestEntry values. The
--jsonfield set is pinned, since gh requires one by name. -
static async pr_view(ctx: ServiceContext, configure: Callable[[GhPrViewSettings], GhPrViewSettings] | None=None) -> ExecResultShow a pull request:
gh pr view. -
static async pr_checks(ctx: ServiceContext, configure: Callable[[GhPrChecksSettings], GhPrChecksSettings] | None=None) -> ExecResultReport a pull request's checks:
gh pr checks. -
static async pr_merge(ctx: ServiceContext, configure: Callable[[GhPrMergeSettings], GhPrMergeSettings] | None=None) -> ExecResultMerge a pull request:
gh pr merge. -
static async pr_comment(ctx: ServiceContext, configure: Callable[[GhPrCommentSettings], GhPrCommentSettings] | None=None) -> ExecResultComment on a pull request:
gh pr comment. -
static async pr_edit(ctx: ServiceContext, configure: Callable[[GhPrEditSettings], GhPrEditSettings] | None=None) -> ExecResultChange a pull request's metadata:
gh pr edit. -
static async pr_close(ctx: ServiceContext, configure: Callable[[GhPrCloseSettings], GhPrCloseSettings] | None=None) -> ExecResultClose a pull request:
gh pr close. -
static async issue_create(ctx: ServiceContext, configure: Callable[[GhIssueCreateSettings], GhIssueCreateSettings] | None=None) -> ExecResultOpen an issue:
gh issue create. -
static async issue_list(ctx: ServiceContext, configure: Callable[[GhIssueListSettings], GhIssueListSettings] | None=None) -> ExecResultList issues:
gh issue list. -
static async issue_list_entries(ctx: ServiceContext, configure: Callable[[GhIssueListSettings], GhIssueListSettings] | None=None) -> objectThe issues as parsed GhIssueEntry values. The
--jsonfield set is pinned, since gh requires one by name. -
static async issue_view(ctx: ServiceContext, configure: Callable[[GhIssueViewSettings], GhIssueViewSettings] | None=None) -> ExecResultShow an issue:
gh issue view. -
static async issue_comment(ctx: ServiceContext, configure: Callable[[GhIssueCommentSettings], GhIssueCommentSettings] | None=None) -> ExecResultComment on an issue:
gh issue comment. -
static async issue_close(ctx: ServiceContext, configure: Callable[[GhIssueCloseSettings], GhIssueCloseSettings] | None=None) -> ExecResultClose an issue:
gh issue close. -
static async release_create(ctx: ServiceContext, configure: Callable[[GhReleaseCreateSettings], GhReleaseCreateSettings] | None=None) -> ExecResultPublish a release:
gh release create. -
static async release_list(ctx: ServiceContext, configure: Callable[[GhReleaseListSettings], GhReleaseListSettings] | None=None) -> ExecResultList releases:
gh release list. -
static async release_list_entries(ctx: ServiceContext, configure: Callable[[GhReleaseListSettings], GhReleaseListSettings] | None=None) -> objectThe releases as parsed GhReleaseEntry values. The
--jsonfield set is pinned, since gh requires one by name. -
static async release_view(ctx: ServiceContext, configure: Callable[[GhReleaseViewSettings], GhReleaseViewSettings] | None=None) -> ExecResultShow a release:
gh release view. -
static async release_upload(ctx: ServiceContext, configure: Callable[[GhReleaseUploadSettings], GhReleaseUploadSettings] | None=None) -> ExecResultAttach assets to a release:
gh release upload. Needs theghbinary; "./release_asset.ts".GhReleaseAssetApi.uploadReleaseAsset is the REST path, which needs a token instead. -
static async release_download(ctx: ServiceContext, configure: Callable[[GhReleaseDownloadSettings], GhReleaseDownloadSettings] | None=None) -> ExecResultDownload a release's assets:
gh release download. -
static async release_edit(ctx: ServiceContext, configure: Callable[[GhReleaseEditSettings], GhReleaseEditSettings] | None=None) -> ExecResultChange a release:
gh release edit. -
static async release_delete(ctx: ServiceContext, configure: Callable[[GhReleaseDeleteSettings], GhReleaseDeleteSettings] | None=None) -> ExecResultRemove a release:
gh release delete. -
static async run_list(ctx: ServiceContext, configure: Callable[[GhRunListSettings], GhRunListSettings] | None=None) -> ExecResultList workflow runs:
gh run list. -
static async run_list_entries(ctx: ServiceContext, configure: Callable[[GhRunListSettings], GhRunListSettings] | None=None) -> objectThe runs as parsed GhRunEntry values — the reader a build branches on. The
--jsonfield set is pinned, since gh requires one by name. -
static async run_view(ctx: ServiceContext, configure: Callable[[GhRunViewSettings], GhRunViewSettings] | None=None) -> ExecResultShow a run:
gh run view. -
static async run_rerun(ctx: ServiceContext, configure: Callable[[GhRunRerunSettings], GhRunRerunSettings] | None=None) -> ExecResultRerun a run, or its failed jobs:
gh run rerun. -
static async run_cancel(ctx: ServiceContext, configure: Callable[[GhRunCancelSettings], GhRunCancelSettings] | None=None) -> ExecResultStop a run:
gh run cancel. -
static async run_delete(ctx: ServiceContext, configure: Callable[[GhRunDeleteSettings], GhRunDeleteSettings] | None=None) -> ExecResultRemove a run:
gh run delete. -
static async run_download(ctx: ServiceContext, configure: Callable[[GhRunDownloadSettings], GhRunDownloadSettings] | None=None) -> ExecResultFetch a run's artifacts:
gh run download. -
static async run_watch(ctx: ServiceContext, configure: Callable[[GhRunWatchSettings], GhRunWatchSettings] | None=None) -> ExecResultFollow a run until it finishes:
gh run watch. A target that watches blocks until Actions is done, so pair it with.killAfter(...)unless the wait is the point. -
static async workflow_list(ctx: ServiceContext, configure: Callable[[GhWorkflowListSettings], GhWorkflowListSettings] | None=None) -> ExecResultList workflows:
gh workflow list. -
static async workflow_list_entries(ctx: ServiceContext, configure: Callable[[GhWorkflowListSettings], GhWorkflowListSettings] | None=None) -> objectThe workflows as parsed GhWorkflowEntry values. The
--jsonfield set is pinned, since gh requires one by name. -
static async workflow_view(ctx: ServiceContext, configure: Callable[[GhWorkflowViewSettings], GhWorkflowViewSettings] | None=None) -> ExecResultShow a workflow, or its YAML:
gh workflow view. -
static async workflow_run(ctx: ServiceContext, configure: Callable[[GhWorkflowRunSettings], GhWorkflowRunSettings] | None=None) -> ExecResultDispatch a workflow:
gh workflow run. This returns once the dispatch is accepted; "./workflow.ts".githubWorkflow is the wait trigger that suspends the build until the run finishes. -
static async workflow_enable(ctx: ServiceContext, configure: Callable[[GhWorkflowEnableSettings], GhWorkflowEnableSettings] | None=None) -> ExecResultTurn a workflow on:
gh workflow enable. -
static async workflow_disable(ctx: ServiceContext, configure: Callable[[GhWorkflowDisableSettings], GhWorkflowDisableSettings] | None=None) -> ExecResultTurn a workflow off:
gh workflow disable. -
static async secret_set(ctx: ServiceContext, configure: Callable[[GhSecretSetSettings], GhSecretSetSettings] | None=None) -> ExecResultStore a secret:
gh secret set. A value passed as.body(...)becomes an argv entry and is readable in a process listing — see the module docs of "./secret.ts".GhSecretSetSettings for the alternatives. -
static async secret_list(ctx: ServiceContext, configure: Callable[[GhSecretListSettings], GhSecretListSettings] | None=None) -> ExecResultList the secrets' names:
gh secret list. -
static async secret_list_entries(ctx: ServiceContext, configure: Callable[[GhSecretListSettings], GhSecretListSettings] | None=None) -> objectThe secrets as parsed GhSecretEntry values — names and metadata; GitHub never returns a secret's value.
-
static async secret_delete(ctx: ServiceContext, configure: Callable[[GhSecretDeleteSettings], GhSecretDeleteSettings] | None=None) -> ExecResultRemove a secret:
gh secret delete. -
static async variable_set(ctx: ServiceContext, configure: Callable[[GhVariableSetSettings], GhVariableSetSettings] | None=None) -> ExecResultStore a variable:
gh variable set. -
static async variable_get(ctx: ServiceContext, configure: Callable[[GhVariableGetSettings], GhVariableGetSettings] | None=None) -> ExecResultRead a variable:
gh variable get. -
static async variable_value(ctx: ServiceContext, configure: Callable[[GhVariableGetSettings], GhVariableGetSettings] | None=None) -> objectA variable's value, with the trailing newline gh prints removed.
-
static async variable_list(ctx: ServiceContext, configure: Callable[[GhVariableListSettings], GhVariableListSettings] | None=None) -> ExecResultList variables:
gh variable list. -
static async variable_list_entries(ctx: ServiceContext, configure: Callable[[GhVariableListSettings], GhVariableListSettings] | None=None) -> objectThe variables as parsed GhVariableEntry values, values included — a variable is not a secret.
-
static async variable_delete(ctx: ServiceContext, configure: Callable[[GhVariableDeleteSettings], GhVariableDeleteSettings] | None=None) -> ExecResultRemove a variable:
gh variable delete. -
static async cache_list(ctx: ServiceContext, configure: Callable[[GhCacheListSettings], GhCacheListSettings] | None=None) -> ExecResultList the Actions caches:
gh cache list. -
static async cache_list_entries(ctx: ServiceContext, configure: Callable[[GhCacheListSettings], GhCacheListSettings] | None=None) -> objectThe caches as parsed GhCacheEntry values — what a build reads to decide which ones to reclaim.
-
static async cache_delete(ctx: ServiceContext, configure: Callable[[GhCacheDeleteSettings], GhCacheDeleteSettings] | None=None) -> ExecResultReclaim caches:
gh cache delete. -
static async repo_clone(ctx: ServiceContext, configure: Callable[[GhRepoCloneSettings], GhRepoCloneSettings] | None=None) -> ExecResultClone a repository:
gh repo clone. -
static async repo_create(ctx: ServiceContext, configure: Callable[[GhRepoCreateSettings], GhRepoCreateSettings] | None=None) -> ExecResultCreate a repository:
gh repo create. -
static async repo_view(ctx: ServiceContext, configure: Callable[[GhRepoViewSettings], GhRepoViewSettings] | None=None) -> ExecResultShow a repository:
gh repo view. -
static async repo_list(ctx: ServiceContext, configure: Callable[[GhRepoListSettings], GhRepoListSettings] | None=None) -> ExecResultList repositories:
gh repo list. -
static async repo_list_entries(ctx: ServiceContext, configure: Callable[[GhRepoListSettings], GhRepoListSettings] | None=None) -> objectThe repositories as parsed GhRepositoryEntry values. The
--jsonfield set is pinned, since gh requires one by name. -
static async repo_fork(ctx: ServiceContext, configure: Callable[[GhRepoForkSettings], GhRepoForkSettings] | None=None) -> ExecResultFork a repository:
gh repo fork. -
static async repo_sync(ctx: ServiceContext, configure: Callable[[GhRepoSyncSettings], GhRepoSyncSettings] | None=None) -> ExecResultBring a fork up to date:
gh repo sync. -
static async repo_edit(ctx: ServiceContext, configure: Callable[[GhRepoEditSettings], GhRepoEditSettings] | None=None) -> ExecResultChange a repository's settings:
gh repo edit. -
static async repo_rename(ctx: ServiceContext, configure: Callable[[GhRepoRenameSettings], GhRepoRenameSettings] | None=None) -> ExecResultRename a repository:
gh repo rename. -
static async repo_archive(ctx: ServiceContext, configure: Callable[[GhRepoArchiveSettings], GhRepoArchiveSettings] | None=None) -> ExecResultArchive or unarchive a repository:
gh repo archive/unarchive. -
static async repo_delete(ctx: ServiceContext, configure: Callable[[GhRepoDeleteSettings], GhRepoDeleteSettings] | None=None) -> ExecResultDelete a repository:
gh repo delete. Needs thedelete_reposcope. -
static async repo_set_default(ctx: ServiceContext, configure: Callable[[GhRepoSetDefaultSettings], GhRepoSetDefaultSettings] | None=None) -> ExecResultChoose the repository gh acts on by default:
gh repo set-default. -
static async label_list(ctx: ServiceContext, configure: Callable[[GhLabelListSettings], GhLabelListSettings] | None=None) -> ExecResultList labels:
gh label list. -
static async label_list_entries(ctx: ServiceContext, configure: Callable[[GhLabelListSettings], GhLabelListSettings] | None=None) -> objectThe labels as parsed GhLabelEntry values. The
--jsonfield set is pinned, since gh requires one by name. -
static async label_create(ctx: ServiceContext, configure: Callable[[GhLabelCreateSettings], GhLabelCreateSettings] | None=None) -> ExecResultAdd a label:
gh label create. -
static async label_edit(ctx: ServiceContext, configure: Callable[[GhLabelEditSettings], GhLabelEditSettings] | None=None) -> ExecResultChange a label:
gh label edit. -
static async label_delete(ctx: ServiceContext, configure: Callable[[GhLabelDeleteSettings], GhLabelDeleteSettings] | None=None) -> ExecResultRemove a label:
gh label delete. -
static async label_clone(ctx: ServiceContext, configure: Callable[[GhLabelCloneSettings], GhLabelCloneSettings] | None=None) -> ExecResultCopy another repository's labels:
gh label clone. -
static async run(ctx: ServiceContext, configure: Callable[[GhSettings], GhSettings] | None=None) -> ExecResultRun a
ghcommand. -
static async api(ctx: ServiceContext, endpoint: str, configure: Callable[[GhApiSettings], GhApiSettings] | None=None) -> ExecResultCall a REST endpoint through
gh api, with the user'sghcredentials — for operations that have no CLI verb, e.g. starring a repository:GhTasks.api("user/starred/zuke-build/zuke", (s) => s.method("PUT")).
class GhVariableDeleteSettings(GhCommandSettings) Settings for gh variable delete.
-
name(value: str) -> SelfThe variable's name (required).
-
org(name: str) -> SelfDelete an organization variable (
--org). -
environment(name: str) -> SelfDelete an environment variable (
--env).
class GhVariableGetSettings(GhReadSettings) Settings for gh variable get.
-
name(value: str) -> SelfThe variable's name (required).
-
org(name: str) -> SelfRead an organization variable (
--org). -
environment(name: str) -> SelfRead an environment variable (
--env).
class GhVariableListSettings(GhReadSettings) Settings for gh variable list.
-
org(name: str) -> SelfList an organization's variables (
--org). -
environment(name: str) -> SelfList an environment's variables (
--env).
class GhVariableSetSettings(GhCommandSettings) Settings for gh variable set.
-
name(value: str) -> SelfThe variable's name (required).
-
body(value: str) -> SelfIts value (
--body); omit it and gh reads standard input. -
env_file(path: str) -> SelfRead names and values from a dotenv file (
--env-file). -
org(name: str) -> SelfScope it to an organization (
--org). -
environment(name: str) -> SelfScope it to a deployment environment (
--env). -
repositories(*names: str) -> SelfShare an organization variable with these repositories (
--repos). -
visibility(value: Literal['all', 'private', 'selected']) -> SelfThe visibility of an organization variable (
--visibility).
class GhWebReadSettings(GhReadSettings) Base for the read commands that also take --web: every one of them except release list, which gh gives no browser view. Keeping .web() here rather than on GhReadSettings is what stops a build offering a flag gh would reject.
-
web() -> SelfOpen the result in a browser instead of printing it (
--web). A build has no browser, so this is for a developer running the target by hand.
class GhWorkflowDisableSettings(GhWorkflowTargetSettings) Settings for gh workflow disable.
class GhWorkflowEnableSettings(GhWorkflowTargetSettings) Settings for gh workflow enable.
class GhWorkflowListSettings(GhReadSettings) Settings for gh workflow list.
-
all() -> SelfInclude disabled workflows (
--all). -
limit(count: float) -> SelfCap how many are fetched (
--limit); gh's default is 50.
class GhWorkflowRunSettings(GhWorkflowTargetSettings) Settings for gh workflow run — dispatching a workflow_dispatch run.
-
ref(name: str) -> SelfThe branch or tag to run it on (
--ref). -
field(key: str, value: str | float | bool) -> SelfAn input, as
--field key=value. gh reads a leading@in the value as a file to read, so use rawField for a value that starts with one. -
raw_field(key: str, value: str | float | bool) -> SelfAn input passed verbatim (
--raw-field), with no@file syntax. -
json_input() -> SelfRead the whole input object as JSON on standard input (
--json).
class GhWorkflowTargetSettings(GhCommandSettings) Base for the workflow commands that name one workflow, which gh takes by file name, name, or numeric id.
-
workflow(name_or_id: str | float) -> SelfThe workflow — its file name, its name, or its id (required).
class GhWorkflowViewSettings(GhWorkflowTargetSettings) Settings for gh workflow view.
Unlike the other viewing commands this one prints no JSON — gh gives it --yaml and --web but no --json — so it does not carry the read flags.
-
ref(name: str) -> SelfThe branch or tag holding the version to view (
--ref). -
yaml() -> SelfPrint the workflow's YAML rather than its summary (
--yaml). -
web() -> SelfOpen it in a browser instead of printing it (
--web). A build has no browser, so this is for a developer running the target by hand.