gh-news
GitHub notifications TUI built with Rust and ratatui.
Installation
Build from source:
Or install with cargo:
Setup
You need a GitHub token. The app looks for it in this order:
GH_TOKENenv varGITHUB_TOKENenv var- Your
ghCLI config at~/.config/gh/hosts.yml(or$XDG_CONFIG_HOME/gh/hosts.yml)
Easiest way is to just run gh auth login if you have the GitHub CLI installed. Otherwise set GH_TOKEN to your personal access token.
Usage
Just run it:
Options
-a, --all- Show all notifications (not just unread)-c, --config <PATH>- Use a custom config file instead of the default-f, --filter <PATTERN>- Only show notifications matching this regex-n, --max-notifications <N>- Limit how many to fetch-p, --participating- Only show notifications where you're participating/mentioned-r, --mark-read- Mark all notifications as read (non-interactive)-s, --static-display- Print notifications and exit (for scripts)
Examples
Filter to specific repos:
Only things you're involved in:
Mark everything read:
Static output for scripts:
|
Keybindings
Enter- View detailsTab- Toggle previewCtrl+R- ReloadCtrl+T- Mark as readCtrl+A- Mark all as readCtrl+B- Open in browserCtrl+D- View diffCtrl+F- View patchCtrl+W- Mark doneCtrl+X- CommentCtrl+Y- Toggle stateBacktab- Resize preview?- Help
Configuration
gh-news can be configured via a TOML file at ~/.config/gh-news/config.toml. All options are optional and have sensible defaults. CLI flags take precedence over config file settings.
Example Config
# API & Network
= 300 # seconds, 0 to disable
= 30 # seconds
= 100 # limit notifications fetched
= 50 # notifications per API page
# Default filters (same as CLI flags)
= false # show read notifications (like --all)
= false # only participating (like --participating)
= "" # regex filter always applied
# Display
= "vertical" # "off", "horizontal", or "vertical"
= false # start with repos collapsed
# External commands
= "" # custom browser, e.g. "firefox" (uses system default if empty)
# Notification hooks
= "" # command to run when new notifications appear
# GitHub Enterprise (optional)
= "github.com" # change for GHE, e.g. "github.mycompany.com"
Notification Hooks
Run a custom command when new notifications appear during auto-refresh:
= "/path/to/your/script.sh"
The command runs once per new notification with these environment variables:
| Variable | Description |
|---|---|
GH_NEWS_ID |
Notification ID |
GH_NEWS_TITLE |
Notification title |
GH_NEWS_REPO |
Repository name |
GH_NEWS_OWNER |
Repository owner |
GH_NEWS_TYPE |
Type (Issue, PullRequest, Discussion, etc.) |
GH_NEWS_REASON |
Reason (mention, review_requested, comment, etc.) |
GH_NEWS_URL |
Web URL (if available) |
GH_NEWS_UNREAD |
Read status (true/false) |
GH_NEWS_UPDATED_AT |
ISO 8601 timestamp (if available) |
Example: Desktop notification (Linux)
#!/bin/bash
Example: Sound alert
= "paplay /usr/share/sounds/freedesktop/stereo/message.oga"
Example: Conditional action
#!/bin/bash
if [; then
fi
Note: For commands with complex arguments or shell features, use a wrapper script.
Environment Variables
GH_TOKEN- GitHub personal access token (takes precedence overGITHUB_TOKEN)GITHUB_TOKEN- GitHub personal access token (fallback ifGH_TOKENnot set)GH_NEWS_AUTO_REFRESH_INTERVAL- Auto-refresh interval in seconds (default: 300). Set to 0 to disable.