$ curl -u 'username' -d '{"scopes":["repo"],"note":"Help example"}' https://api.github.com/authorizations
Enter host password for user 'username':
{
"id": ,
"url": "",
"app": {
"name": "Help example",
"url": "https://developer.github.com/v3/oauth_authorizations/",
"client_id": "00000000000000000000"
},
"token": "",
"hashed_token": "",
"token_last_eight": "",
"note": "Help example",
"note_url": null,
"created_at": "",
"updated_at": "",
"scopes": [
"repo"
],
"fingerprint": null
}
https://help.github.com/articles/creating-an-oauth-token-for-command-line-use