Linux command
poetry-config 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
List configuration
poetry config --list
Set configuration
poetry config [key] [value]
Set repository URL
poetry config repositories.[name] [https://repo.example.com]
Set PyPI token
poetry config pypi-token.pypi [token]
Unset configuration
poetry config --unset [key]
说明
poetry config reads and writes Poetry configuration settings including virtual environment preferences, repository URLs, and authentication tokens. Use --list to view all current settings. Settings are stored globally by default. The --local flag creates a poetry.toml file in the project directory for project-specific overrides. Common settings include `virtualenvs.in-project`, `repositories`, and `pypi-token`. Use --unset to remove a configuration key.
参数
- --list
- Show all configuration.
- --unset
- Remove configuration.
- --local
- Project-specific config.
FAQ
What is the poetry-config command used for?
poetry config reads and writes Poetry configuration settings including virtual environment preferences, repository URLs, and authentication tokens. Use --list to view all current settings. Settings are stored globally by default. The --local flag creates a poetry.toml file in the project directory for project-specific overrides. Common settings include `virtualenvs.in-project`, `repositories`, and `pypi-token`. Use --unset to remove a configuration key.
How do I run a basic poetry-config example?
Run `poetry config --list` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --list do in poetry-config?
Show all configuration.