2 篇文章带有标签 “zsh”

Copilot for CLI

Copilot for CLI

GitHub 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'

命令 alias

zsh 中使用单引号('),不对特殊符号进行解析,使用双引号(")会对特殊符号进行解析,如:$

docker rmi none

alias docker.rmi.none='docker rmi --force $(docker images -q --filter "dangling=true")'

在终端通过 Safari 打开网址

alias open.chatgpt='open -a Safari https://platform.openai.com/playground\?mode\=chat'