gh cli extension to display a dashboard of PRs - configurable with a beautiful UI.

gh-prs

A gh cli extension to display a dashboard with pull requests by filters you care about.

demo

Installation

Installation requires a minimum version (2.0.0) of the the Github CLI to support extensions.

  1. Install the gh cli - see the installation/upgrade instructions

  2. Install this extension:

gh extension install dlvhdr/gh-prs

Installing Manually

if you want to install this extension manually, do these steps:

  1. clone repo

    # git
    git clone https://github.com/dlvhdr/gh-prs
    
    # github cli
    gh repo clone dlvhdr/gh-prs
  2. cd to it

    cd gh-prs
  3. install it locally

    gh extension install .

Configuring

Configuration is provided within a sections.yml file under the extension's directory. If the configuration file is missing, a prompt to create it will be displayed when running gh prs.

Each section is defined by a top level array item and has the following properties:

  • title - shown in the TUI
  • repos - a list of repos to enumerate
  • filters - how the repo's PRs should be filtered - these are plain github filters

Example sections.yml file:

- title: My Pull Requests
  repos:
    - dlvhdr/gh-prs
  filters: author:@me
- title: Needs My Review
  repos:
    - dlvhdr/gh-prs
  filters: review-requested:@me
- title: Subscribed
  repos:
    - cli/cli
    - charmbracelet/glamour
    - charmbracelet/lipgloss
  filters: -author:@me

Usage

Run:

gh prs

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

a gh extension that prints out an oblique strategy

gh-oblique being a gh extension that prints one of the oblique strategies install gh extension install vilmibm/gh-oblique run $ gh oblique Be dirty.

Dec 13, 2022
Merge some files in a path with custom extension in golang
Merge some files in a path with custom extension in golang

goMerge Merge some files in a path with custom extension in golang Feature Walk in a path with a goroutine using parallelism Merge files with custom e

Apr 26, 2022
gsheet is a CLI tool (and Golang package) for piping csv data to and from Google Sheets

gsheet Table of Contents Introduction Why? Installation Authentication and Authorization What about OAuth authentication? CLI Usage Sheet commands Dri

Nov 15, 2022
Year-end-review - enables those want to look back on PRs at the end of year to review PRs and the comments as single Markdown file.

year-end-review year-end-review enables those want to look back on PRs at the end of year to review PRs and the comments as single Markdown file. HOW

Dec 31, 2021
A beautiful CLI dashboard for GitHub 🚀
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 Install the gh CLI

Dec 30, 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
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint

revive Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. Revive provides a framework for developme

Jan 3, 2023
Hajimari is a beautiful & customizable browser startpage/dashboard with Kubernetes application discovery.
Hajimari is a beautiful & customizable browser startpage/dashboard with Kubernetes application discovery.

Hajimari ?? ...The beginning of a pleasant experience Features Web search bar Dynamically list apps discovered from Kubernetes ingresses Support for n

Jan 4, 2023
Github-workflow-dashboard - WEB and CLI dashboard for github action workflows
Github-workflow-dashboard - WEB and CLI dashboard for github action workflows

CLI capable of retrieving github action workflows stats Example usage Dashboard

Aug 30, 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
Terraform-grafana-dashboard - Grafana dashboard Terraform module

terraform-grafana-dashboard terraform-grafana-dashboard for project Requirements

May 2, 2022
Just a simple CLI tool to group dependabot PRs by dependency and merge them.
Just a simple CLI tool to group dependabot PRs by dependency and merge them.

Dependabotbot Have you been the victim of a lodash update? Has your notification page in Github been assaulted by needing to update a patch version of

Jun 30, 2022
Experimental go cli tool to track your open issues and PRs.
Experimental go cli tool to track your open issues and PRs.

git-sum cli tool See open issue and pull request counts for each repository of the user. Installation go install github.com/suadev/git-sum@latest Usa

Jan 21, 2022
a fast changelog generator sourced from PRs and Issues

chronicle A fast changelog generator that sources changes from GitHub PRs and issues, organized by labels. chronicle --since-tag v0.16.0 chronicle --s

Nov 19, 2022
This is a brief tutorial I created for a couple friends to show how to do some stuff in go and ethereum. Feel free to do any PRs with suggestions

golang-tutorial This is a brief tutorial I created for a couple friends to show how to do some stuff in Go and Ethereum. Milestones Create the environ

Aug 29, 2022
Snitch - a Slack bot that fetches pending review PRs built in Go
Snitch - a Slack bot that fetches pending review PRs built in Go

Snitch Snitch is a Slack bot that fetches and publish PRs with pendings reviews

Nov 29, 2022
Bot to automatically approve Bitbucket Server PRs

renovate-approve-bot-bitbucket-server Introduction This is a small application, similar to renovatebot/renovate-approve-bot-bitbucket-cloud to automat

Nov 2, 2022
A golang CLI to display various stats about Hockey teams and their players

A golang CLI to display various stats about Hockey teams and their players

Oct 26, 2021
A CLI tool to display all dependencies or dependents of an object in a Kubernetes cluster.

kube-lineage A CLI tool to display all dependencies or dependents of an object in a Kubernetes cluster. Usage $ kube-lineage clusterrole system:metric

Jan 5, 2023
A CLI to adjust display brightness using xrandr. Made because Ubuntu desktop was baking my eyeballs in low light.

bright This is a simple program to set monitor brightness using xrandr. I made this because Ubuntu does not come with a built-in way to change monitor

Jan 15, 2022