Skip to content

Instantly share code, notes, and snippets.

@ozh
Last active June 23, 2022 15:42
Show Gist options
  • Save ozh/4725166 to your computer and use it in GitHub Desktop.
Save ozh/4725166 to your computer and use it in GitHub Desktop.
Get a Github OAuth token from the CLI with curl

At the command line:

curl -u ':USERNAME' -d '{"scopes":["public_repo"],"note":"Google Issues to GH"}' https://api.github.com/authorizations
curl -H "Authorization: bearer :TOKEN" https://api.github.com/users/:USERNAME -I

Replace :USERNAME with your Github username and :TOKEN with the oauth token you get from first curl

After that, the token will be listed in your Applications and you can revoke it from there

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