0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Githubの自分のリポジトリ一覧をターミナルに表示する

Last updated at Posted at 2022-06-02

はじめに

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

この記事は以上です。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?