A beautiful CLI dashboard for GitHub 🚀

gh-dash

✨ A GitHub (gh) CLI extension to display a dashboard with pull requests and issues by filters you care about.

Installation

  1. Install the gh CLI - see the installation

    Installation requires a minimum version (2.0.0) of the the GitHub CLI that supports extensions.

  2. Install this extension:

    gh extension install dlvhdr/gh-dash
  3. To get the icons to render properly you should download and install a Nerd font from https://www.nerdfonts.com/. Then, select that font as your font for the terminal.

Installing Manually

If you want to install this extension manually, follow these steps:

  1. Clone the repo

    # git
    git clone https://github.com/dlvhdr/gh-dash
    
    # GitHub CLI
    gh repo clone dlvhdr/gh-dash
  2. Cd into it

    cd gh-dash
  3. Install it locally

    gh extension install .
🌈 How do I get these exact colors and font?

I'm using Alacritty with the tokyonight theme and the Fira Code Nerd Font. For my full setup check out my dotfiles.

Configuring

Configuration is provided within a config.yml file under the extension's directory (usually ~/.config/gh-dash/)

The default config.yml file contains:

prSections:
  - title: My Pull Requests
    filters: is:open author:@me
  - title: Needs My Review
    filters: is:open review-requested:@me
  - title: Subscribed
    filters: is:open -author:@me repo:cli/cli repo:dlvhdr/gh-dash
    limit: 50 # optional limit per section
issuesSections:
  - title: Created
    filters: is:open author:@me
  - title: Assigned
    filters: is:open assignee:@me
  - title: Subscribed
    filters: is:open -author:@me repo:microsoft/vscode repo:dlvhdr/gh-dash
defaults:
  prsLimit: 20 # global limit
  issuesLimit: 20 # global limit
  preview:
    open: true
    width: 60
repoPaths:
  dlvhdr/gh-dash: ~/code/gh-dash
keybindings: # optional
  prs:
   - key: c
     command: cd {{.RepoPath}}; gh pr checkout {{.PrNumber}}

Adding a PR or issue section is as easy as adding to the list of prSections or issueSections respectively:

  • title - shown in the TUI
  • filters - how the repo's PRs should be filtered - these are plain github filters

Keybindings

Define your own custom keybindings to run bash commands using Go Templates. The available arguments are:

Arguement Description
RepoName The full name of the repo (e.g. dlvhdr/gh-dash)
RepoPath The path to the Repo, using the config.yml repoPaths key to get the mapping
PrNumber The PR number
HeadRefName The PR's remote branch name

For example, to review a PR with either Neovim or VSCode, include this in your config.yml file:

repoPaths:
  dlvhdr/gh-dash: ~/code/gh-dash
keybindings:
  prs:
    - key: c
      command: >
        tmux new-window -c {{.RepoPath}} '
          gh pr checkout {{.PrNumber}} &&
          nvim -c ":DiffviewOpen master...{{.HeadRefName}}"
        '
    - key: v
      command: >
        cd {{.RepoPath}} &&
        code . &&
        gh pr checkout {{.PrNumber}}

Usage

Run:

gh dash

Then press ? for help.

Author

Dolev Hadar [email protected]

Owner
Dolev Hadar
Frontend Developer 🌈
Dolev Hadar
Comments
  • Support checking out PRs

    Support checking out PRs

    This PR adds support for checking out the selected PRs using gh.

    There's room for improvements:

    • Better handling when the current repo is unrelated to the selected PR. Right now there's no handling.
    • Force checkout support.
  • Theme Support

    Theme Support

    Summary

    This PR adds some initial/basic support for user-configurable themes. I didn't want to turn too many things inside out, which is why there's a "shim" function that translates the user's color choices into the currently-used format; the idea being that the default theme ships a combined light + dark mode, but once a user writes their own theme, the complexity of that is unnecessary, as they're writing it for their own terminal, which is either light or dark.

    On top of that, it's possible to set a useShellTheme bool in the config file, which skips custom themes altogether and instead uses the user's shell theme. I'm not sure if it looks good for everyone, perhaps that needs some testing/adjustment and maybe also the same light+dark logic of the default theme.

    In summary, the config file generated on the first run now includes this (these are the colors for a dark terminal, for a light one it'd dump a different set of colors - I "transcribed" the default color scheme):

    theme:
      colors:
        text:
          main: '#E2E1ED'
          secondary: '#666CA6'
          bright: '#E2E1ED'
          subtle: '#242347'
          faint: '#3E4057'
          warning: '#F23D5C'
          success: '#3DF294'
        background:
          selected: '#39386B'
        border:
          main: '#383B5B'
          secondary: '#39386B'
          faint: '#2B2B40'
    

    I've deliberately put everything under a theme.colors sub-key, because looking at the open issues, there's a few things that'd probably fit well into a theme.layout (#107) or theme.options (#111) tree.

    How did you test this change?

    Barely, and I'm new to Go. Opening this as a draft to facilitate discussion about the implementation. When/if everything is agreed on code wise, I'd update the docs in a separate commit. Also looking at base16 to generate a set of themes, license wise gh-dash is compatible with it, but again, don't want to do too much at once.

    Images/Videos

    image

    <making the robots happy> Fixes #102 </making the robots happy>

    If there's anything unclear, ask away, I have trouble articulating myself sometimes! :)

  • Feature request: a way to display the config file location

    Feature request: a way to display the config file location

    Is your feature request related to a problem? Please describe. I've been trying to update my configuration file in ~/.config/prs/config.yml but I keep falling back to the default configuration. I can't tell if it's loading a configuration from somewhere else or if my config file is somehow invalid. I'd be in a much better place if only the application gave me more insight.

    Describe the solution you'd like

    • In case the configuration is invalid, display an error message (and possibly quit).
    • add an option (in the help menu ?) to print the file path from which configuration was loaded.

    Describe alternatives you've considered The configuration path could be always visible ?

    Additional context Add any other context or screenshots about the feature request here.

  • [BUG] gh dash crashes when using Github Enterprise

    [BUG] gh dash crashes when using Github Enterprise

    Describe the bug I have my Github host pointed to my company's enterprise instance. When using gh dash I receive this message 2022/04/01 16:16:38 Message: Field 'creator' doesn't exist on type 'CheckSuite', Locations: [{Line:1 Column:651}] Message: Field 'workflowRun' doesn't exist on type 'CheckSuite', Locations: [{Line:1 Column:666}]

    To Reproduce Steps to reproduce the behavior:

    1. GH config is configured with only the enterprise host
    2. gh dash

    Expected behavior I expected it to work regardless of using Github Enterprise. Screenshots If applicable, add screenshots to help explain your problem.

    Desktop (please complete the following information):

    • OS: MacOS 12.2
    • Shell: Zsh
    • gh version 2.7.0 (2022-03-30)
  • [BUG] Subscribed Tab Doesn't Show Subscribed Repos/PRs

    [BUG] Subscribed Tab Doesn't Show Subscribed Repos/PRs

    Describe the bug

    The "subscribed" tab shows PRs for the gh-dash and cli repos. It doesn't show anything for repos that I am watching.

    To Reproduce Steps to reproduce the behavior:

    1. Go to 'subscribed'
    2. Observe a bunch of irrelevant entries.

    Expected behavior

    Should show PRs or repos that I am actually subscribed to.

    Screenshots

    NA

    Desktop (please complete the following information):

    • Any platform
  • Question: how do I navigate to the Issues?

    Question: how do I navigate to the Issues?

    I see an indicator this is possible in the top right, and I do want to verify I'm rendering it correctly. Something does feel off with the text. But that's besides the point. How do I get there, is the hotkey mentioned in ?

    image

    Cheers! Lovely extension

  • Ignore archived PRs

    Ignore archived PRs

    Resolves #80

    Summary

    Adding archived:false as part of the default GitHub query.

    The current shown PRs include archived PRs that are irrelevant to monitor. The default query should follow the default query on https://github.com/pulls

    is:open is:pr author:<username> archived:false

    is:open author:@me is already covered by the default configuration YAML.

    How did you test this change?

    Compiled and run it locally.

    Images/Videos

    Before (https://github.com/ori-amizur/introspector/pull/30 is archived) Screenshot from 2022-02-03 18-24-28

  • Can the list of repos be optional?

    Can the list of repos be optional?

    It looks like specifying the repos is required from my local testing. i wanted to match the default Github PRs tab with the below snippet, but no PRs were matched

    - title: Created
      filters: author:@me
    - title: Assigned
      filters: assignee:@me
    - title: Mentioned
      filters: mentions:@me
    - title: Reviewed Requested
      filters: review-requested:@me
    

    I confirmed that specifying one or more repos does work though:

    - title: Created
      repos:
        - KyleKing/commitizen
        - timothycrosley/pdocs
      filters: author:@me
    

    I assume this would require pulling a list of repos if the repos list is empty here: https://github.com/dlvhdr/gh-prs/blob/37e60a8409b2ba5c46d52e9ea00d5a94cbaa2d73/ui/section.go#L43

  • Config location

    Config location

    Nice work on this project, loving it! A little gripe I have is the config path however: ~/.config/prs feels a bit generic.

    go-app-paths could come in handy here: https://github.com/muesli/go-app-paths This sticks to the XDG specifications and return "native" paths on Windows/Mac as well. Let me know if I can help with this!

    Keep up the great work!

  • Extending standard GH filters with more pre-/post- filter request logic

    Extending standard GH filters with more pre-/post- filter request logic

    Is your feature request related to a problem? Please describe. I'd really love to see an ability to filter issues that I have approved. That seems that for some reason GH still does not have this filter in the status related. But the gh-dash extension shows the data on approved state from yourself in the PR details, so it's technically possible to separate reviewed-by:@me results into more subgroups (e.g. approved / commented / rejected).

    Currently, my need is to be able to identify the PRs that were reviewed by me, but not approved yet.

    Additionally that can enable relative dates for the date-related search, or lastDay() query for these. Or even filters based on where the issues been reviewed & relative dates on those.

    Describe the solution you'd like For pre- filters: Transform the query on the fly before executing against GH cli. For post- filters: Transform the response from a query to filter into more sub-categories.

    Describe alternatives you've considered Doesn't seem possible with gh dash now, that's somewhat possible with just direct gh cli calls as just requires extra scripting.

    Additional context Here is the case I want to filter out of review-by:@me

    I approved it, but overall the PR is still not fully review:approved state as not all codeowners have approved

    Screen Shot 2022-10-05 at 2 41 15 PM

  • [BUG] Subscribed list is scoped to this repo and cli/cli

    [BUG] Subscribed list is scoped to this repo and cli/cli

    Describe the bug The "Subscribed" tab doesn't show anything relevant to me.

    Looks like the Filter for it is scoped to cli/cli and this repository: https://github.com/dlvhdr/gh-prs/blob/9f9aedad3bd392f990d96b722d4aff9fb893eaac/config/parser.go#L64

    Expected behavior To show issues/PRs that I'm subscribed to.

  • Remap UI keybindings

    Remap UI keybindings

    Is your feature request related to a problem? Please describe. It's a bit of a usability annoyance. I'm used to using Vim so just using the home row is practical. Right now I need to do hand gymnastics to use Ctrl+d and Ctrl+u for navigating the preview bar and find it rather uncomfortable.

    Describe the solution you'd like I'd like to be able to remap those keys in my configuration file so J and K (mind the case) are used instead. Note I'm not 100% sure this isn't currently possible, but going through the README and the source code I couldn't find anything useful.

    Describe alternatives you've considered There aren't many. Essentially it's either hardcoding my preferences (not very considerate to others used to the current workflow) or making it configurable. I'd say the current keybinding section may benefit from some UI action syntax or maybe a new section could be added for the UI interaction.

  • [BUG] Fatals when using Github Enterprise

    [BUG] Fatals when using Github Enterprise

    Describe the bug

    When trying to use my Github Enterprise host, gh dash fatals with this error:

    non-200 OK status code: 401 Unauthorized body: "Invalid IAP credentials: empty token"

    But I believed I'm logged in, and I can't figure out what credentials it's missing.

    • gh auth status shows I'm logged in to my Enterprise host using the https protocol.
    • I've also set a personal access code to GH_ENTERPRISE_TOKEN

    To Reproduce

    1. Login to custom host using gh auth login --hostname git.company.com
    2. Execute GH_HOST=git.company.com gh dash
    3. Opens and immediately errors non-200 OK status code: 401 Unauthorized body: "Invalid IAP credentials: empty token"

    Expected behavior

    GH Dash should launch with my Github Enterprise data

    Desktop (please complete the following information):

    • OS: Mac
  • feat(prs): adds base branch to pr columns

    feat(prs): adds base branch to pr columns

    Summary

    This PR adds the base branch to the list of data present in the PRs list.

    How did you test this change?

    I tested locally to validate that the Base column is present only when the column is unhidden in the config.

    Images/Videos

  • Ask for confirmation before closing PRs

    Ask for confirmation before closing PRs

    Is your feature request related to a problem? Please describe. Hey, very slick tool ✨ Could see this staying open all day every day on my terminal.

    However, in just playing around with it for a couple minutes, I already accidentally closed a pull request of a teammate of mine while in the "needs my review" tab. Pretty awkward.

    Describe the solution you'd like There should be an explicit confirmation action before performing a PR close/open (potentially any state manipulation?) It is just way too easy to accidentally hit x and next thing you know you've closed someone else's PR without meaning to

    Describe alternatives you've considered Disable it altogether via configuration? Personally, there is very little chance I will ever close someone elses PR through my terminal, but that might just be me

    Additional context N/A

  • Feature Request: Automatic refresh

    Feature Request: Automatic refresh

    Is your feature request related to a problem? Please describe. I often have gh-dash open in a terminal on a secondary monitor to keep track of incoming PRs. This doesn't work very well currently, since I have to manually switch over to the window and press r to refresh.

    Describe the solution you'd like I'd love a setting in the config file that makes the currently active tab auto refresh every x seconds:

    defaults:
      autoRefreshInterval: 60
    

    Describe alternatives you've considered Might also consider automatically refreshing on tab change if it's been longer than auto_refresh_interval since you last visited it.

  • feat(pagination): fix #112 Implement pagination for issues section

    feat(pagination): fix #112 Implement pagination for issues section

    This Pr adds the functionality for loading more issues when the cursor reaches the 5th last item in the issues

    This is the inital working draft, if there are no issues with this PR and its implementation will complete the same feature for the PRs section

    How did you test this change?

    On reaching the 5th last issue fetch n more issues (based on issuesLimit value)

    Images/Videos

    default View image

    On reaching/ crossing the 5th last issue load more image

Go-github-actions - `go-github-actions` is a package for developing GitHub Actions

go-github-actions go-github-actions is a package for developing GitHub Actions.

Feb 6, 2022
Multi cluster kubernetes dashboard with batteries included. Build by developers, for developers.

kubetower Multi cluster kubernetes dashboard with batteries included. Built by developers, for developers. Features Restart deployments with one click

Nov 28, 2022
:bento: Highly Configurable Terminal Dashboard for Developers and Creators
:bento: Highly Configurable Terminal Dashboard for Developers and Creators

DevDash is a highly configurable terminal dashboard for developers and creators who want to choose and display the most up-to-date metrics they need,

Jan 3, 2023
Grafana Dashboard Manager

Grafana dash-n-grab Grafana Dash-n-Grab (GDG) -- Dashboard/DataSource Manager. The purpose of this project is to provide an easy to use CLI to interac

Dec 31, 2022
A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instances.

Grafana Dashboard Synchronization Backend Plugin A Grafana backend plugin for automatic synchronization of dashboard between multiple Grafana instance

Dec 23, 2022
Simple Kubernetes real-time dashboard and management.
Simple Kubernetes real-time dashboard and management.

Skooner - Kubernetes Dashboard We are changing our name from k8dash to Skooner! Please bear with us as we update our documentation and codebase to ref

Dec 28, 2022
Kubernetes-native automatic dashboard for Ingress
Kubernetes-native automatic dashboard for Ingress

ingress-dashboard Automatic dashboard generation for Ingress objects. Features: No JS Supports OIDC (Keycloak, Google, Okta, ...) and Basic authorizat

Oct 20, 2022
Exporter your cypress.io dashboard into prometheus Metrics

Cypress.io dashboard Prometheus exporter Prometheus exporter for a project from Cypress.io dashboards, giving the ability to alert, make special opera

Feb 8, 2022
GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.
GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

GitOops is a tool to help attackers and defenders identify lateral movement and privilege escalation paths in GitHub organizations by abusing CI/CD pipelines and GitHub access controls.

Jan 2, 2023
github-actions-merger is github actions that merges pull request with commit message including pull request labels.

github-actions-merger github-actions-merger is github actions that merges pull request with commit message including pull request labels. Usage Write

Dec 7, 2022
A simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app to Docker Hub

go-pipeline-demo A repository containing a simple Go app and GitHub workflow that shows how to use GitHub Actions to test, build and deploy a Go app t

Nov 17, 2021
Go-github-app - Template for building GitHub Apps in Go.

Template for GitHub Apps built with Golang Blog Posts - More Information About This Repo You can find more information about this project/repository a

Dec 25, 2022
Clones github projects into ~/Projects/github/{org}/{repo}

Tidy clone Github cli extension (gh extension) to clone repos into ~/Projects/github/{org}/{repo} on the local filesystem Install gh extension install

Jan 19, 2022
Github billing exporter - Billing exporter for GitHub organizations

GitHub billing exporter Forked From: https://github.com/borisputerka/github_bill

Nov 2, 2022
Github-language-trends - Github trending languages API

Github trending languages API This API provides list of most popular github lang

Feb 15, 2022
Fast, concurrent, streaming access to Amazon S3, including gof3r, a CLI. http://godoc.org/github.com/rlmcpherson/s3gof3r

s3gof3r s3gof3r provides fast, parallelized, pipelined streaming access to Amazon S3. It includes a command-line interface: gof3r. It is optimized for

Dec 26, 2022
GitHub CLI extension for reviewing Dependabot PRs.

gh-dependabot A GitHub CLI extension to quickly review and approve Dependabot PRs. Installation This extension is developed and tested against a minim

Sep 23, 2022
A GitHub CLI extension that provides summary pull request metrics.

gh-metrics A gh extension that provides summary pull request metrics. Usage Metric definitions Influences Usage To install the extension use: $ gh ext

Dec 29, 2022
Alertmanager-cli is a cli writtin in golang to silence alerts in AlertManager

Alertmanager-cli is a cli writtin in golang to silence alerts in AlertManager

Aug 27, 2022