Files
cheatsheet-tldr/tldr/poetry-init
2025-11-07 00:20:59 +00:00

34 lines
812 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# poetry init
> Create a basic `pyproject.toml` file interactively.
> More information: <https://python-poetry.org/docs/cli/#init>.
- Create a `pyproject.toml` file interactively:
`poetry init`
- Create a `pyproject.toml` file with prefilled values:
`poetry init --name {{package_name}} --author "{{author_name <email@example.com>}}"`
- Create a `pyproject.toml` file without interaction (using defaults):
`poetry init {{[-n|--no-interaction]}}`
- Create a `pyproject.toml` file and add a dependency:
`poetry init --dependency {{package_name}}`
- Create a `pyproject.toml` file and add a development dependency:
`poetry init --dev-dependency {{package_name}}`
- Display help:
`poetry init {{[-h|--help]}}`