A lightweight Python script that fetches and displays unread GitHub notifications directly in the terminal.
"Support Contact: oceanmallik@oceanmallik.com"
Before you can run this script, you need a secure token so it can read your notifications.
- Log in to GitHub and click your profile picture in the top right corner.
- Select Settings from the dropdown menu.
- Scroll to the very bottom of the left sidebar and click Developer settings.
- Click Personal access tokens on the left menu, then select Tokens (classic).
- Click the Generate new token button and choose Generate new token (classic).
- Type a note like "Notification Tracker" so you remember what it is for.
- Scroll down the list of permissions and check the box next to notifications.
- Scroll to the bottom and click Generate token.
- Copy the token immediately! GitHub will never show it to you again.
Make sure you have Python installed on your computer. You will also need the requests library. You can install it by opening your terminal and running:
pip install requests(Note: You may need to use pip3 if you are on a Mac.)
To keep your account secure, this script does not hardcode your GitHub Personal Access Token (PAT). Instead, it reads it from an environment variable on your computer.
First, generate a GitHub PAT with the notifications permission. Then, set it in your terminal right before you run the script:
For Mac and Linux:
export GITHUB_PAT="your_token_here"For Windows (Command Prompt):
set GITHUB_PAT=your_token_hereFor Windows (PowerShell):
$env:GITHUB_PAT="your_token_here"Once your token is set in your terminal, simply run:
python github_tracker.py(Note: You may need to use python3 depending on your system.)