Chapi Assistant provides a full-featured Git management system integrated directly into your development workflow. Manage commits, branches, stashes, and remote repositories without leaving your IDE.
All Git operations are built on top of LibGit2Sharp with validation, error handling, and user notifications.
Commit changes with automatic validation and notifications:
var request = new CommitRequest{ ProjectPath = @"C:\Projects\MyApp", Message = "Add customer creation feature", Files = new[] { "Customer.cs", "CustomerRepository.cs" }};var result = await commitChangesUseCase.ExecuteAsync(request);
Basic Commit
Commit All Changes
With Validation
Commit specific files with a message:
var request = new CommitRequest{ ProjectPath = projectPath, Message = "Fix validation bug in customer form", Files = new[] { "Views/CustomerView.xaml", "ViewModels/CustomerViewModel.cs" }};var result = await commitChangesUseCase.ExecuteAsync(request);if (result.IsSuccess){ var commit = result.Value; Console.WriteLine($"Committed: {commit.Sha}");}
Commit all modified files:
// First, load all changesvar changes = await loadChangesUseCase.ExecuteAsync(projectPath);var request = new CommitRequest{ ProjectPath = projectPath, Message = "Implement order processing module", Files = changes.Select(c => c.FilePath)};await commitChangesUseCase.ExecuteAsync(request);
The commit use case automatically validates:
// Validation checks:// - Project path is valid// - Project directory exists// - Commit message is not empty// - At least one file is selectedvar result = await commitChangesUseCase.ExecuteAsync(request);if (!result.IsSuccess){ // Possible errors: // - "Ruta de proyecto invalida" // - "El proyecto no existe" // - "Debes escribir un mensaje de commit" // - "No hay archivos seleccionados para hacer commit"}
var result = await pullChangesUseCase.ExecuteAsync( projectPath: @"C:\Projects\MyApp", branch: "main", stashChanges: true // Auto-stash local changes);
Automatically stash local changes, pull, then restore:
var result = await pullChangesUseCase.ExecuteAsync( projectPath, "main", stashChanges: true);// Workflow:// 1. Stash local changes// 2. Pull from remote// 3. Attempt to pop stash// 4. Notify if conflicts occurred
If conflicts occur when restoring stash, you’ll receive a notification to manually resolve.
var history = await loadHistoryUseCase.ExecuteAsync( projectPath: @"C:\Projects\MyApp");foreach (var commit in history){ Console.WriteLine($"{commit.Sha}: {commit.Message}");}
// Common validation errorsif (!result.IsSuccess){ switch (result.Error) { case "Ruta de proyecto invalida": // Invalid project path break; case "El proyecto no existe": // Project directory doesn't exist break; case "Nombre de rama invalido": // Invalid branch name break; }}