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 option | Property | Availability | Description |
|---|---|---|---|
--acceptlicense | Acceptlicense | All editions | AcceptLicense - Accept license dialogs automatically. Reserved for future use. |
--allowunofficial | Allowunofficial | All editions | AllowUnofficialBuild - When not using the official build you must set this flag for choco to continue. |
--cache | Cache | All editions | CacheLocation - Location for download cache, defaults to %TEMP% or value in chocolatey.config file. |
--debug | Debug | All editions | Debug - Show debug messaging. |
--failstderr | Failstderr | All editions | FailOnStandardError - Fail on standard error output (stderr), typically received when running external commands during install providers. This overrides the feature failOnStandardError. |
--force | Force | All editions | Force - force the behavior. Do not use force during normal operation - it subverts some of the smart behavior for commands. |
--ignore-http-cache | IgnoreHttpCache | All editions | Ignore any HTTP caches that have previously been created when querying sources, and create new caches. Available in 2.1.0+ |
--include-headers | IncludeHeaders | All editions | Include header names when --limit-output is used. Requires Chocolatey CLI 2.5.0+ |
--limitoutput | Limitoutput | All editions | LimitOutput - Limit the output to essential information |
--log-file | LogFile | All editions | Log File to output to in addition to regular loggers. |
--no-progress | NoProgress | All editions | Do Not Show Progress - Do not show download progress percentages. |
--nocolor | Nocolor | All editions | No Color - Do not show colorization in logging output. This overrides the feature 'logWithoutColor', set to 'False'. |
--noop | Noop | All editions | NoOp / WhatIf - Don't actually do anything. |
--proxy | Proxy | All editions | Proxy Location - Explicit proxy location. Overrides the default proxy location of ''. |
--proxy-bypass-list | ProxyBypassList | All editions | ProxyBypassList - 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-local | ProxyBypassOnLocal | All editions | Proxy 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-password | ProxyPassword | All editions | Proxy 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-user | ProxyUser | All editions | Proxy User Name - Explicit proxy user (optional). Requires explicit proxy (--proxy or config setting). Overrides the default proxy user of ''. |
--skipcompatibilitychecks | Skipcompatibilitychecks | All editions | SkipCompatibilityChecks - 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. |
--timeout | Timeout | All editions | CommandExecutionTimeout (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. |
--trace | Trace | All editions | Trace - Show trace messaging. Very, very verbose trace messaging. Avoid except when needing super low-level .NET Framework debugging. |
--use-system-powershell | UseSystemPowershell | All editions | UseSystemPowerShell - Execute PowerShell using an external process instead of the built-in PowerShell host. Should only be used when internal host is failing. |
--verbose | Verbose | All editions | Verbose - Show verbose messaging. Very verbose messaging, avoid using under normal circumstances. |
--yes | Yes | All editions | Confirm all prompts - Chooses affirmative answer instead of prompting. Implies --accept-license |
Commands
| CLI command | Options record |
|---|---|
choco apikey | ChocoApikeyOptions |
choco cache | ChocoCacheOptions |
choco config | ChocoConfigOptions |
choco export | ChocoExportOptions |
choco feature | ChocoFeatureOptions |
choco features | ChocoFeaturesOptions |
choco find | ChocoFindOptions |
choco info | ChocoInfoOptions |
choco install | ChocoInstallOptions |
choco license | ChocoLicenseOptions |
choco list | ChocoListOptions |
choco new | ChocoNewOptions |
choco outdated | ChocoOutdatedOptions |
choco pack | ChocoPackOptions |
choco pin | ChocoPinOptions |
choco push | ChocoPushOptions |
choco rule | ChocoRuleOptions |
choco search | ChocoSearchOptions |
choco setapikey | ChocoSetapikeyOptions |
choco source | ChocoSourceOptions |
choco sources | ChocoSourcesOptions |
choco support | ChocoSupportOptions |
choco template | ChocoTemplateOptions |
choco templates | ChocoTemplatesOptions |
choco uninstall | ChocoUninstallOptions |
choco unpackself | ChocoUnpackselfOptions |
choco upgrade | ChocoUpgradeOptions |