org-hopper
is an oh-my-zsh
plugin which wraps the GitHub CLI with fzf. It allows you to quickly jump between repositories a given GitHub organization, cloning it to a predefined location if the local copy doesn't already exist.
Installed and on PATH:
gh
- docs - used to fetch repositories and clone them, must be configured already to be able to browse the organizationfzf
- docs - used to browse known repositories and quickly jump to them- Copy
org-hopper.plugin.zsh
to your$ZSH_CUSTOM/plugins
folder,~/.oh-my-zsh/custom
by default - Append
org-hopper
to your existing plugins list in~/.zshrc
, likeplugins=(org-hopper)
Finally, start a new terminal session to make the plugin available.
Calling orghop
with no options will open an fzf fuzzy finder with the organization's repositories as its contents.
Selecting one will either clone it using gh repo clone
or cd
into it if a local copy already exists. The repository will be placed at $ORG_HOPPER_DIRECTORY/<repository-name>
, which is $HOME/$ORG_HOPPER_ORG/<repository-name>
by default.
The plugin maintains a cache of results at $ORG_HOPPER_CACHE_LOCATION/.org_hopper.cache
, which is by default in the home directory. As needed, you can run orghop refresh
to refetch the cache. Currently this is not done automatically so as to not inconvenience.
Important
It's required to set the $ORG_HOPPER_ORG
variable in your shell settings (like ~/.zshrc
) before calling the plugin.
orghop -- Open fuzzy finder for current repository cache
orghop refresh -- Refresh repository cache (do this occasionally, as needed)
orghop age -- Check the age of the current repo cache
Potentially:
ORG_HOPPER_ORG=react orghop -- overwride the ORG_HOPPER_ORG for this call only. This will ignore and overwrite the cache.
In ~/.zshrc
(or similar)
# Required
export ORG_HOPPER_ORG=<desired-organization>
# Optional, with the below defaults
export ORG_HOPPER_CACHE_LOCATION=$HOME
export ORG_HOPPER_REPO_DIRECTORY=$HOME/$ORG_HOPPER_ORG
export ORG_HOPPER_COLOR_RECENT=cyan
export ORG_HOPPER_COLOR_OUTDATED=red
You can configure fzf using environment variables if desired.