Managing your personal access tokens - GitHub Docs

You can use a personal access token in place of a password when authenticating to GitHub in the command line or with the API.