How it works & CI usage¶
Pipeline¶
- Collect —
git logwith a delimited format, parsed into commit objects (collectCommits/parseGitLog). - Classify — each subject is parsed as a Conventional Commit (
type,scope,!/BREAKING CHANGE), falling back toother. - Group — commits are bucketed by type in a fixed display order, with breaking changes collected separately.
- Render — either a deterministic markdown template, or an LLM prompt built from the grouped commits and sent to Ollama.
The grouping happens before the LLM, so the model rewrites a clean, categorized list rather than raw commits — cheaper, more reliable, and it can't hallucinate features.
Use in CI (template mode, no LLM)¶
# .github/workflows/release.yml (excerpt)
- run: npx gitscribe "${{ github.event.release.tag_name }}"~1.."${{ github.event.release.tag_name }}" \
--version "${{ github.event.release.tag_name }}" > NOTES.md
- run: gh release edit "${{ github.event.release.tag_name }}" --notes-file NOTES.md
Template mode is deterministic and dependency-free, so it's ideal for CI. Reserve
--model for local runs where Ollama is available.
Library API¶
collectCommits(range?)/parseGitLog(raw)— read/parse commits.groupCommits(commits)—{ breaking, sections }.renderMarkdown(commits, { version, date })— offline markdown.generateReleaseNotes(commits, { version, llm })— template or LLM.