MAIASS integrates with AI to generate intelligent commit messages based on your code changes. This feature analyzes your git diff and creates contextually appropriate commit messages in various styles.
- Visit AI Platform
- Create an account or sign in
- Navigate to API Keys section
- Create a new API key
- Copy the key (starts with
sk-)
Add your API key to your .env file for your project or globally in ~/.maiass.env:
Only MAIASS_AI_TOKEN is required. Other settings have defaults but can be overridden:
# AI Configuration
MAIASS_AI_MODE=autosuggest
MAIASS_AI_MODEL=gpt-4o
MAIASS_AI_COMMIT_MESSAGE_STYLE=bullet
MAIASS_AI_MAX_CHARACTERS=8000- No AI assistance
- Manual commit message entry only
- Fastest option
- AI asks if you want to use AI to suggest commit messages
- You can approve, edit, or reject suggestions
- Interactive and safe
- Good balance of automation and control
- AI retrieves commit message suggestions automatically
- You can approve, edit, or reject suggestions
- Quickest option if you are not wary about credits
Creates bulleted list format:
• Add user authentication system
• Update login form validation
• Fix password reset functionality
Follows Conventional Commits format:
feat: add user authentication system
- implement JWT token handling
- add login/logout endpoints
- update user model with auth fields
Simple descriptive messages:
Add user authentication system with JWT support
gpt-4o(default) - Latest GPT-4 Omni model, best qualitygpt-4- Standard GPT-4, high qualitygpt-3.5-turbo- Faster and cheaper, good quality
# Use different model
MAIASS_AI_MODEL=gpt-3.5-turbo- Git Diff Analysis: Examines staged changes using
git diff --cached - Context Understanding: Analyzes file types, change patterns, and scope
- Jira Integration: Automatically includes ticket numbers from branch names
- Style Application: Formats message according to selected style
- Interactive Review: Presents suggestion for approval (in
askmode)
AI automatically detects and includes Jira ticket numbers:
# Branch: feature/PROJ-123-user-auth
# AI will include: [PROJ-123] in commit messageAI considers:
- File types: Different approaches for code vs. docs vs. config
- Change scope: Feature additions vs. bug fixes vs. refactoring
- Project structure: Adapts to your repository patterns
- Commit history: Learns from your existing commit style
For complex changes across multiple files, AI provides:
- Grouped changes: Related modifications grouped logically
- Priority ordering: Most important changes listed first
- Cross-file relationships: Understanding of how changes relate
# Set up AI mode
export MAIASS_AI_MODE="ask"
export MAIASS_AI_COMMIT_MESSAGE_STYLE="conventional"
# Run maiass - AI will suggest commit message
maiass patch
# Output:
# 🤖 AI Suggested Commit Message:
# feat: implement user authentication system
#
# - add JWT token handling
# - create login/logout endpoints
# - update user model with auth fields
#
# Accept this message? (y/n/e for edit): # Enable automatic commits (use carefully!)
export MAIASS_AI_MODE="autosuggest"
# AI will commit automatically with generated message
maiass minor"AI API key not found"
- Verify
MAIASS_AI_TOKENis set correctly - Check
.envfile exists and is sourced - Ensure API key starts with
sk-
"API request failed"
- Check internet connectivity
- Verify API key is valid and has credits
- Try a different model (e.g.,
gpt-3.5-turbo)
"No changes to analyze"
- Ensure you have staged changes:
git add . - AI needs git diff to generate messages
Enable debug output to see AI interaction details:
export MAIASS_DEBUG="true"
export MAIASS_VERBOSITY="debug"
maiass patch- Start with
askmode - Get familiar with AI suggestions before usingautosuggest - Review suggestions - AI is helpful but not perfect
- Use appropriate styles -
conventionalfor formal projects,bulletfor internal work - Stage meaningful changes - AI works best with focused, logical changesets
- Monitor API usage - AI charges per token, consider costs for heavy usage
- Code analysis: Only git diff is sent to AI, not full source code
- API key security: Store in
.envfiles, never commit to repositories - Local processing: All git operations remain local
- No data retention: AI doesn't store your code diffs (per their API policy)