GitHub CLI
インストールと初期設定
code:terminal
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& sudo apt update \
&& sudo apt install gh -y
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? Paste an authentication token
? Paste your authentication token: *********************************************************************************************
自動補完もしようね
code:.zshrc
eval "$(gh completion -s zsh)"
gh repo create my-repo
ChatGPT.icon
table:flags
フラグ 説明
--public 公開リポジトリを作成
--private プライベートリポジトリを作成(デフォルト)
--clone 作成後にリポジトリをローカルにクローン
--source=./my-project 指定したフォルダの内容をリポジトリにプッシュ
--push --sourceを指定した場合、内容を初回コミットとしてプッシュ
--description "My new project" リポジトリの説明を追加
--team=my-team チームリポジトリの場合、チーム名を指定
--license=mit リポジトリにライセンスを追加
--template=username/template-repo 指定したテンプレートリポジトリから作成