gh-select

Commands

doctor, limits, refresh, version and help, each as a word, a short flag and a long flag.

View as Markdown
gh select [options]      open the repo picker
gh select <command>      run one command and exit

Each command works as a word (limits), a short flag (-l) and a long flag (--limits). All of them take -h or --help for their own page. Without a command, gh select opens the picker and accepts the options.

CommandShortLongWhat it does
doctornone--doctorcheck git, gh and your GitHub login
limits-l--limitsshow GitHub API rate limit usage
refresh-r--refreshrefetch the repo cache and exit
version-v--versionprint the installed version
help [command]-h--helpshow the overview, or one command's help

doctor

gh select doctor

gh select doctor

Checks that git and gh are on your PATH and that gh auth status succeeds. Each line is [ok] or [x] with the path found or a hint. It needs no login itself, so it still runs when everything else fails. It always exits 0.

limits

gh select limits

Prints the search, core, graphql and code_search budgets. Every tool that uses your gh login shares them.

gh select limits

Each row has a usage bar, used and limit, the window length and a pace note. A marker in the bar shows how far the current window has run. When the current pace would empty a bucket before it resets, the note says how soon. A window starts at its first request, so an unused bucket reports zero elapsed. The ? overlay in the app shows the same.

refresh

gh select refresh

gh select refresh

Fetches every repository you can access, saves it to the cache and prints Refreshed N repositories. The app already refreshes a stale cache in the background, so this is for cron jobs and scripts. See scripting.

version

gh select version

Prints gh-select VERSION. Release builds print the tag, like v2.6.0. Local builds print the commit, like dev+5006ea0, with -dirty when the tree had uncommitted changes.

When the last daily check found a newer release, a second line on stderr names it and how to upgrade. This command never touches the network.

help

gh select help
gh select help refresh
gh select refresh -h

gh select help

Without a command it prints the overview: usage, commands, options, environment, a pointer to the in-app keys, and examples. With a command it prints that command's page, as does adding -h or --help to any command. Output is colored on a terminal unless NO_COLOR is set.

How the command line is read

  • A flag form counts anywhere in the arguments. A bare word counts only first, or right after help, so a value such as --dir refresh is never mistaken for a command.
  • Two different commands in one line fail with doctor and limits can't be combined.
  • A command takes no options. gh select refresh --theme nord fails with refresh takes no options, got --theme nord.
  • An unknown word fails with unknown command NAME, and an unknown flag with unknown option --NAME. Both suggest the closest valid name when one is near, as in did you mean --limits?, and exit with status 2.

A typo suggests the closest command

Edit this page on GitHub

Last updated on

On this page