Searching
Searching
Section titled “Searching”Searching for prs and issues is done by defining sections and their filters. Search filters are defined using GitHub search filters.
For example, this section, shows open PRs authored by anyone but me, which were updated in the last 2 weeks.
prsSections: - title: Review filter: >- is:open -author:@me updated>={{ nowModify "-2w" }}Note: don’t specify is:pr for this setting. The dashboard always adds that filter for PR
sections.
You can define any combination of search filters. To make it easier to read and maintain
your filters, we recommend using the >- syntax after the filter key and writing one
filter per line.
For more information about writing filters for searching GitHub, see Searching issues and pull requests.
Search Templates
Section titled “Search Templates”In addition to GitHub’s filters, gh-dash adds templating functions.
nowModify
Section titled “nowModify”The nowModify function helps you calculate relative dates in the ISO-8601 format (which is what GitHub expects).
Given the date today is 2025-02-02, a search filter of updated>={{ nowModify "-1mo" }} will output updated>=2025-01-02.
A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as 1w, -8h or 1mo2w.
The available units are:
- Go’s builtin durations -
ns,us(orµs),ms,s,m,h - Additionally:
d/Dfor daysw/Wfor weeksM/mofor monthsy/Yfor years
Smart Filtering
Section titled “Smart Filtering”By default, if the directory you launch dash from is a clone of a remote GitHub repo (or if you
have the GH_REPO environment variable set to a particular remote), then for any of your PR
sections and issue sections with filters values in your configuration that don’t
have an explicit repo: field, dash adds a repo:<RepoName> field to the search-bar value for
them (where <RepoName> is the name of the remote repo).
That is, dash further filters those sections down to only the PRs/issues for the GitHub
repo name specified in your GH_REPO environment variable — or else the repo name of the remote
tracked by the clone directory from which dash launched.
For that, dash first checks and uses the repo name in the GH_REPO environment variable (if
you have that set). If dash doesn’t find that, then it next checks for the value of the remote
repo name tracked by the clone directory from which you launched dash — by looking through all
GitHub remotes configured for that clone in the following order:
upstreamgithuborigin
…and, otherwise, if dash finds no remotes with any of those names, then it uses the repo name
for the first remote in the output that git remote shows.
To disable Smart Filtering at launch, set smartFilteringAtLaunch to false in your configuration.
smartFilteringAtLaunch: falseTo toggle Smart Filtering on or off for the current section you’re currently viewing, either use the
t key — or else use whatever custom keybinding you have set for the togglesearch builtin in the
keybindings section of your configuration.