Skip to main content

cosign CLI reference

ModularPipelines.Cosign provides strongly typed access to the cosign CLI.

Executable prerequisite​

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

Follow the executable's official documentation for installation instructions.

Package installation​

dotnet add package ModularPipelines.Cosign

Resolve the service with context.Tools.Cosign. Projects using C# 13 or another .NET language can use context.Tools.Get<ModularPipelines.Cosign.Services.ICosign>() 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 cosign = context.Tools.Cosign;

Global options​

Global options are rendered before the selected subcommand.

CLI optionPropertyAvailabilityDescription
--output-fileOutputFileAll editionslog output to a file
--timeoutTimeoutAll editionstimeout for commands
--verboseVerboseAll editionslog debug output

Commands​

CLI commandOptions record
cosign attestCosignAttestOptions
cosign attest-blobCosignAttestBlobOptions
cosign bundleCosignBundleOptions
cosign bundle createCosignBundleCreateOptions
cosign bundle inspectCosignBundleInspectOptions
cosign bundle upgradeCosignBundleUpgradeOptions
cosign cleanCosignCleanOptions
cosign downloadCosignDownloadOptions
cosign download attestationCosignDownloadAttestationOptions
cosign download sbomCosignDownloadSbomOptions
cosign download signatureCosignDownloadSignatureOptions
cosign generate-key-pairCosignGenerateKeyPairOptions
cosign import-key-pairCosignImportKeyPairOptions
cosign initializeCosignInitializeOptions
cosign loadCosignLoadOptions
cosign loginCosignLoginOptions
cosign public-keyCosignPublicKeyOptions
cosign saveCosignSaveOptions
cosign signCosignSignOptions
cosign sign-blobCosignSignBlobOptions
cosign signing-configCosignSigningConfigOptions
cosign signing-config createCosignSigningConfigCreateOptions
cosign treeCosignTreeOptions
cosign trusted-rootCosignTrustedRootOptions
cosign trusted-root createCosignTrustedRootCreateOptions
cosign verifyCosignVerifyOptions
cosign verify-attestationCosignVerifyAttestationOptions
cosign verify-blobCosignVerifyBlobOptions
cosign verify-blob-attestationCosignVerifyBlobAttestationOptions
cosign versionCosignVersionOptions