Yes, this is a very common problem with putting API calls in prompts! If you run it synchronously, your terminal freezes for a half-second every time you press Enter.
To fix this, we can create a smart wrapper script. The script will:
- Immediately read from a
/tmp/cache file so your prompt is instantaneous (zero lag). - Fetch from GitHub in the background if the cache is missing or older than 24 hours.
- Provide a
--refreshflag so you can manually update it right after opening a new PR.
Here is the complete setup to get this working perfectly: