Skip to main content

# ghb

This is a small set of scripts for working with github. Unlike hub or gh the purpose of this is not to override git and add functionality on top of that. Instead this uses a git like method of looking for executables named ghb-* and nesting them under the ghb command. This allows you to create simple single purpose scripts in any language.

## Commands

  • [approve](ghb/approve.py), quickly approve a PR with a GitHub review

  • [assignme](ghb/assignme.py), assign yourself to a PR

  • [block](ghb/block.py), block users on GitHub

  • [clear-comments](ghb/clear_comments.py), delete all comments on a pull request

  • [close-prs](ghb/close_prs.py), close multiple PRs from a certain author targeting a specific branch

  • [comment](ghb/comment.py), comment on a list of issues / PRs

  • [contributions](ghb/contributions.py), view the number of contributions you’ve made today

  • [create](ghb/create.py), create github repos.

  • [delete-branches](ghb/delete_branches.py), delete stale branches matching some prefix

  • [download-release](ghb/download_release.py), download the most recent release from a repo

  • [get-blocks](ghb/get_blocks.py), get the users you’ve blocked

  • [greenify](ghb/greenify.py), force all statuses on a PR to be gren

  • [langs](ghb/langs.py), get the language breakdown for a repo

  • [ls-notifications](ghb/ls_notifications.py), list your unread notifications

  • [me](ghb/me.py), open your GitHub profile

  • [notifications](ghb/notifications.py), open your unread notifications in the browser

  • [pr](ghb/pr.py), open a PR from the current branch

  • [protect](ghb/protect.py), enable/disable branch protection for a specific repo and branch

  • [unblock](ghb/unblock.py), unblock a GitHub user

  • [unwatch](ghb/unwatch.py), bulk unwatch repos

  • [watch](ghb/watch.py), watch a repo

See the header comment in each individual file for specific usage.

### Installation

` brew install keith/formulae/ghb `

Or:

` pip install ghb `

(and install zsh/_ghb if you want zsh completions)

### Configuration

To setup authentication for ghb you must add a personal access token to your ~/.netrc file. You can generate a token [here](https://github.com/settings/tokens). You should enable the repo, workflow, notifications, and user scopes (you maybe be able to omit some of those depending on which subcommands you plan to use).

Then in your ~/.netrc file add:

` machine api.github.com login GITHUB_USERNAME password TOKEN `

And restrict permissions with chmod 0600 ~/.netrc (this is required)

Release files for ghb 1.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghb 1.13.0
File Size Uploaded
ghb-1.13.0.tar.gz 16.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghb 1.13.0
File Interpreter ABI Platform
ghb-1.13.0-py3-none-any.whl Python 3 none any Details

Total release size: 41.7 kB

Release files / ghb-1.13.0.tar.gz

Download URL ghb-1.13.0.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a38ac544e74beedba220c911c8b179083710a60be9ae59cc39d55743f8dfc148
BLAKE2b-256 checksum
How to use checksums
60d31c948e23379ffffdab672f7dbdf5b7d2c450d81bdfa006cfb29964edf0d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release files / ghb-1.13.0-py3-none-any.whl

Download URL ghb-1.13.0-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
502aa7c6bde4b31654ee2afa813468f3dc4229744b27c6bec31bce8d435cec84
BLAKE2b-256 checksum
How to use checksums
56f814cb1ddfe425794d0112339c5eb9f0a2b3d9a2b8a757bdd682e6eb91a85d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.0

Release history Release notifications | RSS feed

This release

1.13.0 This release

2 release files

1.10.0

2 release files

1.9.2

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page