Skip to main content

packer CLI reference

ModularPipelines.Packer provides strongly typed access to the packer CLI.

Executable prerequisite​

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

Follow the executable's official documentation for installation instructions.

Package installation​

dotnet add package ModularPipelines.Packer

Resolve the service with context.Tools.Packer. Projects using C# 13 or another .NET language can use context.Tools.Get<ModularPipelines.Packer.Services.IPacker>() instead.

Module example​

Resolve the service in a module, then select a command from the table below. A runnable example is omitted when no command has complete safety metadata:

var packer = context.Tools.Packer;

Global options​

Global options are rendered before the selected subcommand.

CLI optionPropertyAvailabilityDescription
-machine-readableMachineReadableAll editionsProduce machine-readable output. Do not combine with build debug mode.

Commands​

CLI commandOptions record
packer buildPackerBuildOptions
packer consolePackerConsoleOptions
packer fixPackerFixOptions
packer fmtPackerFmtOptions
packer hcl2_upgradePackerHcl2UpgradeOptions
packer initPackerInitOptions
packer inspectPackerInspectOptions
packer pluginsPackerPluginsOptions
packer validatePackerValidateOptions
packer verify-attestationPackerVerifyAttestationOptions
packer versionPackerVersionOptions