Poetry CLI Command Reference

Table of Contents

Poetry Drill

Core Commands

What does the `about` command do?

Answer: Shows information about Poetry.

What does the `add` command do?

Answer: Adds a new dependency to pyproject.toml.

What does the `build` command do?

Answer: Builds a package, as a tarball and a wheel by default.

What does the `check` command do?

Answer: Validates the content of the pyproject.toml file and its consistency with the poetry.lock file.

What does the `config` command do?

Answer: Manages configuration settings.

What does the `export` command do?

Answer: Exports the lock file to alternative formats.

What does the `help` command do?

Answer: Displays help for a command.

What does the `init` command do?

Answer: Creates a basic pyproject.toml file in the current directory.

What does the `install` command do?

Answer: Installs the project dependencies.

What does the `list` command do?

Answer: Lists commands.

What does the `lock` command do?

Answer: Locks the project dependencies.

What does the `new` command do?

Answer: Creates a new Python project at <path>.

What does the `publish` command do?

Answer: Publishes a package to a remote repository.

What does the `remove` command do?

Answer: Removes a package from the project dependencies.

What does the `run` command do?

Answer: Runs a command in the appropriate environment.

What does the `search` command do?

Answer: Searches for packages on remote repositories.

What does the `shell` command do?

Answer: Spawns a shell within the virtual environment.

What does the `show` command do?

Answer: Shows information about packages.

What does the `update` command do?

Answer: Update the dependencies as according to the pyproject.toml file.

What does the `version` command do?

Answer: Shows the version of the project or bumps it when a valid bump rule is provided.

Cache Commands

What does the `cache clear` command do?

Answer: Clears a Poetry cache by name.

What does the `cache list` command do?

Answer: List Poetry's caches.

Debug Commands

What does the `debug info` command do?

Answer: Shows debug information.

What does the `debug resolve` command do?

Answer: Debugs dependency resolution.

Environment Commands

What does the `env info` command do?

Answer: Displays information about the current environment.

What does the `env list` command do?

Answer: Lists all virtualenvs associated with the current project.

What does the `env remove` command do?

Answer: Remove virtual environments associated with the project.

What does the `env use` command do?

Answer: Activates or creates a new virtualenv for the current project.

Self Commands

What does the `self add` command do?

Answer: Add additional packages to Poetry's runtime environment.

What does the `self install` command do?

Answer: Install locked packages (incl. addons) required by this Poetry installation.

What does the `self lock` command do?

Answer: Lock the Poetry installation's system requirements.

What does the `self remove` command do?

Answer: Remove additional packages from Poetry's runtime environment.

What does the `self show` command do?

Answer: Show packages from Poetry's runtime environment.

What does the `self show plugins` command do?

Answer: Shows information about the currently installed plugins.

What does the `self update` command do?

Answer: Updates Poetry to the latest version.

Source Commands

What does the `source add` command do?

Answer: Add source configuration for project.

What does the `source remove` command do?

Answer: Remove source configured for the project.

What does the `source show` command do?

Answer: Show information about sources configured for the project.

Author: Jason Walsh

j@wal.sh

Last Updated: 2024-08-14 06:08:50