Skip to main content
Version: Next

trivy CLI reference

ModularPipelines.Trivy provides strongly typed access to the trivy CLI.

Executable prerequisite

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

Follow the executable's official documentation for installation instructions.

Package installation

dotnet add package ModularPipelines.Trivy

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

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 trivy = context.Tools.Trivy;

Commands

CLI commandOptions record
trivy cleanTrivyCleanOptions
trivy configTrivyConfigOptions
trivy convertTrivyConvertOptions
trivy filesystemTrivyFilesystemOptions
trivy imageTrivyImageOptions
trivy kubernetesTrivyKubernetesOptions
trivy moduleTrivyModuleOptions
trivy module installTrivyModuleInstallOptions
trivy module uninstallTrivyModuleUninstallOptions
trivy pluginTrivyPluginOptions
trivy plugin infoTrivyPluginInfoOptions
trivy plugin installTrivyPluginInstallOptions
trivy plugin listTrivyPluginListOptions
trivy plugin runTrivyPluginRunOptions
trivy plugin searchTrivyPluginSearchOptions
trivy plugin uninstallTrivyPluginUninstallOptions
trivy plugin updateTrivyPluginUpdateOptions
trivy plugin upgradeTrivyPluginUpgradeOptions
trivy registryTrivyRegistryOptions
trivy registry loginTrivyRegistryLoginOptions
trivy registry logoutTrivyRegistryLogoutOptions
trivy repositoryTrivyRepositoryOptions
trivy rootfsTrivyRootfsOptions
trivy sbomTrivySbomOptions
trivy serverTrivyServerOptions
trivy vexTrivyVexOptions
trivy vex repoTrivyVexRepoOptions
trivy vex repo downloadTrivyVexRepoDownloadOptions
trivy vex repo initTrivyVexRepoInitOptions
trivy vex repo listTrivyVexRepoListOptions
trivy vmTrivyVmOptions