commit command generates intelligent git commit messages based on your staged changes using AI, with built-in security scanning to prevent accidental exposure of sensitive data.
Quick Start

Usage
Full Auto Mode (Recommended)
- Auto-stage all changes (
git add -A) - Security scan for sensitive content (API keys, passwords, secrets)
- Generate AI commit message from diff
- Commit with the generated message
- Push to remote repository
Interactive Mode
Commit and Push (Interactive)
Workflow
- Stage Changes: Use
git addto stage your changes - Run Command: Execute
praisonai commit - Review Message: AI generates a commit message based on the diff
- Choose Action:
y- Accept and commite- Edit the message in your default editorn- Cancel
Commit Message Format
The AI follows the Conventional Commits specification:Types
| Type | Description |
|---|---|
feat | A new feature |
fix | A bug fix |
docs | Documentation changes |
style | Code style changes (formatting, etc.) |
refactor | Code refactoring |
test | Adding or updating tests |
chore | Maintenance tasks |
Examples
Options
| Option | Description |
|---|---|
-a, --auto | Full auto mode: stage all, security check, commit, and push |
--push | Automatically push after committing (interactive mode) |
--no-verify | Skip security check (use with caution) |
Security Scanning
The commit command includes built-in security scanning to prevent accidental exposure of sensitive data.Detected Patterns
API Keys & Tokens
API Keys & Tokens
- API keys (
api_key,apikey) - Secret keys (
secret_key,secretkey) - Access tokens (
access_token,accesstoken) - Auth tokens (
auth_token,authtoken) - Client secrets (
client_secret)
Cloud Provider Credentials
Cloud Provider Credentials
- AWS Access Key IDs (
AKIA...) - AWS Secret Access Keys
- GitHub Personal Access Tokens (
ghp_...) - GitHub OAuth Tokens (
gho_...) - GitLab Personal Access Tokens (
glpat-...) - Slack Tokens (
xox...)
Passwords & Private Keys
Passwords & Private Keys
- Passwords (
password,passwd,pwd) - Database passwords (
db_password) - Private keys (PEM, RSA, DSA, EC, OPENSSH, PGP)
Sensitive Files
Sensitive Files
- Environment files:
.env,.env.local,.env.production,.env.development - SSH keys:
id_rsa,id_dsa,id_ecdsa,id_ed25519 - Certificates:
.pem,.key,.p12,.pfx,.jks,.keystore - Credentials:
credentials,secrets.json,secrets.yaml,.htpasswd,.netrc
Security Warning Example
Auto Mode Behavior
In auto mode (-a), if sensitive content is detected:
- The commit is automatically aborted
- No changes are pushed
- You must fix the issue or use
--no-verifyto proceed
Requirements
- Git must be installed and available in PATH
- You must be in a git repository
- For interactive mode: changes must be staged with
git add - For auto mode (
-a): changes will be auto-staged
Error Handling
No Staged Changes
git add . or use praisonai commit -a for auto-staging
Not in Git Repository
git init
Customization
Using a Different Model
Custom Editor
Set theEDITOR environment variable to use your preferred editor:
Best Practices
Review Before Accepting
Always review the generated message before accepting
Stage Related Changes
Stage related changes together for better commit messages
Small Commits
Make small, focused commits for clearer messages
Edit When Needed
Use the edit option to refine the message
Integration with Git Workflow
Troubleshooting
| Issue | Solution |
|---|---|
| Empty commit message | Ensure changes are staged and diff is not empty |
| API error | Check your OpenAI API key is set |
| Editor not opening | Set the EDITOR environment variable |
| Push failed | Check remote repository access and authentication |
| Security warning in auto mode | Fix sensitive content or use --no-verify |
| Auto mode aborted | Remove sensitive files from staging or add to .gitignore |
Related
- CLI Overview - PraisonAI CLI documentation
- Planning - AI planning mode

