toolbox · tool

GitHub CLI

The gh command for repos, secrets and workflow runs without leaving the terminal.

Install

winget install --id GitHub.cli --source winget
gh auth login
gh --version

What it is

The official GitHub command-line client. It does almost anything the website does, which makes repo setup and deployment repeatable.

How it works

gh reads your authenticated account from the OS keyring. Commands take --repo owner/name when you are not in the repository folder.

In this project

gh repo create HensonHenson/Unni-Web --private --source . --remote origin --push
gh secret set CLOUDFLARE_API_TOKEN
gh secret set CLOUDFLARE_ACCOUNT_ID --body <account-id>
gh workflow run deploy-games.yml --ref main
gh run watch <run-id> --exit-status

Gotchas

  • gh secret set NAME prompts for the value without echoing it. Prefer that over --body for real secrets, which would land in shell history.
  • gh auth status shows the active account and token scopes.
  • Deleting a repository is permanent. Check the name twice.