Skip to content
Source
Sign inSign up

Use the gh commands you know

CLI and APIs

Use the gh commands that you know

You know gh, and you want to do the same work on the forge. These gh commands work in src with the flags of gh: find your task, then type the command.

6 min read

Without -R, a command acts on the repository of your clone. Without a terminal, src never asks a question, so the commands that delete, archive or rename need --yes.

Issues and pull requests

You want toCommand
See what needs you, new comments on your items, and what the people you follow didsrc status, src issue status, src pr status. See Catch up on your home page
Edit your newest commentsrc issue comment 12 --edit-last --body "Fixed in 1.2.0.", src pr comment 7 --edit-last -F note.md
Lock, pin or delete an issuesrc issue lock 12 --reason spam, src issue pin 12, src issue delete 12 --yes
Move an issue, or make a branch for itsrc issue transfer 12 acme/docs, src issue develop 12 --checkout
Mark a draft ready, or make it a draft againsrc pr ready 7, src pr ready 7 --undo
Revert a merged pull request, or bring the base branch into onesrc pr revert 7, src pr update-branch 7 --rebase
Lock the conversation of a pull requestsrc pr lock 7, src pr unlock 7
  • A lock reason is off_topic, resolved, spam or too_heated.
  • --edit-last edits your newest comment in the conversation, not a review or a line comment.
  • If you have no comment there, --edit-last fails with no comments found for current user.

Read the Community tab

src discussion list and src discussion view have the shape of gh, for the Community tab of a repository. They only read: people post, vote and answer on the web.

You want toCommand
List the feature requests, with the most votes firstsrc discussion list
List the shipped feature requestssrc discussion list --state shipped
List the questions with no accepted answersrc discussion list -c question --filter unanswered
Read one post, with its repliessrc discussion view 12
See the roadmap (gh has no roadmap command)src roadmap view
  • -c is request (the default) or question.
  • --sort is top, new or active for feature requests, and new or active for questions.
  • --filter is for questions only: unanswered, answered or all (the default).
  • Add --json <fields> to get JSON, for a script or an agent.

Repositories

You want toCommand
Pick the repository that src uses in this clonesrc repo set-default acme/app
Update a fork from its parent, or your clone from its remotesrc repo sync acme-fork/app, src repo sync
Push when git push fails with HTTP 413: the same push, sent in partssrc repo push origin main. See Push a large repository
Run git pull, then write the vault files and the MCP configsrc pull, src pull -- --rebase
Rename, archive or delete a repositorysrc repo rename app2 --yes, src repo archive --yes, src repo delete acme/old --yes
Link text like JIRA-123 to another toolsrc repo autolink create JIRA- "https://jira.example.com/browse/JIRA-<num>"
Find a gitignore or license templatesrc repo gitignore list, src repo license list
Make a repository with topicssrc repo create acme/api --public --topic api --topic cli
Say what you know, or find who knows a part of the codesrc expert set --about "the CI images" --path 'ci/**', src expert list
Read the rules and the errors of the CODEOWNERS filesrc codeowners list, src codeowners errors
Copy labels, find repositories, list your organizationssrc label clone acme/app, src search repos cli --owner acme, src org list

CI from the terminal

The run, workflow, cache, secret and variable commands of gh work on the CI of the forge.

You want toCommand
See the runs, and watch one until it endssrc run list, src run watch <run>
Watch the checks of a pull request until they endsrc pr checks 7 --watch
Read the log of the failed stepssrc run view <run> --log-failed
Start a workflow, or turn one offsrc workflow run deploy.ts -f env=preview, src workflow disable nightly.ts
Set a secret or a variablesrc secret set NPM_TOKEN --host registry.npmjs.org < token.txt, src variable set REGION --body eu-west
Give a task to an agentsrc agent-task create "Fix the flaky login test" -a <agent>
  • src run watch and src pr checks --watch follow the live event stream of the forge, and draw the table again at each change of the run or the checks. On a forge that has no event stream, they read again every --interval seconds.
  • To follow the log of one job while it runs, use src watch job <job> --run <run> --log. See Wait for CI, merges and pushes with src.
  • A workflow is its file name, like nightly.ts, or its name.
  • src agent-task create needs -a, because the forge has no default agent.
  • The CI reference has every flag. CI variables shows how a job reads a variable.

Skills

src skill has the install, list, preview, publish, search and update commands of gh skill, for skills on the forge:

src skill search "write e2e tests"
src skill install acme/changelog
src skill update --all

It also has commands that gh does not have, such as add-to-repo, update-in-repo, create, share and suggest. See Add a skill to your agents and Add skills to a repository.

gh commands that src does not have

These gh commands will not come to src. When you run one, src prints the reason and exits with 1.

gh commandWhy
codespaceTanStack Source has no codespaces or other hosted dev environments.
extensionsrc has no extension system, so it does not install or run gh extensions.
copilotTanStack Source does not have GitHub Copilot.
attestationTanStack Source does not make build provenance attestations.
ssh-key, repo deploy-keygit on TanStack Source takes tokens only, and the forge serves no SSH.
gpg-keyTanStack Source does not check commit signatures, so an account has no GPG keys.

Other gh commands, such as release and gist, are not supported yet. src help support lists each command and flag, and tells you whether it works now. The support page has the same list.

For the features that gh has no command for, see Use the commands that gh does not have. To wait for CI, a merge or a push in a script or an agent, see Wait for CI, merges and pushes with src.