# Get github API token from cli using curl
```shell
# Here's a command you can run from your terminal to generate a token via curl:
# Where $USERNAME is your Github username.
# Save the token generated and paste it in the settings section under the token option.
curl -v -u $USERNAME -X POST https://api.github.com/authorizations --data "{\"scopes\":[\"gist\"], \"note\": \"Token Description\"}"
# Where OTPCODE is the code your authenticator app shows you.
curl -v -u $USERNAME -H "X-GitHub-OTP: OTPCODE" -X POST https://api.github.com/authorizations --data "{\"scopes\":[\"gist\"], \"note\": \"Token Description\"}"
```