Skip to main content

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.94.

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. Projects using C# 13 or another .NET language can use context.Tools.Get<ModularPipelines.NerdbankGitVersioning.Services.INbgv>() instead.

Module example​

using ModularPipelines;
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