gh-repo-stats
gh-repo-stats copied to clipboard
Enhance extension to leverage `gh auth` session
Problem
One of the helpful aspects of GitHub CLI extensions is their ability to delegate authorization issues to be handled by gh auth
. This allows interpreted and precompiled extensions to delegate this responsibility, focusing on the core functionality.
With initially running the gh-repo-stats
extension, it prompted and required a personal access token (PAT) when this was already setup via standard GH CLI methods.
$ gh repo-stats --org $(whoami)
######################################################
######################################################
############# GitHub repo list and sizer #############
######################################################
######################################################
------------------------------------------------------
Please create a GitHub Personal Access Token used to gather
information from your Organization, with a scope of 'repo',
followed by [ENTER]:
(note: your input will NOT be displayed)
Request
It would be nice if the extension was enhanced in a way where it did not need my PAT explicitly. Looking at the underlying interpreted script, I think this might be doable if all of the curl
calls were instead leveraging gh api
or other gh
subcommands itself.