Zakira.Conduit.Core 0.5.0

dotnet add package Zakira.Conduit.Core --version 0.5.0
                    
NuGet\Install-Package Zakira.Conduit.Core -Version 0.5.0
                    
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="Zakira.Conduit.Core" Version="0.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Zakira.Conduit.Core" Version="0.5.0" />
                    
Directory.Packages.props
<PackageReference Include="Zakira.Conduit.Core" />
                    
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 Zakira.Conduit.Core --version 0.5.0
                    
#r "nuget: Zakira.Conduit.Core, 0.5.0"
                    
#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 Zakira.Conduit.Core@0.5.0
                    
#: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=Zakira.Conduit.Core&version=0.5.0
                    
Install as a Cake Addin
#tool nuget:?package=Zakira.Conduit.Core&version=0.5.0
                    
Install as a Cake Tool

Zakira.Conduit.Core

The library that powers the Zakira.Conduit global tool.

Zakira.Conduit.Core exposes the manifest model, source abstractions, mirror engine, and synchronizer that the CLI tool wraps. Use it directly when you want to embed conduit's "mirror skills from many sources to many local folders" capability inside your own .NET application instead of shelling out to the tool.

Install

dotnet add package Zakira.Conduit.Core

Quickstart

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Zakira.Conduit.DependencyInjection;
using Zakira.Conduit.Manifest;
using Zakira.Conduit.Synchronization;

var services = new ServiceCollection();
services.AddLogging(b => b.AddConsole());
services.AddConduitCore(github => { github.Token = "ghp_..."; }); // optional

await using var provider = services.BuildServiceProvider();
var loader        = provider.GetRequiredService<IManifestLoader>();
var synchronizer  = provider.GetRequiredService<IConduitSynchronizer>();

var manifestPath = "/path/to/conduit.json";
var manifest     = await loader.LoadAsync(manifestPath);
var report       = await synchronizer.SyncAsync(manifest, manifestPath, new SyncOptions());

Console.WriteLine(report.Succeeded ? "ok" : "had failures");

What's in the box

Namespace Public types
Zakira.Conduit.Manifest ConduitManifest, ConduitEntry, ISource, GitHubSource, LocalDirectorySource, IManifestLoader, IManifestLocator, ManifestValidator, ManifestException
Zakira.Conduit.Sources ISourceFetcher, ISourceFetcherRegistry, FetchedSource, FetchedContent, FetchContext
Zakira.Conduit.Sources.GitHub GitHubSourceFetcher, IGitHubArchiveDownloader, GitHubFetcherOptions, GitHubDownloadException
Zakira.Conduit.Sources.Local LocalDirectorySourceFetcher, LocalSourceNotFoundException
Zakira.Conduit.Synchronization IConduitSynchronizer, SyncOptions, SyncReport, SyncEntryResult, SyncTargetResult
Zakira.Conduit.Mirroring IDirectoryMirror, AtomicDirectoryMirror
Zakira.Conduit.Paths IPathResolver, DefaultPathResolver
Zakira.Conduit.Hosting IEnvironment, SystemEnvironment
Zakira.Conduit.DependencyInjection ConduitCoreServiceCollectionExtensions

Adding a new source kind

Implement two small types and register them with DI:

public sealed record GitLabSource : ISource
{
    public const string TypeDiscriminator = "gitlab";
    [JsonPropertyName("project")] public required string Project { get; init; }
    [JsonPropertyName("ref")]     public string?         Ref     { get; init; }
    [JsonIgnore] public string Kind => TypeDiscriminator;
}

public sealed class GitLabSourceFetcher : ISourceFetcher
{
    public string SourceKind => GitLabSource.TypeDiscriminator;

    public Task<FetchedSource> FetchAsync(ISource source, FetchContext context, CancellationToken ct = default)
    {
        // ... download zip, extract to a temp dir, return a FetchedSource ...
    }
}

Then register the discriminator on ISource ([JsonDerivedType]) and the fetcher with DI:

services.AddSingleton<ISourceFetcher, GitLabSourceFetcher>();

The synchronizer and mirror are source-agnostic, so no further wiring is needed.

See also

License

MIT.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.0 225 6/6/2026
0.4.0 124 6/4/2026
0.3.0 121 6/4/2026
0.2.0 115 5/20/2026
0.1.0 117 5/20/2026