Linux command
uv-add 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Add dependency
uv add [package]
Add with version constraint
uv add [package]>=[version]
Add dev dependency
uv add --dev [package]
Add optional dependency
uv add --optional [group] [package]
说明
uv add adds dependencies to a Python project. Updates pyproject.toml and uv.lock. Automatically syncs the virtual environment with new dependencies. Part of uv, an extremely fast Python package manager.
参数
- --dev
- Add as development dependency.
- --optional _group_
- Add to optional group.
- --frozen
- Don't update lockfile.
- --no-sync
- Don't sync environment.
FAQ
What is the uv-add command used for?
uv add adds dependencies to a Python project. Updates pyproject.toml and uv.lock. Automatically syncs the virtual environment with new dependencies. Part of uv, an extremely fast Python package manager.
How do I run a basic uv-add example?
Run `uv add [package]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does --dev do in uv-add?
Add as development dependency.