CLI Reference#
pdm#
Options:
-h,--help: Show this help message and exit.-V,--version: Show the version and exit-c,--config: Specify another config file path [env var:PDM_CONFIG_FILE]-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--no-cache: Disable the cache for the current command. [env var:PDM_NO_CACHE]-I,--ignore-python: Ignore the Python path saved in.pdm-python. [env var:PDM_IGNORE_SAVED_PYTHON]--pep582SHELL: Print the command line to be eval'd by the shell for PEP 582-n,--non-interactive: Don't show interactive prompts but use defaults. [env var:PDM_NON_INTERACTIVE]
Commands:
add#
Add package(s) to pyproject.toml and install them
Update Strategy:
--update-reuse: Reuse pinned versions already present in lock file if possible--update-eager: Try to update the packages and their dependencies recursively--update-all: Update all dependencies and sub-dependencies--update-reuse-installed: Reuse installed packages if possible
Save Strategy:
--save-compatible: Save compatible version specifiers--save-wildcard: Save wildcard version specifiers--save-exact: Save exact version specifiers--save-minimum: Save minimum version specifiers
Package Arguments:
-e,--editable: Specify editable packagespackages: Specify packages
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]--frozen-lockfile,--no-lock: Don't try to create or update the lockfile. [env var:PDM_FROZEN_LOCKFILE]--override: Use the constraint file in pip-requirements format for overriding. [env var:PDM_OVERRIDE] This option can be used multiple times. See https://pip.pypa.io/en/stable/user_guide/#constraints-files--pre,--prerelease: Allow prereleases to be pinned--stable: Only allow stable versions to be pinned (default:True)-u,--unconstrained: Ignore the version constraints inpyproject.tomland overwrite with new ones from the resolution result--dry-run: Show the difference only and don't perform any action--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.-d,--dev: Add packages into dev dependencies-G,--group: Specify the target dependency group to add into--no-sync: Only writepyproject.tomland do not sync the working set (default:False)
Install Options:
--no-editable: Install non-editable versions for all packages. [env var:PDM_NO_EDITABLE]--no-self: Don't install the project itself. [env var:PDM_NO_SELF]--fail-fast,-x: Abort on first installation error--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)
build#
Build artifacts for distribution
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)--no-sdist: Don't build source tarballs (default:False)--no-wheel: Don't build wheels (default:False)-d,--dest: Target directory to put artifacts (default:dist)--no-clean: Do not clean the target directory (default:False)
cache#
Control the caches of PDM
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
Commands:
clear#
Clean all the files under cache directory
Positional Arguments:
type: Clear the given type of caches
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
remove#
Remove files matching the given pattern
Positional Arguments:
pattern: The pattern to remove
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
list#
List the built wheels stored in the cache
Positional Arguments:
pattern: The pattern to list (default:*)
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
info#
Show the info and current size of caches
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
completion#
Generate completion scripts for the given shell
Positional Arguments:
shell: The shell to generate the scripts for. If not given, PDM will properly guess fromSHELLenv var.
Options:
-h,--help: Show this help message and exit.
config#
Display the current configuration
Positional Arguments:
key: Config keyvalue: Config value
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-l,--local: Set config in the project's local configuration file-d,--delete: Unset a configuration key-e,--edit: Edit the configuration file in the default editor(defined by EDITOR env var)
export#
Export the locked packages set to other formats
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]-f,--format: Only requirements.txt is supported for now. (default:requirements)--no-hashes,--without-hashes: Don't include artifact hashes (default:False)--no-markers: (DEPRECATED)Don't include platform markers (default:False)--no-extras: Strip extras from the requirements (default:False)-o,--output: Write output to the given file, or print to stdout if not given--pyproject: Read the list of packages frompyproject.toml--expandvars: Expand environment variables in requirements--self: Include the project itself--editable-self: Include the project itself as an editable dependency
Dependencies Selection:
-G,--group,--withGROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with-d). Can be supplied multiple times, use:allto include all groups under the same species.--without: Exclude groups of optional-dependencies or dev-dependencies--no-default: Don't include dependencies from the default group (default:False)-d,--dev: Select dev dependencies--prod,--production: Unselect dev dependencies (default:True)
fix#
Fix the project problems according to the latest version of PDM
Positional Arguments:
problem: Fix the specific problem, or all if not given
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--dry-run: Only show the problems
import#
Import project metadata from other formats
Positional Arguments:
filename: The file name
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-d,--dev: import packages into dev dependencies-G,--group: Specify the target dependency group to import into-f,--format: Specify the file format explicitly
info#
Show the project information
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]--python: Show the interpreter path--where: Show the project root path--packages: Show the local packages root--env: Show PEP 508 environment markers--json: Dump the information in JSON
init#
Initialize a pyproject.toml for PDM
Positional Arguments:
template: Specify the project template, which can be a local path or a Git URLgenerator_args: Arguments passed to the generator
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--copier: Use Copier to generate project [not installed] (default:builtin)--cookiecutter: Use Cookiecutter to generate project [not installed] (default:builtin)-r,--overwrite: Overwrite existing files
Builtin Generator Options:
-n,--non-interactive: Don't ask questions but use default values--python: Specify the Python version/path to use--dist,--lib: Create a package for distribution--backend: Specify the build backend, which implies --dist--license: Specify the license (SPDX name)--project-version: Specify the project's version
install#
Install dependencies from lock file
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--override: Use the constraint file in pip-requirements format for overriding. [env var:PDM_OVERRIDE] This option can be used multiple times. See https://pip.pypa.io/en/stable/user_guide/#constraints-files--dry-run: Show the difference only and don't perform any action-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]--frozen-lockfile,--no-lock: Don't try to create or update the lockfile. [env var:PDM_FROZEN_LOCKFILE]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]--check: Check if the lock file is up to date and fail otherwise--plugins: Install the plugins specified inpyproject.toml
Install Options:
--no-editable: Install non-editable versions for all packages. [env var:PDM_NO_EDITABLE]--no-self: Don't install the project itself. [env var:PDM_NO_SELF]--fail-fast,-x: Abort on first installation error--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)
Dependencies Selection:
-G,--group,--withGROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with-d). Can be supplied multiple times, use:allto include all groups under the same species.--without: Exclude groups of optional-dependencies or dev-dependencies--no-default: Don't include dependencies from the default group (default:False)-d,--dev: Select dev dependencies--prod,--production: Unselect dev dependencies (default:True)
list#
List packages installed in the current working set
Positional Arguments:
patterns: Filter packages by patterns. e.g. pdm list requests- flask-. In --tree mode, only show the subtree of the matched packages.
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]--freeze: Show the installed dependencies in pip's requirements.txt format--tree,--graph: Display a tree of dependencies-r,--reverse: Reverse the dependency tree--resolve: Resolve all requirements to output licenses (instead of just showing those currently installed)--fields: Select information to output as a comma separated string. All fields: groups,homepage,licenses,location,name,version. (default:name,version,location)--sort: Sort the output using a given field name. If nothing is set, no sort is applied. Multiple fields can be combined with ','.--csv: Output dependencies in CSV document format--json: Output dependencies in JSON document format--markdown: Output dependencies and legal notices in markdown document format - best effort basis--include: Dependency groups to include in the output. By default all are included--exclude: Exclude dependency groups from the output
lock#
Resolve and lock dependencies
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)--override: Use the constraint file in pip-requirements format for overriding. [env var:PDM_OVERRIDE] This option can be used multiple times. See https://pip.pypa.io/en/stable/user_guide/#constraints-files-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--refresh: Refresh the content hash and file hashes in the lock file--check: Check if the lock file is up to date and quit--update-reuse: Reuse pinned versions already present in lock file if possible (default:all)--update-reuse-installed: Reuse installed packages if possible--exclude-newer: Exclude packages newer than the given UTC date in formatYYYY-MM-DD[THH:MM:SSZ]
Lock Target:
--python: The Python range to lock for. E.g.>=3.9,==3.12.*--platform: The platform to lock for. E.g.windows,linux,macos,manylinux_2_17_x86_64. See docs for available choices: http://pdm-project.org/en/latest/usage/lock-targets/--implementation: The Python implementation to lock for. E.g.cpython,pypy,pyston--append: Append the result to the current lock file
Lock Strategy:
--strategy,-SSTRATEGY: Specify lock strategy (cross_platform, static_urls, direct_minimal_versions, inherit_metadata). Add 'no_' prefix to disable. Can be supplied multiple times or split by comma.--no-cross-platform: [DEPRECATED] Only lock packages for the current platform--static-urls: [DEPRECATED] Store static file URLs in the lockfile--no-static-urls: [DEPRECATED] Do not store static file URLs in the lockfile
Dependencies Selection:
-G,--group,--withGROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with-d). Can be supplied multiple times, use:allto include all groups under the same species.--without: Exclude groups of optional-dependencies or dev-dependencies--no-default: Don't include dependencies from the default group (default:False)-d,--dev: Select dev dependencies--prod,--production: Unselect dev dependencies (default:True)
outdated#
Check for outdated packages and list the latest versions on indexes.
Positional Arguments:
patterns: The packages to check
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--json: Output in JSON format (default:table)--include-sub: Include sub-dependencies
publish#
Build and publish the project to PyPI
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.-r,--repository: The repository name or url to publish the package to [env var:PDM_PUBLISH_REPO]-u,--username: The username to access the repository [env var:PDM_PUBLISH_USERNAME]-P,--password: The password to access the repository [env var:PDM_PUBLISH_PASSWORD]-S,--sign: Upload the package with PGP signature-i,--identity: GPG identity used to sign files.-c,--comment: The comment to include with the distribution file.--no-build: Don't build the package before publishing (default:False)-d,--dest: The directory to upload the package from (default:dist)--skip-existing: Skip uploading files that already exist. This may not work with some repository implementations.--no-very-ssl: Disable SSL verification--ca-certs: The path to a PEM-encoded Certificate Authority bundle to use for publish server validation [env var:PDM_PUBLISH_CA_CERTS]
python#
Manage installed Python interpreters
Options:
-h,--help: Show this help message and exit.
Commands:
list#
List all Python interpreters installed with PDM
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
remove#
Remove a Python interpreter installed with PDM
Positional Arguments:
version: The Python version to remove. E.g. cpython@3.10.3
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
install#
Install a Python interpreter with PDM
Positional Arguments:
version: The Python version to install (e.g. cpython@3.10.3). If left empty, highest cPython version that matches this platform/arch is installed. Ifpyproject.tomlwith requires-python is available, this is considered as well.
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--list,-l: List all available Python versions--min: Use minimum instead of highest version for installation ifversionis left empty
link#
Link an external Python interpreter to PDM
Positional Arguments:
interpreter: The path to the Python interpreter to link
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--name: The name of the link
py#
Manage installed Python interpreters
Options:
-h,--help: Show this help message and exit.
Commands:
list#
List all Python interpreters installed with PDM
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
remove#
Remove a Python interpreter installed with PDM
Positional Arguments:
version: The Python version to remove. E.g. cpython@3.10.3
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
install#
Install a Python interpreter with PDM
Positional Arguments:
version: The Python version to install (e.g. cpython@3.10.3). If left empty, highest cPython version that matches this platform/arch is installed. Ifpyproject.tomlwith requires-python is available, this is considered as well.
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--list,-l: List all available Python versions--min: Use minimum instead of highest version for installation ifversionis left empty
link#
Link an external Python interpreter to PDM
Positional Arguments:
interpreter: The path to the Python interpreter to link
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--name: The name of the link
remove#
Remove packages from pyproject.toml
Positional Arguments:
packages: Specify the packages to remove
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--dry-run: Show the difference only and don't perform any action-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]--override: Use the constraint file in pip-requirements format for overriding. [env var:PDM_OVERRIDE] This option can be used multiple times. See https://pip.pypa.io/en/stable/user_guide/#constraints-files--frozen-lockfile,--no-lock: Don't try to create or update the lockfile. [env var:PDM_FROZEN_LOCKFILE]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]-d,--dev: Remove packages from dev dependencies-G,--group: Specify the target dependency group to remove from--no-sync: Only writepyproject.tomland do not uninstall packages (default:False)
Install Options:
--no-editable: Install non-editable versions for all packages. [env var:PDM_NO_EDITABLE]--no-self: Don't install the project itself. [env var:PDM_NO_SELF]--fail-fast,-x: Abort on first installation error--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)
run#
Run commands or scripts with local packages loaded
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]-l,--list: Show all available scripts defined inpyproject.toml-j,--json: Output all scripts infos in JSON
Execution Parameters:
-s,--site-packages: Load site-packages from the selected interpreter--recreate: Recreate the script environment for self-contained scriptsscript: The command to runargs: Arguments that will be passed to the command
search#
Search for PyPI packages
Positional Arguments:
query: Query string to search
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
self#
Manage the PDM program itself (previously known as plugin)
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
Commands:
list#
List all packages installed with PDM
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--plugins: List plugins only
add#
Install packages to the PDM's environment
Positional Arguments:
packages: Specify one or many package names, each package can have a version specifier
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--pip-args: Arguments that will be passed to pip install
remove#
Remove packages from PDM's environment
Positional Arguments:
packages: Specify one or many package names
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--pip-args: Arguments that will be passed to pip uninstall-y,--yes: Answer yes on the question
update#
Update PDM itself
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--head: Update to the latest commit on the main branch--pre: Update to the latest prerelease version--no-frozen-deps: Do not install frozen dependency versions (default:False)--pip-args: Additional arguments that will be passed to pip install
plugin#
Manage the PDM program itself (previously known as plugin)
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
Commands:
list#
List all packages installed with PDM
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--plugins: List plugins only
add#
Install packages to the PDM's environment
Positional Arguments:
packages: Specify one or many package names, each package can have a version specifier
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--pip-args: Arguments that will be passed to pip install
remove#
Remove packages from PDM's environment
Positional Arguments:
packages: Specify one or many package names
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--pip-args: Arguments that will be passed to pip uninstall-y,--yes: Answer yes on the question
update#
Update PDM itself
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output--head: Update to the latest commit on the main branch--pre: Update to the latest prerelease version--no-frozen-deps: Do not install frozen dependency versions (default:False)--pip-args: Additional arguments that will be passed to pip install
show#
Show the package information
Positional Arguments:
package: Specify the package name, or show this package if not given
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]--name: Show name--version: Show version--summary: Show summary--license: Show license--platform: Show platform--keywords: Show keywords
sync#
Synchronize the current working set with lock file
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--dry-run: Show the difference only and don't perform any action-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--clean: Clean packages not in the lockfile--only-keep,--clean-unselected: Only keep the selected packages--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]-r,--reinstall: Force reinstall existing dependencies
Install Options:
--no-editable: Install non-editable versions for all packages. [env var:PDM_NO_EDITABLE]--no-self: Don't install the project itself. [env var:PDM_NO_SELF]--fail-fast,-x: Abort on first installation error--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)
Dependencies Selection:
-G,--group,--withGROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with-d). Can be supplied multiple times, use:allto include all groups under the same species.--without: Exclude groups of optional-dependencies or dev-dependencies--no-default: Don't include dependencies from the default group (default:False)-d,--dev: Select dev dependencies--prod,--production: Unselect dev dependencies (default:True)
update#
Update package(s) in pyproject.toml
Update Strategy:
--update-reuse: Reuse pinned versions already present in lock file if possible--update-eager: Try to update the packages and their dependencies recursively--update-all: Update all dependencies and sub-dependencies--update-reuse-installed: Reuse installed packages if possible
Save Strategy:
--save-compatible: Save compatible version specifiers--save-wildcard: Save wildcard version specifiers--save-exact: Save exact version specifiers--save-minimum: Save minimum version specifiers
Positional Arguments:
packages: If packages are given, only update them
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-L,--lockfile: Specify another lockfile path. Default:pdm.lock. [env var:PDM_LOCKFILE]--frozen-lockfile,--no-lock: Don't try to create or update the lockfile. [env var:PDM_FROZEN_LOCKFILE]--override: Use the constraint file in pip-requirements format for overriding. [env var:PDM_OVERRIDE] This option can be used multiple times. See https://pip.pypa.io/en/stable/user_guide/#constraints-files--pre,--prerelease: Allow prereleases to be pinned--stable: Only allow stable versions to be pinned (default:True)-u,--unconstrained: Ignore the version constraints inpyproject.tomland overwrite with new ones from the resolution result-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.--venvNAME: Run the command in the virtual environment with the given key. [env var:PDM_IN_VENV]-t,--top: Only update those listed inpyproject.toml--dry-run,--outdated: Show the difference only without modifying the lockfile content--no-sync: Only update lock file but do not sync packages (default:False)
Install Options:
--no-editable: Install non-editable versions for all packages. [env var:PDM_NO_EDITABLE]--no-self: Don't install the project itself. [env var:PDM_NO_SELF]--fail-fast,-x: Abort on first installation error--no-isolation: Disable isolation when building a source distribution that follows PEP 517, as in: build dependencies specified by PEP 518 must be already installed if this option is used.--config-setting,-C: Pass options to the builder. options with a value must be specified after "=":--config-setting=key(=value)or-Ckey(=value)
Dependencies Selection:
-G,--group,--withGROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with-d). Can be supplied multiple times, use:allto include all groups under the same species.--without: Exclude groups of optional-dependencies or dev-dependencies--no-default: Don't include dependencies from the default group (default:False)-d,--dev: Select dev dependencies--prod,--production: Unselect dev dependencies
use#
Use the given python version or path as base interpreter. If not found, PDM will try to install one.
Positional Arguments:
python: Specify the Python version or path
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-g,--global: Use the global project, supply the project root with-poption-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]-k,--skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:allto skip all hooks. Use:preand:postto skip all pre or post hooks.-f,--first: Select the first matched interpreter - no auto install--auto-install-min: Ifpythonargument not given, auto install minimal best match - otherwise has no effect--auto-install-max: Ifpythonargument not given, auto install maximum best match - otherwise has no effect-i,--ignore-remembered: Ignore the remembered selection--venv: Use the interpreter in the virtual environment with the given name
venv#
Virtualenv management
Options:
-h,--help: Show this help message and exit.-p,--project: Specify another path as the project root, which changes the base ofpyproject.tomland__pypackages__[env var:PDM_PROJECT]--path: Show the path to the given virtualenv--python: Show the python interpreter path for the given virtualenv
Commands:
create#
Create a virtualenv
Positional Arguments:
python: Specify which python should be used to create the virtualenvvenv_args: Additional arguments that will be passed to the backend
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-w,--with: Specify the backend to create the virtualenv-f,--force: Recreate if the virtualenv already exists-n,--name: Specify the name of the virtualenv--with-pip: Install pip with the virtualenv
list#
List all virtualenvs associated with this project
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
remove#
Remove the virtualenv with the given name
Positional Arguments:
env: The key of the virtualenv
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-y,--yes: Answer yes on the following question
activate#
Print the command to activate the virtualenv with the given name
Positional Arguments:
env: The key of the virtualenv
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output
purge#
Purge selected/all created Virtualenvs
Options:
-h,--help: Show this help message and exit.-v,--verbose: Use-vfor detailed output and-vvfor more detailed-q,--quiet: Suppress output-f,--force: Force purging without prompting for confirmation-i,--interactive: Interactively purge selected Virtualenvs