Generate clean GitHub commit reports and turn them into AI-written summaries.
- GitHub reports - Collect commits from GitHub users or organizations
- AI summaries - Send the collected data to OpenAI with your own instruction
- Flexible periods - Use today, last N days, or a specific month/year
- Branch control - Read only the default branch or all branches
- User filtering - Report one target user or everyone in the account
- Structured output - Save JSON files plus a Markdown AI response
- Duplicate protection - Deduplicate commits by SHA across branches
npm installCreate a .env file in the project root:
GITHUB_TOKEN=your_github_token
ORG_NAME=your_org_or_user
TARGET_USER=github_username
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-5-nano
OPENAI_INSTRUCTION=me de uma lista do que foi feito por dia, por linha, em pt br, ignore os merge, deixa assim ex: feat: foi feito tal tal tal. fix: ....Required variables:
GITHUB_TOKEN- GitHub token with access to the target repositoriesORG_NAMEorACCOUNT- GitHub organization or user account
Optional variables:
TARGET_USER- Required unless you run with--all-usersOPENAI_API_KEY- Enables the OpenAI report when used withOPENAI_INSTRUCTIONOPENAI_INSTRUCTION- Instruction used to generate the AI reportOPENAI_MODEL- Defaults togpt-5-nanoOPENAI_OUTPUT_FILE- Custom path for the AI response fileOUT_DIR- Output directory, defaults to./outputMONTH,YEAR,LAST_DAYS,TODAY_ONLYALL_BRANCHES,MAIN_ONLY,ALL_USERSEXCLUDE_BRANCHES- Comma-separated branch patterns to skip (supports*, default:dependabot/*,renovate/*,snyk-*,gh-pages)INCLUDE_BOTS- Set totrueto keep commits authored by bots (ignored by default)MAX_CONCURRENT_REQUESTS- Max simultaneous GitHub requests (default:4; set1for fully sequential). Throttles automatically to 1 when the rate limit gets low, and retries on 403/429/5xx.
Branches whose latest commit is older than the requested period (minus 7 days) are skipped automatically (via the GitHub GraphQL API, falling back to REST if unavailable).
QUIET,NO_RAW
npm startThe default run collects commits for the current month using TARGET_USER and writes JSON files. When OPENAI_API_KEY and OPENAI_INSTRUCTION are configured, it also calls OpenAI and saves the AI response as Markdown.
npm run today:commitsThis command runs npm start -- --all-branches, waits for the report to finish, reads the newest openai_response_*.md, and prints only today's commits, one per line.
# Today's commits
npm start -- --today
# Last 7 days, all users
npm start -- --last-days=7 --all-users
# Current month, all branches
npm start -- --all-branches
# Specific month
npm start -- --month=1 --year=2026
# Custom output directory
npm start -- --today --out-dir=./reports
# Quiet mode without raw GitHub payload
npm start -- --last-days=15 --quiet --no-raw--today- Use only today's commits--last-days=N- Use the last N days, including today--month=MM- Month number from 1 to 12--year=YYYY- Year for monthly reports
Precedence is --today > --last-days > --month/--year.
--main-only- Process only the repository default branch--all-branches- Process every branch--exclude-branches=A,B- Skip branches matching these patterns (empty value disables the filter)--include-bots- Keep commits authored by bots
--all-users- Include commits from all users
Without --all-users, the report only includes TARGET_USER.
--out-dir=PATH- Base output directory--no-raw- Do not save the raw GitHub API payload--quiet- Reduce console logs--helpor-h- Show CLI help
Files are saved under output/YYYY/MM/ by default:
commits_by_day_YYYY_MM.json- Commits grouped by day and repositoryranking_YYYY_MM.json- Commit count by authorraw_commits_YYYY_MM.json- Raw GitHub API commits, unless--no-rawis usedcommits_USER_YYYY_MM.json- Target user commits, whenTARGET_USERis usedopenai_response_YYYY_MM.md- OpenAI-generated report, when OpenAI is configured
Example AI output for a daily report:
## 05/05/2026
- feat: foi criada a integracao com a API da OpenAI.
- fix: foi ajustado o arquivo de saida do resumo.The project uses the OpenAI Responses API and sends a compact JSON payload containing:
- account name
- selected period
- branch and user scope
- commit ranking
- commits grouped by day
- collection statistics
gpt-5-nano is the default model because this workflow is mostly summarization and formatting.
# Type-check the project
npx tsc --noEmit
# Show all CLI options
npm start -- --helpGITHUB_TOKENerrors usually mean the token is missing, expired, or lacks repository access.TARGET_USERis required unless you pass--all-users.OPENAI_API_KEYandOPENAI_INSTRUCTIONare optional, but both are needed to enable the OpenAI step.- Empty reports usually mean no repositories were active in the selected period, or commits are on non-default branches. Try
--all-branches.
Contributions are welcome. Please keep changes focused, run the TypeScript check, and include a short description of the behavior being changed.
MIT
