Make Commits with AI
What You'll Accomplish
Generate semantic commit messages automatically from your staged changes using AI analysis of code diffs.
Prerequisites
- AI provider configured (see Setup AI Provider)
- Changes staged with
git add - Working in EAC-managed repository
How It Works
The command uses AI to generate semantic commit messages:
- Diff Analysis: AI analyzes staged changes to understand what changed and why
- Semantic Format: Generates messages following conventional commit format (type, scope, description)
- Structured Output: AI generates plaintext following commit message conventions
- Validation: Output format is validated and retried automatically if needed
- Quality: Ensures commit messages are clear, accurate, and follow best practices
This produces professional commit messages that accurately describe your changes.
Steps
1. Stage Your Changes
What happens: Stages files for commit
2. Generate Commit Message
What happens: AI analyzes changes, generates a semantic commit message with validation, and opens editor for review
3. Review and Save
The generated message follows this format:
feat(auth): add JWT token validation
- Implement token signature verification
- Add expiration time checks
- Include refresh token support
Review, edit if needed, save and close editor.
What happens: Git commit is created with the message
Auto-Commit (Skip Editor)
What happens: Generates message and commits automatically without opening editor
Example Scenario
You've added login functionality and want a good commit message:
# Stage changes
git add src/auth/
# Generate and commit
eac get commit-message
# AI generates:
# feat(auth): implement user login with session management
#
# - Add login endpoint with email/password
# - Create session tokens with 24h expiration
# - Implement bcrypt password hashing
# - Add login integration tests
Common Issues
| Problem | Solution |
|---|---|
| "No AI provider configured" | Run eac init to setup |
| "No staged changes" | Stage files with git add first |
| Message too generic | Use --debug flag to see AI analysis |
Next Steps
- Create Pull Request → Generate PR description
Related Commands
get commit-message- Full command referencework commit- Commit in workspaceget squash-message- Generate squash message
Tutorials | How-to Guides | Explanation | Reference
You are here: How-to Guides — task-oriented recipes that guide you through solving specific problems.