Github 命令行工具 gh 使用介绍
安装
brew install gh
使用
$ gh auth login
? What account do you want to log into? GitHub.com
The value of the GITHUB_TOKEN environment variable is being used for authentication.
To have GitHub CLI store credentials instead, first clear the value from the environment.
(base) ➜ ~ gh auth login -h github.com
...
The minimum required scopes are 'repo', 'read:org'.
? Paste your authentication token: ****************************************
- gh config set -h github.com git_protocol ssh
✓ Configured git protocol
✓ Logged in as xiexianbin
(base) ➜ ~ gh auth login status
accepts 0 arg(s), received 1
$ gh auth login status
accepts 0 arg(s), received 1
$ gh api \
-H "Accept: application/vnd.github.v3+json" \
/user/repos