Skip to main content

A collection of useful GitHub commands

Project description

# 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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ghb-1.12.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

ghb-1.12.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file ghb-1.12.0.tar.gz.

File metadata

  • Download URL: ghb-1.12.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for ghb-1.12.0.tar.gz
Algorithm Hash digest
SHA256 1c5221b0d4382de920a55fed7c099932ec1d12c292dc774d58fd590c9da88286
MD5 e0a570aedf00a6308ccbd23e6b1b5606
BLAKE2b-256 ce4af77fef41b1b6bf0f97f611eb1a4f1edf7597002b31511da48398d1fcf1dd

See more details on using hashes here.

File details

Details for the file ghb-1.12.0-py3-none-any.whl.

File metadata

  • Download URL: ghb-1.12.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for ghb-1.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56a8520fb4abb4a85aa586234aed6e4af172a998b8aa0fc0b56b31ccd2647a98
MD5 2f999cfa3234f17b70003efee03e8190
BLAKE2b-256 7acded4932e0a4879feb1778bc0e763d1287e90c5fef551a9716ea2d5e5dbd57

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page