Skip to main content

Git Integration

PraisonAI CLI provides deep Git integration for tracking changes, auto-committing with AI-generated messages, and managing your version control workflow seamlessly.

Overview

Git integration features:
  • Auto-commit - Commit with AI-generated messages
  • Diff viewing - Rich diff display with syntax highlighting
  • Undo support - Safely undo AI changes
  • Branch management - Create and switch branches
  • Stash support - Stash and restore changes

Quick Start

CLI Commands

/diff

Show current changes:

/commit

Commit with AI-generated message:

/undo

Undo the last commit:

Python API

Basic Usage

Status

Diff

Commit

Undo

Log

Git Manager

For more control, use GitManager directly:

Commit Message Generation

Automatic Generation

Message Styles

Conventional (default):
Simple:
Detailed:

Diff Viewer

Rich Display

Output Example

Integration with Autonomy Modes

Git operations respect autonomy settings:

Best Practices

Safe Workflow

  1. Review diff first - Always check /diff before committing
  2. Use meaningful messages - Edit AI messages if needed
  3. Commit frequently - Small, focused commits
  4. Use branches - Create branches for experiments

Commit Message Guidelines

Undo Strategy

Configuration

Environment Variables

Git Config

Error Handling