Pmad.Git.CliEmulator 0.2.8

dotnet add package Pmad.Git.CliEmulator --version 0.2.8
                    
NuGet\Install-Package Pmad.Git.CliEmulator -Version 0.2.8
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pmad.Git.CliEmulator" Version="0.2.8" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Pmad.Git.CliEmulator" Version="0.2.8" />
                    
Directory.Packages.props
<PackageReference Include="Pmad.Git.CliEmulator" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Pmad.Git.CliEmulator --version 0.2.8
                    
#r "nuget: Pmad.Git.CliEmulator, 0.2.8"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Pmad.Git.CliEmulator@0.2.8
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Pmad.Git.CliEmulator&version=0.2.8
                    
Install as a Cake Addin
#tool nuget:?package=Pmad.Git.CliEmulator&version=0.2.8
                    
Install as a Cake Tool

Pmad.Git.CliEmulator

Managed Git CLI emulator for AI agents on top of Pmad.Git.LocalRepositories and Pmad.Git.RemoteClient.

Overview

Pmad.Git.CliEmulator gives embedded AI agents a familiar, standard Git CLI command surface (status, log, diff, add, commit, branch, merge, reset, etc.) without requiring a native git binary, while giving the host application deep control via an asynchronous IUserApproval callback.

Features

  • No native Git dependency: Pure managed C# implementation.
  • Native AOT compatible: Fully compatible with <PublishAot>true</PublishAot>.
  • Approval gates: Every destructive or network operation calls IUserApproval with rich context objects (affected branch, commit history to lose, overwritten files, remote URL, etc.).
  • Exit codes and stream separation: Returns GitCliResponse with ExitCode, StdOut, and StdErr.
  • Exit code 130 on denial / cancellation: Denying an approval returns exit code 130 with a descriptive error message.
  • No line-ending normalization: core.autocrlf and line-ending conversions are out of scope; staged files are written bit-for-bit, assuming Unix line separators (\n).

Usage

Streamlined One-Liner (Full Managed Stack)

using Pmad.Git.CliEmulator;
using Pmad.Git.RemoteClient;

// Automatically opens local workspace and sets up managed Smart HTTP remote client:
using var emulator = GitCliEmulator.Open(repositoryPath, new GitRemoteClientOptions
{
    Credentials = new GitHttpCredentials("pat", "my-token")
});

var response = await emulator.InvokeAsync(["status"], userApproval);
Console.WriteLine(response.StdOut);

Fluent Extension Methods

using Pmad.Git.CliEmulator;
using Pmad.Git.LocalRepositories;

using var repo = GitRepositoryWithIndexAndWorkspace.Open(repositoryPath);
var emulator = repo.CreateCliEmulator();
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Pmad.Git.CliEmulator:

Package Downloads
Pmad.Git.CliEmulator.AI

Microsoft.Extensions.AI integration for Pmad.Git.CliEmulator. Exposes the Git CLI emulator as an AIFunction for use with any IChatClient-based agent pipeline.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.8 121 10/8/2026
0.2.7 115 10/4/2026