Github 命令行工具 gh 使用介绍

发布时间: 更新时间: 总字数:139 阅读时间:1m 作者: IP属地: 分享 复制网址

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
  • api 测试
$ gh api \
  -H "Accept: application/vnd.github.v3+json" \
  /user/repos
Home Archives Categories Tags Statistics
本文总阅读量 次 本站总访问量 次 本站总访客数