Skip to main content

pip CLI reference

ModularPipelines.Python provides strongly typed access to the pip CLI.

Executable prerequisite​

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

Follow the executable's official documentation for installation instructions.

Package installation​

dotnet add package ModularPipelines.Python

Resolve the service with context.Tools.Pip. Projects using C# 13 or another .NET language can use context.Tools.Get<ModularPipelines.Python.Services.IPip>() instead.

Module example​

using ModularPipelines;
using ModularPipelines.Python.Options;

public class RunCommandModule : Module<CommandResult>
{
protected override async Task<CommandResult> ExecuteAsync(
IModuleContext context,
CancellationToken cancellationToken)
{
return await context.Tools.Pip.FreezeAsync(
new PipFreezeOptions(),
cancellationToken: cancellationToken);
}
}

Global options​

Global options are rendered before the selected subcommand.

CLI optionPropertyAvailabilityDescription
--cache-dirCacheDirAll editionsStore the cache data in <dir>.
--certCertAll editionsPath to PEM-encoded CA certificate bundle. If provided, overrides the default. See 'SSL Certificate Verification' in pip documentation for more information.
--client-certClientCertAll editionsPath to SSL client certificate, a single file containing the private key and the certificate in PEM format.
--debugDebugAll editionsLet unhandled exceptions propagate outside the main subroutine, instead of logging them to stderr.
--disable-pip-version-checkDisablePipVersionCheckAll editionsDon't periodically check PyPI to determine whether a new version of pip is available for download. Implied with --no-index.
--exists-actionExistsActionAll editionsDefault action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--isolatedIsolatedAll editionsRun pip in an isolated mode, ignoring environment variables and user configuration.
--keyring-providerKeyringProviderAll editionsEnable the credential lookup via the keyring library if user input is allowed. Specify which mechanism to use [auto, disabled, import, subprocess]. (default: auto)
--logLogAll editionsPath to a verbose appending log.
--no-cache-dirNoCacheDirAll editionsDisable the cache.
--no-colorNoColorAll editionsSuppress colored output.
--no-inputNoInputAll editionsDisable prompting for input.
--no-proxy-envNoProxyEnvAll editionsDo not read proxy configuration from environment variables.
--proxyProxyAll editionsSpecify a proxy in the form scheme://[user:passwd@]proxy.server:port.
--pythonPythonAll editionsRun pip with the specified Python interpreter.
--quietQuietAll editionsGive less output. Option is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels).
--require-virtualenvRequireVirtualenvAll editionsAllow pip to only run in a virtual environment; exit with an error otherwise.
--resume-retriesResumeRetriesAll editionsMaximum attempts to resume or restart an incomplete download. (default: 5)
--retriesRetriesAll editionsMaximum attempts to establish a new HTTP connection. (default: 5)
--timeoutTimeoutAll editionsSet the socket timeout (default 15 seconds).
--trusted-hostTrustedHostAll editionsMark this host or host:port pair as trusted, even though it does not have valid or any HTTPS.
--use-deprecatedUseDeprecatedAll editionsEnable deprecated functionality, that will be removed in the future.
--use-featureUseFeatureAll editionsEnable new functionality, that may be backward incompatible.
--verboseVerboseAll editionsGive more output. Option is additive, and can be used up to 3 times.
--versionVersionAll editionsShow version and exit.

Commands​

CLI commandOptions record
pip cachePipCacheOptions
pip checkPipCheckOptions
pip configPipConfigOptions
pip downloadPipDownloadOptions
pip freezePipFreezeOptions
pip hashPipHashOptions
pip indexPipIndexOptions
pip inspectPipInspectOptions
pip installPipInstallOptions
pip listPipListOptions
pip lockPipLockOptions
pip searchPipSearchOptions
pip showPipShowOptions
pip uninstallPipUninstallOptions
pip wheelPipWheelOptions