A GitHub CLI extension that brings The Onion to your terminal. Bundled dataset, zero API dependencies, pure fun.
gh extension install maxbeizer/gh-oniongh onion # Random headline (Onion or real news)
gh onion motd # Headline of the day — add to your .zshrc
gh onion search <term> # Search headlines by keyword
gh onion fresh # Fetch a fresh headline from The Onion's RSS feed$ gh onion
╔══════════════════════════════════════════════════════════╗
║ Study Finds Every Style Of Parenting Produces ║
║ Disturbed, Miserable Adults ║
╚══════════════════════════════════════════════════════════╝
— The Onion
Add to your .zshrc or .bashrc:
gh onion motdOutput:
📰 Today's Headline from America's Finest News Source:
"Study Finds Every Style Of Parenting Produces Disturbed, Miserable Adults"
$ gh onion search florida
Found 4 headline(s) matching "florida":
📰 Florida Man Arrested For Trying To Open Airplane Emergency Exit Mid-Flight
📰 Florida Man Uses Alligator To Shotgun A Beer
📰 69-Year-Old Florida Man Hits Nephew With Pizza Over Prior Pizza Incident
📰 Florida Man Steals Elderly Woman's Purse, Returns It After Finding Bible Inside
gh onion fresh # Requires internetAll commands support --json and --jq flags:
gh onion --json
gh onion search dog --jq .text
gh onion motd --jsonmake help # see all targets
make build # build binary
make test # run tests
make ci # build + vet + test-race
make install-local # install extension from checkout
make relink-local # reinstall after changesThis extension bundles the Onion or Not dataset (~24k headlines) by Chris Filo Finan, licensed under CC BY-SA 4.0. The dataset contains headlines from The Onion and r/NotTheOnion.
Tag a version to trigger a release build:
git tag v0.1.0
git push origin v0.1.0