Using the gh-dash gh CLI Extension to Manage GitHub Notifications
Written towards the goal of sharing my own practice with new team members, the
following offers an overview of how I use the gh-dash
CLI extension to manage
GitHub notifications and pull request discussion.
Problem
At scale, staying abreast of GitHub code review requests, GitHub issues of note, and related discussions is challenging. The challenges are further compounded when working across multiple GitHub organizations on both open and closed source projects, and especially when working as a member of multiple GitHub teams within one or more organizations.
For example:
- differentiating between extra curricular open source projects and employer projects
- differentiating between work associated with different teams within the same project
- differentiating between work on different repositories within the same GitHub organization
- differentiating between open, closed, merged, and draft PRs
- giving priority to employer projects during formal working hours
- keeping up with ongoing code review conversation on my own open pull requests
- keeping up with ongoing code review conversation on my own closed pull requests, if/when comments appear after the PRs have been merged
- getting notified of instances where my or my team’s code review is requested
- keeping up with ongoing conversation following submission of my code review
- discovering instances where I’m mentioned in conversation, but when my review has not been formally requested
- discovering relevant ongoing conversation on others’ closed PRs, after the PRs have been merged
- following important discussion on both open and closed PRs where my review has not been explicitly requested and where I’ve not been explicitly mentioned
- being able to further filter and/or create sub-categorizations of all of the above
(Much of the challenges above mention pull requests, but also apply to GitHub issues. For example, perhaps your employer uses Jira rather than GitHub issues, but your extra curricular open source work is tracked via GitHub issues.)
Solution
Other techniques and tooling exists for managing all this (email, Slack,
GitHub’s in-built notifications UI, etc.), though gh-dash
has been my favorite
for a few years.
gh-dash is a community-maintained extension to the gh CLI. It offers a customizeable terminal dashboard for filtering, sorting, and browsing GitHub pull requests, issues, and surrounding discussion and code reviews.
Installation
After installing the gh CLI,
install the gh-dash
extension via gh extension install
:
gh extension install dlvhdr/gh-dash
Then, launch it via gh dash
:
Features of note
- open, non-draft PRs are displayed in the bold
- draft PRs, merged PRs, or closed PRs (as indicated by their icon) are displayed in non-bold muted text (or hidden entirely, depending on configuration)
- PRs are ordered by activity, so I can keep up with any ongoing discussion on closed and merged PRs
- additional icons represent details like code review status, required status checks, etc.
?
toggles a help panel showinggh-dash
’s supported key commands
A few key command highlights:
r
refreshes the dashboard (refreshes also occur automatically at a configured interval)s
toggles between PR and issue viewsh
andj
navigate horizontally between tabbed categorizations of PRs and issues, within each viewp
toggles a preview window;control d
andcontrol u
scroll the preview panel up and down respectivel.c
allows you to comment directly from your terminal, though I rarely use this.o
opens the PR in your web browsery
copies the PR URL to your pastebinC
checks out the PR branch locallyd
shows the PR diff in your terminalm
merges an approved PR/
allows you to interactively specify more granular search criteria
Customization
Because gh-dash
can be easily customized via a YAML configuration file, its
configuration can also be changed over time to serve ever-evolving team dynamics,
project priorities, and needs. For example, my current configuration can be seen
at github.com/mdb/dotfiles/blob/main/config.yml,
though I’m often tuning this to better serve changing needs and nuance.
See gh-dash documentation for more details.
Related
To learn more about extending the gh
CLI, see Extending the gh CLI with Go.