ghtools
A set of commandline utilities for interacting with the GitHub or GitHub Enterprise API.
Installation
ghtools is available on PyPI and can be installed using pip:
$ pip install ghtools
Usage
Simple usage:
$ eval `gh-login` $ gh-repo alphagov/ghtools get $ gh-org alphagov members
ghtools is not a monolithic program. Instead, it comes with a number of scripts which each perform very specific tasks. The aim is for these scripts to be composable, allowing you to pipe their data to and from other unix tools (grep, sort, uniq, python -m json.tool, etc.) in order to build up your own more complex scripts.
Currently available tools within ghtools
Command |
Description |
|---|---|
gh-browse |
Manually browse the GitHub API by URL |
gh-list-members |
List members of a GitHub organisation (may be removed) |
gh-login |
Login to GitHub, generating an OAuth login token |
gh-migrate-project |
Migrate an entire project between GitHub instances |
gh-migrate-teams |
Migrate organisation teams between GitHub instances |
gh-org |
Interact with organisations |
gh-repo |
Interact with repositories |
gh-status |
Submit commit build status to GitHub |
Multiple instances
ghtools is, in particular, designed for interacting with multiple GitHub instances (i.e. github.com as well as your company’s GitHub Enterprise installation). You tell ghtools how to connect you non-github.com GitHub instances using “nicknames” and environment variables. For example, here’s how to login to a GitHub instance nicknamed “foo”, using a custom SSL cert bundle:
$ export GITHUB_FOO_API_ROOT=https://github.foo/api/v3 $ export GITHUB_FOO_CA_BUNDLE=/usr/share/ssl/github_foo.crt $ eval `gh-login --scope repo foo` $ gh-repo foo:alphagov/ghtools get $ gh-org foo:alphagov members
License
ghtools is released under the MIT license, a copy of which can be found in LICENSE.
Metadata
Release files for ghtools 0.23.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ghtools-0.23.0.tar.gz | 12.5 kB | Without provenance | Details for ghtools-0.23.0.tar.gz |
Release files / ghtools-0.23.0.tar.gz
| Download URL | ghtools-0.23.0.tar.gz |
|---|---|
| Size | 12.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d238500062fadaa3a742fe359b2159cce97c16d92914696cf0aa9ef415be2005
|
|
BLAKE2b-256 checksum How to use checksums |
c1a7ff037860b7c00a50cadeaef389a7307e47bd1521295b858c7ce6c1c9890f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ghtools 0.23.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.