Skip to main content

praisonaiagents.snapshot

Core SDK Snapshot Module for PraisonAI Agents. Provides file change tracking using a shadow git repository, enabling undo/restore capabilities without affecting the user’s actual git repository. Features:
  • Shadow git repository for tracking changes
  • File diff generation
  • Snapshot creation and restoration
  • Session-based change tracking
  • Zero interference with user’s git repos
Usage: from praisonaiagents.snapshot import FileSnapshot

Initialize for a project

snapshot = FileSnapshot(“/path/to/project”)

Track current state

hash = snapshot.track()

Get diff from a snapshot

diff = snapshot.diff(hash)

Restore to a snapshot

snapshot.restore(hash)

Overview

This module provides components for snapshot.