Skip to content

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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -I, --ignore-python: Ignore the Python path saved in.pdm-python. [env var: PDM_IGNORE_SAVED_PYTHON]
  • --pep582 SHELL: Print the command line to be eval'd by the shell

Commands:

add#

Add package(s) to pyproject.toml and install them

Package Arguments:

  • -e, --editable: Specify editable packages
  • packages: Specify packages

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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]
  • --save-compatible: Save compatible version specifiers
  • --save-wildcard: Save wildcard version specifiers
  • --save-exact: Save exact version specifiers
  • --save-minimum: Save minimum version specifiers
  • --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
  • --pre, --prerelease: Allow prereleases to be pinned
  • --stable: Only allow stable versions to be pinned (default: True)
  • -u, --unconstrained: Ignore the version constraint of packages
  • --dry-run: Show the difference only and don't perform any action
  • --venv NAME: 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:all to skip all hooks. Use:pre and:post to 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.toml and 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.

build#

Build artifacts for distribution

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --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)
  • --config-setting, -C: Pass options to the backend. options with a value must be specified after "=": --config-setting=--opt(=value) or -C--opt(=value)

cache#

Control the caches of PDM

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 from SHELL env var.

Options:

  • -h, --help: Show this help message and exit.

config#

Display the current configuration

Positional Arguments:

  • key: Config key
  • value: Config value

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • -L, --lockfile: Specify another lockfile path. Default:pdm.lock. [env var: PDM_LOCKFILE]
  • -f, --format: Specify the export file format (default: requirements)
  • --no-hashes, --without-hashes: Don't include artifact hashes (default: False)
  • --no-markers: Don't include platform markers (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 GROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with -d). Can be supplied multiple times, use:all to include all groups under the same species.
  • --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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • --venv NAME: 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 URL
  • generator_args: Arguments passed to the generator

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • -k, --skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:all to skip all hooks. Use:pre and:post to 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

install#

Install dependencies from lock file

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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]
  • --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:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --venv NAME: 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.

Dependencies Selection:

  • -G, --group GROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with -d). Can be supplied multiple times, use:all to include all groups under the same species.
  • --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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • --venv NAME: 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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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.
  • -k, --skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --refresh: Don't update pinned versions, only refresh 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

Lock Strategy:

  • --strategy, -S STRATEGY: 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 GROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with -d). Can be supplied multiple times, use:all to include all groups under the same species.
  • --no-default: Don't include dependencies from the default group (default: False)
  • -d, --dev: Select dev dependencies
  • --prod, --production: Unselect dev dependencies (default: True)

publish#

Build and publish the project to PyPI

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • -k, --skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:all to skip all hooks. Use:pre and:post to 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)
  • --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]

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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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]
  • --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:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --venv NAME: 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.toml and 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.

run#

Run commands or scripts with local packages loaded

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • -k, --skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --venv NAME: 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
  • script: The command to run
  • args: Arguments that will be passed to the command

Search for PyPI packages

Positional Arguments:

  • query: Query string to search

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • --head: Update to the latest commit on the main branch
  • --pre: Update to the latest prerelease version
  • --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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • --head: Update to the latest commit on the main branch
  • --pre: Update to the latest prerelease version
  • --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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • --venv NAME: 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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --clean: Clean packages not in the lockfile
  • --only-keep: Only keep the selected packages
  • --venv NAME: 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.

Dependencies Selection:

  • -G, --group GROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with -d). Can be supplied multiple times, use:all to include all groups under the same species.
  • --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

Positional Arguments:

  • packages: If packages are given, only update them

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __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]
  • --save-compatible: Save compatible version specifiers
  • --save-wildcard: Save wildcard version specifiers
  • --save-exact: Save exact version specifiers
  • --save-minimum: Save minimum version specifiers
  • --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
  • --pre, --prerelease: Allow prereleases to be pinned
  • --stable: Only allow stable versions to be pinned (default: True)
  • -u, --unconstrained: Ignore the version constraint of packages
  • -k, --skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • --venv NAME: 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.

Dependencies Selection:

  • -G, --group GROUP: Select group of optional-dependencies separated by comma or dev-dependencies (with -d). Can be supplied multiple times, use:all to include all groups under the same species.
  • --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

Positional Arguments:

  • python: Specify the Python version or path

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -g, --global: Use the global project, supply the project root with -p option
  • -p, --project: Specify another path as the project root, which changes the base ofpyproject.toml and __pypackages__ [env var: PDM_PROJECT]
  • -k, --skip: Skip some tasks and/or hooks by their comma-separated names. Can be supplied multiple times. Use:all to skip all hooks. Use:pre and:post to skip all pre or post hooks.
  • -f, --first: Select the first matched interpreter
  • -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.toml and __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 virtualenv
  • venv_args: Additional arguments that will be passed to the backend

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for 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 -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output

purge#

Purge selected/all created Virtualenvs

Options:

  • -h, --help: Show this help message and exit.
  • -v, --verbose: Use -v for detailed output and -vv for more detailed
  • -q, --quiet: Suppress output
  • -f, --force: Force purging without prompting for confirmation
  • -i, --interactive: Interactively purge selected Virtualenvs