Copilot for CLI
在 macOS 安装 GitHub CLI
- 安装
brew install gh
- 升级
brew upgrade gh
- 登录
gh auth login
? What account do you want to log into? GitHub.com
? What is your preferred protocol for Git operations on this host? HTTPS
? Authenticate Git with your GitHub credentials? Yes
? How would you like to authenticate GitHub CLI? Login with a web browser
! First copy your one-time code: EA2E-F864
Press Enter to open github.com in your browser...
✓ Authentication complete.
- 查看登录状态
gh auth status
github.com
✓ Logged in to github.com account wang-junjian (keyring)
- Active account: true
- Git operations protocol: https
- Token: gho_************************************
- Token scopes: 'gist', 'read:org', 'repo', 'workflow'