Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
NickCirvPublic archive

About

Fortune cookie wisdom after every git commit. Install as a post-commit hook.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🥠 commit-fortune-cookie

npm version License: MIT Node.js Zero Dependencies

╭───────────────────────────────────────╮
│      🥠 COMMIT FORTUNE COOKIE 🥠      │
╰───────────────────────────────────────╯

  Commit: "fix: resolve null check in auth"
  Type:   Bug Fix

  ┌───────────────────────────────────────┐
  │                                       │
  │  "The bug you fixed today was         │
  │   planted by yesterday's you."        │
  │                                       │
  │  Lucky number:   42                   │
  │  Lucky language: Rust                 │
  │  Lucky command:  git reflog           │
  │                                       │
  └───────────────────────────────────────┘

Fortune cookie wisdom for your git commits. Zero dependencies. Pure Node.js.

Install

npm install -g commit-fortune-cookie

Or run without installing:

npx commit-fortune-cookie

Usage

# Fortune for your latest commit
commit-fortune-cookie

# Fortunes for the last 5 commits
commit-fortune-cookie --last 5

# Random fortune, no git repo needed
commit-fortune-cookie --wisdom

# Print a post-commit hook script
commit-fortune-cookie --hook

# Help
commit-fortune-cookie --help

Auto-fortune after every commit (git hook)

commit-fortune-cookie --hook > .git/hooks/post-commit
chmod +x .git/hooks/post-commit

Now every git commit gives you a fortune automatically.

Supported commit types

Type Detected from
Bug Fix fix:, bug:, hotfix:, patch:
New Feature feat:, feature:, add:
Refactor refactor:, perf:, cleanup:
Documentation docs:, doc:, readme:
Testing test:, tests:, spec:
Merge Commits starting with Merge
Revert revert:, commits starting with Revert
Chore chore:, style:, lint:, ci:, build:
Work in Progress wip:, WIP, anything else

Works with conventional commits and non-conventional commits alike.

Deterministic fortunes

Same commit hash = same fortune, every time. No randomness — your fortune is baked into the commit.

--wisdom mode uses Date.now() so it's always fresh.

Example outputs

After a bug fix:

  Commit: "fix: stop the bleeding in checkout flow"
  Type:   Bug Fix

  "A fix without a test is a wish without a plan."

After a feature:

  Commit: "feat: dark mode for dashboard"
  Type:   New Feature

  "Today's feature is tomorrow's legacy code."

After a merge:

  Commit: "Merge pull request #42 from feature/auth"
  Type:   Merge

  "Two branches become one. Peace was never an option."

Requirements

  • Node.js 14+
  • git (for commit-based fortunes; --wisdom works without git)

You might also like

License

MIT

Contributing

PRs welcome! If you have a funny idea or improvement:

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/amazing-idea)
  3. Commit your changes
  4. Push to the branch (git push origin feature/amazing-idea)
  5. Open a Pull Request

Found a bug? Open an issue.


If this made you mass-exhale through your nose, mass-hit that star button.

About

Fortune cookie wisdom after every git commit. Install as a post-commit hook.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages