Skip to main content
The 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

Git Commit Helper

Usage

This single command will:
  1. Auto-stage all changes (git add -A)
  2. Security scan for sensitive content (API keys, passwords, secrets)
  3. Generate AI commit message from diff
  4. Commit with the generated message
  5. Push to remote repository
Expected Output:
If sensitive content is detected in auto mode, the commit will be automatically aborted for safety. Use --no-verify to skip security checks (not recommended).

Interactive Mode

Expected Output:

Commit and Push (Interactive)

This will generate the commit message, commit the changes, and push to the remote repository after confirmation.

Workflow

  1. Stage Changes: Use git add to stage your changes
  2. Run Command: Execute praisonai commit
  3. Review Message: AI generates a commit message based on the diff
  4. Choose Action:
    • y - Accept and commit
    • e - Edit the message in your default editor
    • n - Cancel

Commit Message Format

The AI follows the Conventional Commits specification:

Types

Examples

Options

Security Scanning

The commit command includes built-in security scanning to prevent accidental exposure of sensitive data.

Detected Patterns

  • API keys (api_key, apikey)
  • Secret keys (secret_key, secretkey)
  • Access tokens (access_token, accesstoken)
  • Auth tokens (auth_token, authtoken)
  • Client secrets (client_secret)
  • 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 (password, passwd, pwd)
  • Database passwords (db_password)
  • Private keys (PEM, RSA, DSA, EC, OPENSSH, PGP)
  • 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-verify to 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

Solution: Stage your changes with git add . or use praisonai commit -a for auto-staging

Not in Git Repository

Solution: Navigate to a git repository or initialize one with git init

Customization

Using a Different Model

praisonai commit honours the same LLM-selection cascade as every other CLI command. The first match wins:
Earlier releases read only OPENAI_MODEL_NAME for commit messages, silently ignoring --llm and MODEL_NAME. If your workflow pins OPENAI_MODEL_NAME=gpt-4o-mini for cheap commit messages, keep it — the fallback is unchanged. Otherwise --llm now works as expected.

Git Identity Configuration

Configure custom git commit author for praisonai commit command.

Environment Variables

Set these in your shell configuration:

GitHub Noreply Email

Use GitHub’s noreply email to protect your personal email:

Verification

After setting, commits will show your identity:
For detailed git identity configuration across all PraisonAI services, see Git Identity Configuration.

Custom Editor

Set the EDITOR 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