Feature request - authentication to github URLs for protected/private repos from command line

As far as I can tell, there is no way to authenticate to github.com from the command line in order to hit a URL in a private repository.

e.g., I can authenticate and hit

The reason I’d like to be able to hit these github.com URLs is for the purpose of link checking. Many people maintain documentation in github, and sometimes those repositories are private. It would be great to be able to run a link checker script that would walk through markdown and other files and validate that the links are correct.

Unfortunately, it seems for now that the only authentication possible is through a web browser, unless there’s some trick I’m missing.

Thus, I’d like to request that github enable this ability, to authenticate and then hit URLs from the command line without having to re-write the urls as api.github.com.

:wave: @karlbrown-va - I can confirm here that there is no way to authenticate to GitHub.com from the command line in the way that you’ve described. We’re always working to improve GitHub and the GitHub Support Community, and we consider every suggestion we receive. As a next step, would you mind submitting this through our official product feedback form so that our product team can track your request?

From my understanding of your use case, it sounds like you want to perform link checking by ensuring a particular file in some private repository exists. While we can’t make any promises on upcoming changes to the current functionality, have you considered using the GitHub API’s Repository Contents API?

There’s a specific endpoint for getting the contents of a file or directory in a repository that might be worth checking out. Granted, there may be some work required around transforming github.com-namedspaced URLs to the format accepted by that API endpoint, though we can guarantee its functionality based on existing documentation and the way other integrators on our platform have leveraged this for their own applications.