Skip to main content
Version: Next

nbgv CLI reference

ModularPipelines.NerdbankGitVersioning provides strongly typed access to the nbgv CLI.

Executable prerequisite

This package does not install the nbgv executable. Install it separately and ensure nbgv is available on PATH.

The generation workflow is pinned to nbgv version 3.10.91.

See the nbgv installation guide.

Install the nbgv .NET tool globally or in a tool path available on PATH.

Package installation

dotnet add package ModularPipelines.NerdbankGitVersioning

Resolve the service with context.Tools.Nbgv. For projects older than C# 14, import ModularPipelines.NerdbankGitVersioning.Extensions and use the context.Nbgv() extension method as a compatibility fallback.

Module example

using ModularPipelines.Context;
using ModularPipelines.Models;
using ModularPipelines.Modules;
using ModularPipelines.NerdbankGitVersioning.Options;

public class RunCommandModule : Module<CommandResult>
{
protected override async Task<CommandResult> ExecuteAsync(
IModuleContext context,
CancellationToken cancellationToken)
{
return await context.Tools.Nbgv.GetVersionAsync(
new NbgvGetVersionOptions(),
cancellationToken: cancellationToken);
}
}

Commands

CLI commandOptions record
nbgv cloudNbgvCloudOptions
nbgv get-commitsNbgvGetCommitsOptions
nbgv get-versionNbgvGetVersionOptions
nbgv installNbgvInstallOptions
nbgv prepare-releaseNbgvPrepareReleaseOptions
nbgv set-versionNbgvSetVersionOptions
nbgv tagNbgvTagOptions