Jump to content

Recommended Posts

Posted

See the GitHub repo for a full reference and demo video:

https://github.com/robfalken/github-workflow-for-alfred

Features

  • List repositories (cached locally for faster listing)
    • Browse to repo on GitHub
    • List issues for a repo
      • Browse to issue on Github
      • Copy issue number to clipboard
    • List pull requests (PR) for a repo
      • Browse to PR on Github
      • Copy PR number to clipboard
      • List diff/files for a PR
        • Browse to diff on GitHub
      • List commits for PR
        • Browse to commit on GitHub
        • Copy commit SHA to clipboard

Configuration

The only configuration needed is to provide a personal access token with access to read your repos.

Usage

The gh keyword will list your repos from cache, if it exists.
If there is no cache, repositories will be fetched from GitHub and cached for later.

To refresh the cache with an updated list of repos from GitHub, use gh refresh

General principles

Holding Cmd and Opt will alter the behaviour to list items related to the current item instead of viewing the actual item.

For instance, holding Cmd for a repo will alter the behaviour to viewing PRs in the repo, rather than browsing the repo itself on github.com, while holding Opt will browse to issues in the repo.

Simultaneously holding down Shift will list related items in Alfred instead of launching the browser. So, pressing Return while holding Shift+Cmd will fetch a list of pull requests for the repo and list them in Alfred

Holding down Ctrl, on the other hand, will copy the most suitable representation of the current item to the clipboard. For instance, holding Ctrl while selecting a commit, will copy the commit SHA to the clipboard.

When pressing the modifier keys, the icon and description will change to describe the new behavour to make it easier to discover features.

Reference

Repositories

  • Return opens a browser window with the repo on GitHub
  • Ctrl+Return copies organization/repository to clipboard
  • Cmd+Return opens a browser window with the repos pull requests on GitHub
  • Opt+Return opens a browser window with the repos issues on GitHub
  • Cmd+Shift+Return list the repos pull requests in Alfred
  • Opt+Shift+Return list the repos issues in Alfred

Pull requests

  • Return opens a browser window with the PR on GitHub
  • Ctrl+Return copies the PR number to clipboard
  • Cmd+Return opens a browser window with the PR diff on GitHub
  • Opt+Return opens a browser window with the PR commits on GitHub
  • Cmd+Shift+Return list the PR changed files in Alfred
  • Opt+Shift+Return list the PR commits in Alfred

Issues

  • Return opens a browser window with the issue on GitHub
  • Ctrl+Return copies the issue number to clipboard

Commits

  • Return opens a browser window with the commit on GitHub
  • Ctrl+Return copies the commit SHA to clipboard
  • Return opens a browser window with the file on GitHub
  • Ctrl+Return copies the file path to clipboard
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...