A small Node.js/TypeScript CLI that prints random developer jokes from a local JSON database. The README can be automatically updated on a schedule with a rotating joke via GitHub Actions.
- Random joke output from a curated dataset (
jokes.json) - Category filtering (
--category) and keyword search (--search) - Joke statistics (
--stats) and category listing (--list) - Optional colored output themes (
--color)
- Node.js 18+ (Node 20 recommended)
npm install
npm run build
npx dev-joke-botnpx dev-joke-bot [options]Options:
--helpShow the help menu--listList all available categories--statsShow joke statistics--category <name>Get a joke from a specific category--search <keyword>Search jokes by text or tag--count <n>Print multiple random jokes--color <theme>Set output theme (pastel,rainbow,mind,retro)--readmeOutput a plain Markdown snippet (for CI/README updates)
Examples:
npx dev-joke-bot
npx dev-joke-bot --category Git
npx dev-joke-bot --search database --color rainbow
npx dev-joke-bot --count 3This section is updated by .github/workflows/update-joke.yml on a schedule (every 12 hours, UTC).
Category: Testing
I don't always test my code, but when I do, I do it in production.
Add entries to jokes.json:
{
"text": "Your joke here",
"category": "General",
"tags": ["tag1", "tag2"]
}Guidelines:
- Keep content developer/programming-related
- Use an existing category or add a new one consistently
- Add 1–3 relevant tags to improve search
- Keep it respectful and inclusive
.
├── bin/ # CLI entry point
├── src/ # TypeScript source
├── dist/ # Compiled JavaScript (generated)
├── jokes.json # Joke database
└── .github/workflows/ # Automation (README updates)
- Add
npm testcoverage and CI checks (lint, typecheck, tests) - Add a formatter/linter setup (Prettier/ESLint) for consistent style
- Add a release workflow (changelog + versioning) if publishing to npm
- Add a
--seedoption for reproducible output (useful for demos/CI)
MIT