'Generate github personal access token (PAT) by command line or SDK
I am looking for the command or SDK, such as python, to generate new personal access token (PAT) in Github, but I didn't see any API for it.
All the documents are about to login github from website, and manually generate it.
Are there any automation way?
Solution 1:[1]
Unfortunately, this isn't something that can be done completely programmatically. Creating PATs requires sudo mode on GitHub, which prompts the user to authenticate.
The best you can do is use a command to prefill parts of the creation of a PAT (scopes, description, etc.). This isn't currently a feature of any Python package, though something similar exists in this R package: https://usethis.r-lib.org/reference/github-token.html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | ExplosiveFridge |
