Skip to main content

choco CLI reference

ModularPipelines.Chocolatey provides strongly typed access to the choco CLI.

Executable prerequisite​

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

Follow the executable's official documentation for installation instructions.

Package installation​

dotnet add package ModularPipelines.Chocolatey

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

Global options​

Global options are rendered after the selected subcommand.

CLI optionPropertyAvailabilityDescription
--acceptlicenseAcceptlicenseAll editionsAcceptLicense - Accept license dialogs automatically. Reserved for future use.
--allowunofficialAllowunofficialAll editionsAllowUnofficialBuild - When not using the official build you must set this flag for choco to continue.
--cacheCacheAll editionsCacheLocation - Location for download cache, defaults to %TEMP% or value in chocolatey.config file.
--debugDebugAll editionsDebug - Show debug messaging.
--failstderrFailstderrAll editionsFailOnStandardError - Fail on standard error output (stderr), typically received when running external commands during install providers. This overrides the feature failOnStandardError.
--forceForceAll editionsForce - force the behavior. Do not use force during normal operation - it subverts some of the smart behavior for commands.
--ignore-http-cacheIgnoreHttpCacheAll editionsIgnore any HTTP caches that have previously been created when querying sources, and create new caches. Available in 2.1.0+
--include-headersIncludeHeadersAll editionsInclude header names when --limit-output is used. Requires Chocolatey CLI 2.5.0+
--limitoutputLimitoutputAll editionsLimitOutput - Limit the output to essential information
--log-fileLogFileAll editionsLog File to output to in addition to regular loggers.
--no-progressNoProgressAll editionsDo Not Show Progress - Do not show download progress percentages.
--nocolorNocolorAll editionsNo Color - Do not show colorization in logging output. This overrides the feature 'logWithoutColor', set to 'False'.
--noopNoopAll editionsNoOp / WhatIf - Don't actually do anything.
--proxyProxyAll editionsProxy Location - Explicit proxy location. Overrides the default proxy location of ''.
--proxy-bypass-listProxyBypassListAll editionsProxyBypassList - Comma separated list of regex locations to bypass on proxy. Requires explicit proxy (--proxy or config setting). Overrides the default proxy bypass list of ''.
--proxy-bypass-on-localProxyBypassOnLocalAll editionsProxy Bypass On Local - Bypass proxy for local connections. Requires explicit proxy (--proxy or config setting). Overrides the default proxy bypass on local setting of 'True'.
--proxy-passwordProxyPasswordAll editionsProxy Password - Explicit proxy password (optional) to be used with user name. Encrypted. Requires explicit proxy (--proxy or config setting) and user name (--proxy-user or config setting). Overrides the default proxy password.
--proxy-userProxyUserAll editionsProxy User Name - Explicit proxy user (optional). Requires explicit proxy (--proxy or config setting). Overrides the default proxy user of ''.
--skipcompatibilitychecksSkipcompatibilitychecksAll editionsSkipCompatibilityChecks - Prevent warnings being shown before and after command execution when a runtime compatibility problem is found between the version of Chocolatey and the Chocolatey Licensed Extension.
--timeoutTimeoutAll editionsCommandExecutionTimeout (in seconds) - The time to allow a command to finish before timing out. Overrides the default execution timeout in the configuration of 2700 seconds. Supply '0' to disable the timeout.
--traceTraceAll editionsTrace - Show trace messaging. Very, very verbose trace messaging. Avoid except when needing super low-level .NET Framework debugging.
--use-system-powershellUseSystemPowershellAll editionsUseSystemPowerShell - Execute PowerShell using an external process instead of the built-in PowerShell host. Should only be used when internal host is failing.
--verboseVerboseAll editionsVerbose - Show verbose messaging. Very verbose messaging, avoid using under normal circumstances.
--yesYesAll editionsConfirm all prompts - Chooses affirmative answer instead of prompting. Implies --accept-license

Commands​

CLI commandOptions record
choco apikeyChocoApikeyOptions
choco cacheChocoCacheOptions
choco configChocoConfigOptions
choco exportChocoExportOptions
choco featureChocoFeatureOptions
choco featuresChocoFeaturesOptions
choco findChocoFindOptions
choco infoChocoInfoOptions
choco installChocoInstallOptions
choco licenseChocoLicenseOptions
choco listChocoListOptions
choco newChocoNewOptions
choco outdatedChocoOutdatedOptions
choco packChocoPackOptions
choco pinChocoPinOptions
choco pushChocoPushOptions
choco ruleChocoRuleOptions
choco searchChocoSearchOptions
choco setapikeyChocoSetapikeyOptions
choco sourceChocoSourceOptions
choco sourcesChocoSourcesOptions
choco supportChocoSupportOptions
choco templateChocoTemplateOptions
choco templatesChocoTemplatesOptions
choco uninstallChocoUninstallOptions
choco unpackselfChocoUnpackselfOptions
choco upgradeChocoUpgradeOptions