Skip to main content

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. Projects using C# 13 or another .NET language can use context.Tools.Get<ModularPipelines.Trivy.Services.ITrivy>() 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 trivy = context.Tools.Trivy;

Global options​

Global options are rendered before the selected subcommand.

CLI optionPropertyAvailabilityDescription
--cacertCacertAll editionsPath to PEM-encoded CA certificate file
--cache-dirCacheDirAll editionscache directory (default "<cache>/trivy")
--configConfigAll editionsconfig path (empty string disables loading) (default "trivy.yaml")
--debugDebugAll editionsdebug mode
--generate-default-configGenerateDefaultConfigAll editionswrite the default config to trivy-default.yaml
--insecureInsecureAll editionsallow insecure server connections
--quietQuietAll editionssuppress progress bar and log output
--timeoutTimeoutAll editionstimeout (default 5m0s)

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 versionTrivyVersionOptions
trivy vexTrivyVexOptions
trivy vex repoTrivyVexRepoOptions
trivy vex repo downloadTrivyVexRepoDownloadOptions
trivy vex repo initTrivyVexRepoInitOptions
trivy vex repo listTrivyVexRepoListOptions
trivy vmTrivyVmOptions