FVNever.Fabricator.Core 0.6.0

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

Fabricator Status Ventis Fabricator.Core on nuget.org

Fabricator is a hackable DevOps platform, similar to PowerShell's Desired State Configuration in concept.

Core Concept

With Fabricator, the user describes the desired state of their environment, and Fabricator does its best to lead the configuration to this desired state, when asked to do so.

Fabricator's "script" is an F# .fsx script, where you may use all your favorite refactoring and code inspection tools; you may wrap or augment Fabricator calls with your code if you want to.

Fabricator offers a DSL and a set of basic tasks to configure the environment, everything is available via NuGet and easily extendable.

Also, Fabricator is portable across the platforms supported by .NET.

Basic Workflow

To start using Fabricator, you should:

  1. Create a new F# script file, with contents similar to the example.
  2. Run the script with dotnet fsi ./script.fsx check — this will check the environment and show the changes that are about to be performed (add --brief to only see which resources are not applied, without the change details).
  3. If everything's alright, run the script via dotnet fsi ./script.fsx apply — this will apply the changes to the current environment.

Add --dry-run to either command (e.g. dotnet fsi ./script.fsx apply --dry-run) to only print the list of the checks and applications it would perform. No resource is checked or applied, and no secret store is opened, so no input is required. This is useful as a quick CI check that the script compiles and builds its resources. Since no resource is called, it doesn't verify that the checks or applications would succeed.

Quick script example:

#r "nuget: FVNever.Fabricator.Console, 0.6.0"
#r "nuget: FVNever.Fabricator.Resources, 0.6.0"

open System
open System.IO
open Fabricator.Console
open type Fabricator.Resources.Archive
open type Fabricator.Resources.Downloads
open type Fabricator.Resources.Files
open Fabricator.Resources.Hash
open TruePath

let shawlVersion = "1.7.0"
let shawlHash = Sha256 "EAA4FED710E844CC7968FDB82E816D406ED89C4486AB34C3E5DB2DA7E5927923"

let cacheDir = AbsolutePath @"T:\Temp\fabricator\download-cache"
let shawlUrl = Uri $"https://github.com/mtkennerly/shawl/releases/download/v{shawlVersion}/shawl-v{shawlVersion}-win64.zip"

let shawlDownloadCache = cacheDir / Path.GetFileName shawlUrl.LocalPath
let shawlExecutable = AbsolutePath @"C:\Programs\shawl\shawl.exe"

let downloadShawl = downloadFile(shawlUrl, shawlHash, shawlDownloadCache)
let unpackShawl =
    unpackArchive(shawlDownloadCache, shawlHash, shawlExecutable.Parent.Value, dependsOn = [ downloadShawl ])
let installShawl = ensureFileExists(shawlExecutable, dependsOn = [ unpackShawl ])

let resources = [
    installShawl
]

exit <| EntryPoint.main fsi.CommandLineArgs resources

This script will make sure there's an executable C:\Programs\shawl\shawl.exe downloaded from the specified URL. This executable might then be used for other resources' setup, e.g., for the Windows service resource.

Resources passed to EntryPoint.main are processed in parallel, and their order doesn't matter. If a resource requires another one to be applied first, declare that via Resource.DependsOn (e.g., using the dependsOn parameter of the bundled resources as in the example above). A resource's dependencies don't have to be passed to EntryPoint.main explicitly: they are always checked and, if required, applied before the resource itself.

Prerequisites

To work with Fabricator, you'll need .NET SDK 9.0 or later.

Documentation

License

The project is distributed under the terms of the MIT license.

The license indication in the project's sources is compliant with the REUSE specification v3.3.

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 (3)

Showing the top 3 NuGet packages that depend on FVNever.Fabricator.Core:

Package Downloads
FVNever.Fabricator.Console

This package is part of Fabricator, an infrastructure automation framework. Fabricator.Console provides the command-line interface for Fabricator, including argument parsing, logging facilities, and orchestration of resource deployment execution. It processes the resources and manages the apply/check workflow lifecycle.

FVNever.Fabricator.Resources

This package is part of Fabricator, an infrastructure automation framework. Fabricator.Resources package provides the resource types available for deployment via Fabricator.

FVNever.Fabricator.Secrets.KeePass

KeePass secret storage for Fabricator, an infrastructure automation framework.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.6.0 221 10/18/2026
0.5.0 216 1/11/2026
0.4.0 181 1/4/2026
0.3.0 180 1/1/2026
0.2.0 282 10/19/2025
0.1.0 283 10/19/2025

[Changed]

- (Breaking change!) The IResource interface is replaced with the Resource record. Resources are compared by reference: the same resource object is processed at most once, while different resource objects are always processed separately. A resource declares the resources it depends on via DependsOn (use Resource.NoDependencies for resources without dependencies).
- (Breaking change!) The bundled resource factories from the Archive, Chocolatey, Downloads, Files and WindowsCertificates modules are now static members of the types with the same names (use open type instead of open, e.g. open type Fabricator.Resources.Files). FileSource, CertificateStoreLocation and CertificateStores are moved to the Fabricator.Resources namespace.
- (Breaking change!) The Files.FileResource type is replaced with the Files.file method.
- (Breaking change!) WindowsCertificates.trustedCertificate now takes tupled arguments instead of curried ones.
- (Breaking change!) Resources are now checked and applied in parallel. The order of the resources passed to EntryPoint.main no longer defines the order of their processing; use DependsOn to declare which resources have to be applied before others.
- (Breaking change!) Resource.AlreadyApplied and Resource.Apply now receive a ResourceContext, allowing the resource to report the status, progress, and log of the operation via ResourceContext.Reporter. Use ResourceContext.Null to call these functions directly.
- (Breaking change!) Resource.AlreadyApplied and Resource.Apply now return a ResourceChange instead of bool and unit: AlreadyApplied returns NoChanges if the resource is already applied, or the change required to apply it otherwise; Apply returns the change it has made. A change is either a TextDiff, a human-readable NamedChange, or ChangeWithNoDescription.
- (Breaking change!) Resource has a new Secrets field listing the secrets the resource requires (use Resource.NoSecrets for resources without secrets), and ResourceContext has a new Secrets field passing them to the resource checks and applications.
- check now reports that not all resources are applied (exit code 3) if any of the dependencies is not applied, even if the root resources are.
- If a resource fails to be checked or applied during apply, the resources depending on it are skipped, while independent resources continue to be processed (previously, the processing stopped on the first failure).
- The output of the external commands run by Chocolatey.chocolateyPackage and DotNetTool.Install is now streamed to the resource log.
- Downloads.downloadFile no longer buffers the whole file in memory before saving it, and reports the download progress.
- The check of HostsFile.Record now fails if the hosts file does not exist, same as its application (previously, the resource was reported as not applied).
- Update the dependencies.

[Added]

- (Breaking change!) All the bundled resources accept an optional dependsOn parameter to declare their dependencies.
- (Breaking change!) ConcurrencyGroup and a new required field, Resource.Lock: resources from the same concurrency group are never checked or applied concurrently. HostsFile.Record (per hosts file), Chocolatey.chocolateyPackage and DotNetTool.Install (per installation path) use their own groups, available as HostsFile.ConcurrencyGroup, Chocolatey.ConcurrencyGroup and DotNetTool.ConcurrencyGroup.
- (Breaking change!) Downloads.downloadFile accepts an optional readTimeout (100 seconds by default): the download fails if no data is received for that long.
- Resource.NoDependencies for resources without dependencies.
- IReporter, IProgressReporter, ProgressUnit and ResourceContext to report the status, progress, and log of resource checks and applications.
- A live progress display in interactive terminals, showing the overall progress of the execution and the running resource checks and applications with their statuses and progress.
- The logs of resource checks and applications are now printed in order: the lines of different resources are never interleaved.
- After check and apply have finished, a report listing every processed resource with its final state (already applied, not applied, applied, skipped, or failed) is printed. Pass --brief (e.g. check --brief) to only print the resource states. The report ends with a short summary of the number of resources in each state.
- ResourceChange and Diff to describe the changes of the resources. All the bundled resources describe their changes: Files.file and HostsFile.Record show the diffs of the file contents (binary files and files larger than 1 MiB are described with their sizes), WindowsServices.createWindowsService shows the diff of the service properties, and the rest describe their changes in words.
- Secret stores: ISecretStore, ISecretStoreScope, ISecretStoreUi, SecretStoreContext, SecretName, SecretRef, SecretRequest and SecretRequestMode. A SecretRef references a secret by its store and name; resources requiring secrets from the user accept them as SecretRefs. A resource lists the secrets it requires in Resource.Secrets as SecretRequests: a SecretRef with the operations requiring it (check, application, or both). Before checking or applying anything, Fabricator opens all the required stores one by one (a store may ask the user for input while opening), and closes them at the end. Every secret is fetched right before the operation requiring it, passed via ResourceContext.Secrets, and disposed right after the operation.
- PlainSecretStore, a secret store asking the user to enter every required secret when it's opened. It is not secure: the secrets are kept in the process memory for the whole session. Only use it for simple cases.
- New package FVNever.Fabricator.Secrets.KeePass with KeePassSecretStore, a secret store reading the secrets from a KeePass (KDBX) database. It asks for the master password of the database when opened. A secret is looked up by the entry title, and its value is the entry's password. Entries in the recycle bin are ignored, and getting a secret fails if several entries have the same title.
- Secrets.Materialize and Secrets.OfString to convert between SecureString and string.
- A new resource, DigitalOceanDns.Domain, managing all the DNS records of a domain hosted by DigitalOcean DNS (https://docs.digitalocean.com/products/networking/dns/), with the API token taken from a secret store (passed as a SecretRef).
- The console asks for the secrets without echoing them. If the standard input is redirected, the secrets are read from it, one per line.
- --dry-run flag for check and apply (e.g. apply --dry-run): only prints the list of the checks and applications the command would perform, in the order of the report, marked with ⏸️ (or [ ] if the output doesn't support Unicode). No resource is checked or applied and no secret store is opened. Use it for a quick CI check that the script compiles and builds its resources; since no resource is called, it doesn't verify that the checks or applications would succeed.
- Ctrl+C support in EntryPoint.main: on the first Ctrl+C, no new resources are processed, the running ones are notified via their Async.CancellationToken, and the program exits with code 2 after all of them have finished. A second Ctrl+C terminates the program immediately.

[Fixed]

- The check command now reports "Checking the current environment." instead of "Applying changes to the current environment." in the beginning.
- HostsFile.Record no longer puts the entry split from a multi-host line to the beginning of the hosts file: it now goes right after the line it was split from.
- DotNetTool.Install no longer fails to check the tool if the installation path contains no tools or several tools.