Back to Resources

How to star GitHub gists with gh api

Star and organize useful GitHub Gists directly via GitHub CLI and API. Bookmark reusable snippets, setup scripts, and prompt templates for fast retrieval.

Architecture Flow
flowchart LR
    Gist["View Public / Secret Gist"] --> Star["Click 'Star' Button in Header"]
    Star --> Saved["Gist Added to Personal Starred List"]
    Saved --> View["Browse anytime at gist.github.com/starred"]

Star a gist

From Saving gists with stars:

  1. Navigate to Discover and open the gist you want to star (or open any gist URL).
  2. In the top-right corner of the page, click Star.
  3. Optionally, to remove it later, click Unstar. That drops the gist from your starred list.

View your starred gists

Starring makes it easy to find a gist again. Either:

  • Go directly to https://gist.github.com/YOUR_USERNAME/starred, or
  • Follow the menu path:
  1. Navigate to your gist home page.
  2. In the top right, click your profile picture.
  3. From the dropdown, select Starred gists.

You can also browse recently starred gists from other users on the Gist starred page.

Further reading

FAQ

How do I star a GitHub gist from the command line without opening GitHub in a browser? Run gh api --method PUT /gists//star. This records the gist to your starred list, which you can retrieve anytime via gh api /gists/starred.

Share