How mr-ezo949/aicommits works
aicommits is a CLI that turns staged Git changes into validated Conventional Commit messages. Its main workflow reads staged paths and diffs, filters and truncates model context, checks for secrets, generates and validates a message, then offers regeneration, commit, copy, or dry-run. Repository rules and recent commit subjects provide optional local context. The sampled source shows the CLI orchestrating these stages and the Groq provider; some wiring for README-documented features is inferred only where the CLI excerpt is incomplete, so uncertain links are omitted.
Main entry points: cli.ts CLI orchestrator · generation.ts Generation retries · groq.ts Groq provider · git.ts Git operations
Components 13
CLI workflow
- CLI orchestrator
src/cli.ts - Option parsing
src/cli/options.ts
Change context
- Git operations
src/cli/git.ts - Diff filtering
src/cli/payload.ts - Saved repo rules
src/cli/git.ts
Message generation
- Generation retries
src/cli/generation.ts - Commit validation
src/cli/commitMessage.ts
External integrations
- Groq provider
src/providers/groq.ts - Provider interface
src/providers/types.ts
Other components
- CLI user
- Git repository
- Groq API
- System clipboard
Connections 14
- CLI user → CLI orchestrator: runs CLI
- CLI orchestrator → Option parsing: parses arguments
- CLI orchestrator → Git operations: reads staged changes
- Git operations → Git repository: queries Git
- CLI orchestrator → Saved repo rules: loads or saves
- Saved repo rules → Git repository: stores under .git
- CLI orchestrator → Diff filtering: builds model context
- CLI orchestrator → Generation retries: requests message
- Generation retries → Groq provider: generates candidate
- Generation retries → Commit validation: validates output
- Groq provider → Provider interface: implements
- Groq provider → Groq API: requests completion
- CLI orchestrator → Git repository: commits accepted message
- CLI orchestrator → System clipboard: copies message