Live demo: https://demo.garbanzobot.com | Docker Hub: https://hub.docker.com/r/jjhickman/garbanzo
Thanks for your interest in contributing! Garbanzo is a community WhatsApp bot built for a Boston-area meetup group, but the codebase is designed to be adaptable for any community.
By contributing to this repository, you agree that your contributions will be licensed under the project license in LICENSE.
- Fork the repository
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/garbanzo-bot.git - Install dependencies:
npm install - Copy
.env.exampleto.envand add your API keys - Run the test suite:
npm test
npm run dev # Hot-reload development (requires WhatsApp auth)
npm run typecheck # Type-check only
npm run test # Run all tests
npm run check # Full pre-commit check (typecheck + lint + test)
npm run gh:status # Show authenticated GitHub accounts
npm run gh:ensure # Verify owner + author accounts exist locally
npm run gh:dependabot # List open Dependabot PRs targeting mainAlways run npm run check before submitting a PR.
- TypeScript strict mode — no
any, no implicit returns - ES Modules —
import/export, neverrequire() - Zod for runtime validation of external inputs
- Pino for logging — never
console.log - Functional composition — prefer pure functions over classes
- Naming:
camelCasefunctions/vars,PascalCasetypes,SCREAMING_SNAKEconstants - Files:
kebab-case.ts, one concern per file, max ~300 lines
Each feature lives in its own file under src/features/:
- Create
src/features/your-feature.ts - Add bang command(s) to
BANG_COMMANDSinsrc/features/router.ts - Add natural language patterns to
FEATURE_PATTERNSif appropriate - Wire into core routing:
- DM / generic routing:
src/core/response-router.ts - Group-only flows (polls, attachments, richer interactions):
src/core/process-group-message.ts - Platform-specific preprocessing (mentions/media/etc.):
src/platforms/<platform>/*
- DM / generic routing:
- Write tests in
tests/ - Update
src/features/help.tswith the new command(s)
Follow the format: type: short description
Types: feat, fix, refactor, docs, test, chore
Examples:
feat: add weather commandfix: handle empty message bodydocs: update ROADMAP with Phase 3 status
Use separate accounts to keep review discipline consistent:
garbanzo-dev: opens and updates PRs (author role)jjhickman: reviews/approves/merges (owner role)
Switch accounts with helper scripts:
npm run gh:switch:author
npm run gh:switch:owner
npm run gh:whoamiMonthly rotation reminders are automated via .github/workflows/credential-rotation-reminder.yml.
To push newly rotated provider keys into GitHub Actions secrets from local env vars:
OPENAI_API_KEY=... OPENROUTER_API_KEY=... ANTHROPIC_API_KEY=... npm run rotate:gh-secrets- Bug fixes (check Issues)
- New feature commands (propose in an Issue first)
- Test coverage improvements
- Documentation improvements
- Locale adaptations (see README for customization guide)
- Changes to
config/groups.jsongroup IDs (those are instance-specific) - API keys or secrets in any file
- Autonomous agent behaviors (scheduled messages, proactive outreach) without discussion
- Dependencies without discussion in an Issue first
All tests use Vitest with mocked external services (no real API calls):
npm test # All tests
npx vitest run tests/features.test.ts # Specific file
npm run test:watch # Watch modeOpen an Issue or reach out to the maintainer.