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!

  • [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.

  • [BUG] Bad Gateway Body

    [BUG] Bad Gateway Body

    Describe the bug quits with an unexpected Bad Gateway body message from github while "Fetching Pull Requests..."

    2022/08/19 10:39:02 non-200 OK status code: 502 Bad Gateway body: 
    {
       "data": null,
       "errors":[
          {
             "message":"Something went wrong while executing your query.
                       This may be the result of a timeout, or it could
                       be a GitHub bug. Please include `E03D:7A79:100FF87:1F75007:62FFA07B`
                       when reporting this issue."
          }
       ]
    }
    

    ( i took the liberty of formatting the response JSON above so it could be read. )

    It's not obvious to me if this is a GH problem or a result of the quantity of info it'd need to display for me combined with whatever query you're using. It's repeatable (days apart) so I'm inclined to think it's a byproduct of the request causing an overly long processing on their end, which causes a timeout.

    To Reproduce Steps to reproduce the behavior:

    1. be me (sorry) or someone with a LOT of PRs and notifications and whatever else you're pulling.
    2. run gh dash
    3. wait

    Expected behavior not crashing.

    Desktop (please complete the following information):

    • OS: macOS 12.5.1
  • Add PR approval

    Add PR approval

    Is your feature request related to a problem? Please describe. Sometimes when bumping Terraform module versions, I get a bunch of renovate PRs. I would like to quickly approve them from within dash.

    Describe the solution you'd like I would like to add "Approve" as a keybinding like "Merge" (https://github.com/dlvhdr/gh-dash/pull/168). Probably it popups with a message dialog to enter a comment.

    Describe alternatives you've considered Currently I created my own keybinding.

    Additional context I would like to implement it in the context of #hacktoberfest which is just around the corner.

  • Add JSON Schema for config

    Add JSON Schema for config

    Is your feature request related to a problem? Please describe.

    When I'm editing the config, I need to keep the docs open and constantly refer back and forth while I make changes, both to see what keys are available and how to write a valid value.

    Describe the solution you'd like

    With a JSON Schema for the config file, I could tell my editor what schema to use and then get auto-completion, validation, and documentation for the settings in the same context, reducing my cognitive load and making it easier to author and update my configuration(s).

    Describe alternatives you've considered

    I could write my own standalone schema file and keep it locally, but that wouldn't benefit the community and would likely drift from accuracy with each release.

    Additional context

    N/A

  • Allow reponame length configuration

    Allow reponame length configuration

    Is your feature request related to a problem? Please describe. Repo names are now shortened to a fixed number of chars. Would like some control for this.

    Describe the solution you'd like config.yaml option to specify max chars

    Additional context sometimes repo names are not very short

  • [BUG] The keybindings do not work

    [BUG] The keybindings do not work

    Describe the bug

    The keybindings do not work.

    To Reproduce

    Use the following ~/.config/gh-dash/config.yml:

    prSections:
    - title: All
      filters: is:open repo:dlvhdr/gh-dash
    keybindings:
      prs:
        - key: c
          command: cd {{.RepoPath}}; gh pr checkout {{.PrNumber}}
    repoPaths:
      dlvhdr/gh-dash: ~/Desktop/gh-dash
    

    Execute:

    cd ~/Desktop
    gh repo clone dlvhdr/gh-dash
    gh dash
    

    Select any PR and press c. -> Nothing happens.

    Expected behavior

    With the configuration above (which is taken from the readme), pressing c should close gh-dash, cd into the repo directory and check out the pull-request.

    Desktop (please complete the following information):

    • OS: Linux (Manjaro) x64
  • Theme Support for Markdown Reader

    Theme Support for Markdown Reader

    I forgot about the whole markdown renderer colors. [...] I just noticed it doesn't look very good on light themes.

    https://github.com/dlvhdr/gh-dash/blob/d25d8101d5717a4e10ae83c2d33ae8d1fb7a3a08/ui/markdown/theme.go

    Originally posted by @dlvhdr in https://github.com/dlvhdr/gh-dash/pull/146#pullrequestreview-1040997069

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

Aug 2, 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,

Sep 14, 2022
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

Sep 16, 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

Apr 8, 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

Sep 24, 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

Sep 25, 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.

Sep 9, 2022
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

Jun 14, 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

Sep 22, 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

Aug 31, 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

Sep 9, 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

Sep 2, 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