suggest
The suggest command generates AI-powered commit message suggestions based on your staged changes, helping you create clear, consistent, and professional commit messages.
Usage
Description
This command analyzes your staged Git changes and generates a conventional commit message suggestion that follows best practices. When used with Git hooks, it can automatically pre-fill your commit message template.
Options
| Option | Description |
|---|---|
--history, -n |
Number of recent commits to analyze for context (default: 10) |
--full-diff, -f |
Include the full diff instead of a summary for better (but slower) suggestions |
--interactive, -i |
Enable interactive mode to approve/reject suggestions |
--file, -F |
Path to commit message file (for Git hooks) |
--quiet, -q |
Output only the message without UI elements (for scripts) |
Examples
Basic Usage
With More Context
Detailed Analysis
Git Integration
# Pipe directly to Git commit
noidea suggest | git commit -F-
# Use with Git hooks
# This happens automatically if you've run 'noidea init'
git config noidea.suggest true
How It Works
- Analysis: The command extracts your staged changes and recent commit history
- Context Building: It builds context about your repository's commit style
- AI Processing: The staged diff is analyzed by an AI model
- Suggestion: A conventional commit message is suggested, typically following the format:
Common Types
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code changes that neither fix bugs nor add featurestest: Adding or fixing testschore: Maintenance tasks, dependencies, etc.
Tips
- Stage only related changes in a single commit for better suggestions
- Use
--full-diffwhen you need more detailed analysis - For complex changes, review and edit the suggestion as needed