Skip to content

Instantly share code, notes, and snippets.

@PeterWhittaker
Last active August 20, 2020 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PeterWhittaker/b74b1004f2d66acfc16293f2a3acea19 to your computer and use it in GitHub Desktop.
Save PeterWhittaker/b74b1004f2d66acfc16293f2a3acea19 to your computer and use it in GitHub Desktop.
Simple Auth Token recipe for ghi

Using GitHub Auth Tokens with ghi

I'm using ghi to manage GitHub issues from the command line. ghi uses the GitHub API, which is HTTPS-only (not SSH), which means I cannot use my SSH keys to authenticate my ghi requests. GitHub is deprecating password authentication so authorization tokens are required; while this is more-or-less covered in the ghi docs, it isn't exactly clear.

Here's the simple, three-step recipe:

  1. Go to the GitHub new personal access token page (you will need your GitHub password)
    1. Enter a useful, memorable title, e.g., For GHI at the CLI
    2. Select repo scope
    3. At the bottom of the page, click Generate Token
  2. Copy or otherwise make note the token - you will never see it again, make sure you do this correctly.
  3. At the command line on your favourite development machine, run the command git config --global ghi.token <token>, replacing with the token from step 2.

That should do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment