Skip to main content
The checkpoint command manages file-level checkpoints using shadow git.

Quick Start

# Save a checkpoint
praisonai checkpoint save "Before refactoring"

Usage

Save Checkpoint

praisonai checkpoint save "Checkpoint message"
Expected Output:
✅ Checkpoint saved: abc12345
   Message: Before refactoring
   Files changed: 3

List Checkpoints

praisonai checkpoint list
Expected Output:
╭─ Checkpoints ────────────────────────────────────────────────────────────────╮
│  1. [abc12345] Before refactoring (2024-12-24 07:30:00)                     │
│  2. [def67890] Initial state (2024-12-24 07:25:00)                          │
╰──────────────────────────────────────────────────────────────────────────────╯

Show Diff

praisonai checkpoint diff
praisonai checkpoint diff abc12345
praisonai checkpoint diff abc12345 def67890

Restore Checkpoint

praisonai checkpoint restore abc12345

Python API

import asyncio
from praisonaiagents.checkpoints import CheckpointService

async def main():
    service = CheckpointService(workspace_dir="/path/to/project")
    await service.initialize()
    
    # Save checkpoint
    result = await service.save("Before changes")
    print(f"Saved: {result.checkpoint.short_id}")
    
    # List checkpoints
    checkpoints = await service.list_checkpoints()
    for cp in checkpoints:
        print(f"{cp.short_id}: {cp.message}")
    
    # Restore
    await service.restore(result.checkpoint.id)

asyncio.run(main())

See Also