pacmax beta

Alfred Pac by edgarjs on GitHub

github repos

Alfred workflow to easily open GitHub repositories

From their README

GitHub Repos Alfred Workflow

This Alfred workflow lets you search for GitHub repositories right from the Alfred bar.

It uses the GitHub CLI under the hood.

Requirements

Install the GitHub CLI:

# Run this in the terminal:
brew install gh

💡 Note:
The command above assumes you use Homebrew as your package manager.

Authentication

Authentication is handled by the GitHub CLI, so just follow the instructions when running:

# Run this in the terminal:
gh auth login

Installation

You can download the workflow from the releases page.

Double click on the .alfredworkflow file and follow the instructions.

Usage

The main keyword that triggers the workflow is: gh

Then you can start typing the name of the repository you're looking for. It will first fetch your repositories and filter them locally by name. If no match is found, it will search GitHub repositories.

gh octocat/hello-world

Example of gh command

When an item is highlighted, you can press Enter to open the repository's page, or press any of the following modifier keys for other options:

Hold Ctrl ⌃ for repository actions page

Press Enter while holding down the Ctrl key to open the repository's actions page.

Hold Cmd ⌘ to see Pull Requests

Press Enter while holding down the Cmd key to list the repository's open PRs.

Hold Option ⌥ to copy SSH clone command

Press Enter while holding down the Option key to copy the clone command with the repository's SSH URL.

Hold Shift+Option ⇧+⌥ to copy HTTPS clone command

Press Enter while holding down the Shift+Option keys to copy the clone command with the repository's HTTPS URL.

Configuration

API Response Caching

You can configure the cache duration passed to the GitHub CLI, by setting the following environment variables.

Environment Variable Description Default
CACHE_PULLS Cache duration for PRs API call 10m
CACHE_SEARCH_REPOS Cache duration for repos search API call 24h
CACHE_USER_REPOS Cache duration for user repos API call 72h
CACHE_DIR Directory removed by ghclear command $HOME/.cache/gh

⚠️ Caution ⚠️

If you don't see your recently created repository in the results, it may be due to the cache duration mentioned above.

Also make sure to use absolute paths if you need to customize the default. Like /Users/juan/cache instead of $HOME/cache

To clear the cache and force a new request to the GitHub API, type this in Alfred:

ghclear

Enterprise Host

If you're using an Enterprise account, you can set the following environment variable to your needs:

Environment Variable Description Default
API_HOST Hostname to use for the API calls github.com

Contributing

You can submit your bug reports or feature requests at: https://github.com/edgarjs/github-repos-alfred-workflow/issues

License

This project is published under the MIT License.

Latest release

  • 4.1.010 months ago, 399 KBDownload

    01bd23a Bump version 4.1.0 99da880 Filter out archived repositories from user repos 998912d Harden shell scripts, fix input sanitization, and improve error handling d2f1f74 Revert "Improve performance by fetching repositories in parallel" d222871 Remove Packal link for download 494b899 Add funding options for Buy Me a Coffee and Thanks.dev 45d595d Improve performance by fetching repositories in parallel

12 earlier releases
  • 4.0.01 year ago, 135 KBDownload

    20e85a2 Rewrite to use the GitHub CLI instead of custom implementation

  • 3.1.35 years ago, 70 KBDownload

    Fixes

    • Typo for personall in gh-login command
    • Correct spelling for GitHub
  • 3.1.25 years ago, 36 KBDownload

    Fixed

    • Fix GitHub spelling
  • 3.1.15 years ago, 138 KBDownload

    Added

    • Insert item to open PRs page

    Fixed

    • Ignore case in fuzzy filters for Repos and PRs
  • 3.1.05 years ago, 36 KBDownload

    Thanks to @ileodo for these changes!

    Added

    • New environment variables to configure the cache TTL more atomically.
    CACHE_TTL_SEC_ORG  default: 86400
    CACHE_TTL_SEC_PR  default: 300
    CACHE_TTL_SEC_REPO default: 86400
    
    • New PR_ALL_INVOLVE_ME environment variable that lets you configure whether you want to see only your PRs or do global searches. (Default: true)
    • New GITHUB_ME_ACCOUNT environment variable that lets you set the account you want to search repos and/or PRs on. (Default is @me)

    Changed

    • Change GITHUB_HOST environment variable default value to www.github.com and use it for web URLs.
    • The API host is now set using the GITHUB_API_HOST environment variable, which defaults to api.github.com.
  • 3.0.05 years ago, 35 KBDownload

    This is a major release because workflow was refactored from scratch for easier maintainability.

    However most of the functionalities stayed the same, there are some new commands like repo and pr.

  • 2.1.46 years ago, 32 KBDownload

    Revert using SSH URL to HTML URL so it can be opened in the browser

  • 2.1.36 years ago, 32 KBDownload
    • Fixes #19 and #24
  • 2.1.16 years ago, 32 KBDownload
  • 2.1.06 years ago, 32 KBDownload
  • 2.0.17 years ago, 31 KBDownload
  • 2.0.07 years ago, 30 KBDownload