How enthonydev/our-commit works
OUR COMMIT is a TypeScript CLI that turns staged Git changes into a Conventional Commits suggestion using a selected AI provider. The main workflow reads the staged diff and file names, truncates oversized diffs, builds a Portuguese or English prompt, requests generated text, and displays it; only --apply triggers git commit. The README documents both provider options and these user-facing behaviors. Source excerpts show the CLI orchestration and provider calls; edges are limited to those relationships.
Main entry points: index.ts Commit CLI · llmProvider.ts Provider adapter · gitDiff.ts Staged changes · promptBuilder.ts Prompt builder
Components 8
CLI orchestration
- Commit CLI
src/index.ts
Change context
- Staged changes
src/gitDiff.ts - Prompt builder
src/promptBuilder.ts
Message generation
- Provider adapter
src/llmProvider.ts
Other components
- Developer
- Anthropic API
- OpenAI API
- Git
Connections 10
- Developer → Commit CLI: runs
README.md - Commit CLI → Staged changes: reads staging
src/index.ts - Staged changes → Git: reads diff
src/gitDiff.ts - Commit CLI → Prompt builder: builds prompt
src/index.ts - Prompt builder → Commit CLI: returns prompt
src/index.ts - Commit CLI → Provider adapter: requests text
src/index.ts - Provider adapter → Anthropic API: calls when selected
src/llmProvider.ts - Provider adapter → OpenAI API: calls when selected
src/llmProvider.ts - Commit CLI → Developer: shows suggestion
src/index.ts - Commit CLI → Git: commits on apply
src/index.ts