はじめに
Githubにいろいろリポジトリを登録していくと、次第に自分がどんな名前のリポジトリを作ったか忘れてしまうことがある。
gh コマンドを使う
gh repo list
ただし、APIの制限でデフォルトでは30個までしかとってきてくれないので、-L
もしくは --limit
を自分のリポジトリの数とだいたい同じ数だけ指定しておいたほうが便利だ。
あとは grep するなり、bat に流し込むなりすればよい。
gh repo list --limit 200 | grep hoge
gh repo list --limit 200 | bat -
プライベートリポジトリだけ表示したい場合は、--visibility
を設定する。
gh repo list --visibility private
そのほか便利なオプションが揃っている。
--archived Show only archived repositories
--fork Show only forks
-q, --jq expression Filter JSON output using a jq expression
--json fields Output JSON with the specified fields
-l, --language string Filter by primary coding language
-L, --limit int Maximum number of repositories to list (default 30)
--no-archived Omit archived repositories
--source Show only non-forks
-t, --template string Format JSON output using a Go template
--topic string Filter by topic
--visibility string Filter by repository visibility: {public|private|internal}
ちなみに、自分以外の人のリポジトリでも表示できる。(Publicリポジトリのみ)
gh repo list torvalds
この記事は以上です。