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:
- Go to the GitHub new personal access token page (you will need your GitHub password)
- Enter a useful, memorable title, e.g., For GHI at the CLI
- Select repo scope
- At the bottom of the page, click Generate Token
- Copy or otherwise make note the token - you will never see it again, make sure you do this correctly.
- 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.