From 0c6117f5da90bf69c033ab98a6db9ea484b5a515 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 24 Sep 2024 11:45:33 -0500 Subject: [PATCH] Unhide the `--directory` option (#7653) --- crates/uv-cli/src/lib.rs | 8 +- crates/uv/tests/help.rs | 25 ++++ docs/reference/cli.md | 306 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 337 insertions(+), 2 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 9399f94e0c2a..affebc37f30e 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -234,7 +234,11 @@ pub struct GlobalArgs { pub no_progress: bool, /// Change to the given directory prior to running the command. - #[arg(global = true, long, hide = true)] + /// + /// Relative paths are resolved with the given directory as the base. + /// + /// See `--project` to only change the project root directory. + #[arg(global = true, long)] pub directory: Option, /// Run the command within the given project directory. @@ -246,6 +250,8 @@ pub struct GlobalArgs { /// Other command-line arguments (such as relative paths) will be resolved relative /// to the current working directory. /// + /// See `--directory` to change the working directory entirely. + /// /// This setting has no effect when used in the `uv pip` interface. #[arg(global = true, long)] pub project: Option, diff --git a/crates/uv/tests/help.rs b/crates/uv/tests/help.rs index 40139fda1107..e5d229dd5a49 100644 --- a/crates/uv/tests/help.rs +++ b/crates/uv/tests/help.rs @@ -56,6 +56,7 @@ fn help() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] @@ -122,6 +123,7 @@ fn help_flag() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] @@ -187,6 +189,7 @@ fn help_short_flag() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] @@ -339,6 +342,13 @@ fn help_subcommand() { For example, spinners or progress bars. + --directory + Change to the given directory prior to running the command. + + Relative paths are resolved with the given directory as the base. + + See `--project` to only change the project root directory. + --project Run the command within the given project directory. @@ -349,6 +359,8 @@ fn help_subcommand() { Other command-line arguments (such as relative paths) will be resolved relative to the current working directory. + See `--directory` to change the working directory entirely. + This setting has no effect when used in the `uv pip` interface. --config-file @@ -500,6 +512,13 @@ fn help_subsubcommand() { For example, spinners or progress bars. + --directory + Change to the given directory prior to running the command. + + Relative paths are resolved with the given directory as the base. + + See `--project` to only change the project root directory. + --project Run the command within the given project directory. @@ -510,6 +529,8 @@ fn help_subsubcommand() { Other command-line arguments (such as relative paths) will be resolved relative to the current working directory. + See `--directory` to change the working directory entirely. + This setting has no effect when used in the `uv pip` interface. --config-file @@ -580,6 +601,7 @@ fn help_flag_subcommand() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] @@ -633,6 +655,7 @@ fn help_flag_subsubcommand() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] @@ -775,6 +798,7 @@ fn help_with_global_option() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] @@ -878,6 +902,7 @@ fn help_with_no_pager() { certificate store [env: UV_NATIVE_TLS=] --offline Disable network access --no-progress Hide all progress outputs + --directory Change to the given directory prior to running the command --project Run the command within the given project directory --config-file The path to a `uv.toml` file to use for configuration [env: UV_CONFIG_FILE=] diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 414143434c22..abf9a033aa1b 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -116,6 +116,12 @@ uv run [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -309,6 +315,8 @@ uv run [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use for the run environment.

@@ -444,6 +452,12 @@ uv init [OPTIONS] [PATH]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--lib

Create a project for a library.

@@ -509,6 +523,8 @@ uv init [OPTIONS] [PATH]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use to determine the minimum supported Python version.

@@ -616,6 +632,12 @@ uv add [OPTIONS] >
--dev

Add the requirements as development dependencies

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--editable

Add the requirements as editable

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -787,6 +809,8 @@ uv add [OPTIONS] >

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use for resolving and syncing.

@@ -932,6 +956,12 @@ uv remove [OPTIONS] ...
--dev

Remove the packages from the development dependencies

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -1091,6 +1121,8 @@ uv remove [OPTIONS] ...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use for resolving and syncing.

@@ -1222,6 +1254,12 @@ uv sync [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -1411,6 +1449,8 @@ uv sync [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use for the project environment.

@@ -1523,6 +1563,12 @@ uv lock [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -1676,6 +1722,8 @@ uv lock [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use during resolution.

@@ -1790,6 +1838,12 @@ uv export [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -1987,6 +2041,8 @@ uv export [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use during resolution.

@@ -2094,6 +2150,12 @@ uv tree [OPTIONS]
--depth, -d depth

Maximum display depth of the dependency tree

[default: 255]

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -2255,6 +2317,8 @@ uv tree [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--prune prune

Prune the given package from the display of the dependency tree

@@ -2457,6 +2521,12 @@ uv tool run [OPTIONS] [COMMAND]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -2608,6 +2678,8 @@ uv tool run [OPTIONS] [COMMAND]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use to build the run environment.

@@ -2737,6 +2809,12 @@ uv tool install [OPTIONS]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--editable, -e
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -2886,6 +2964,8 @@ uv tool install [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use to build the tool environment.

@@ -3013,6 +3093,12 @@ uv tool upgrade [OPTIONS] ...

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -3158,6 +3244,8 @@ uv tool upgrade [OPTIONS] ...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -3242,6 +3330,12 @@ uv tool list [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3273,6 +3367,8 @@ uv tool list [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--quiet, -q

Do not print any output

@@ -3331,6 +3427,12 @@ uv tool uninstall [OPTIONS] ...

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3364,6 +3466,8 @@ uv tool uninstall [OPTIONS] ...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -3432,6 +3536,12 @@ uv tool update-shell [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3465,6 +3575,8 @@ uv tool update-shell [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -3551,6 +3663,12 @@ uv tool dir [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3584,6 +3702,8 @@ uv tool dir [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -3726,6 +3846,12 @@ uv python list [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3763,6 +3889,8 @@ uv python list [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -3845,6 +3973,12 @@ uv python install [OPTIONS] [TARGETS]...

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3878,6 +4012,8 @@ uv python install [OPTIONS] [TARGETS]...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -3956,6 +4092,12 @@ uv python find [OPTIONS] [REQUEST]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -3993,6 +4135,8 @@ uv python find [OPTIONS] [REQUEST]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -4076,6 +4220,12 @@ uv python pin [OPTIONS] [REQUEST]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -4113,6 +4263,8 @@ uv python pin [OPTIONS] [REQUEST]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -4185,6 +4337,12 @@ uv python dir [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -4218,6 +4376,8 @@ uv python dir [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -4290,6 +4450,12 @@ uv python uninstall [OPTIONS] ...

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -4323,6 +4489,8 @@ uv python uninstall [OPTIONS] ...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -4472,6 +4640,12 @@ uv pip compile [OPTIONS] ...

Used to reflect custom build scripts and commands that wrap uv pip compile.

May also be set with the UV_CUSTOM_COMPILE_COMMAND environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--emit-build-options

Include --no-binary and --only-binary entries in the generated output file

--emit-find-links

Include --find-links entries in the generated output file

@@ -4661,6 +4835,8 @@ uv pip compile [OPTIONS] ...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python python

The Python interpreter to use during resolution.

@@ -4862,6 +5038,12 @@ uv pip sync [OPTIONS] ...

This is equivalent to pip’s --constraint option.

May also be set with the UV_CONSTRAINT environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--dry-run

Perform a dry run, i.e., don’t actually install anything but resolve the dependencies and print the resulting plan

--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

@@ -4992,6 +5174,8 @@ uv pip sync [OPTIONS] ...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter into which packages should be installed.

@@ -5190,6 +5374,12 @@ uv pip install [OPTIONS] |--editable This is equivalent to pip’s --constraint option.

May also be set with the UV_CONSTRAINT environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--dry-run

Perform a dry run, i.e., don’t actually install anything but resolve the dependencies and print the resulting plan

--editable, -e editable

Install the editable package based on the provided local file path

@@ -5362,6 +5552,8 @@ uv pip install [OPTIONS] |--editable Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter into which packages should be installed.

@@ -5557,6 +5749,12 @@ uv pip uninstall [OPTIONS] >

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--keyring-provider keyring-provider

Attempt to use keyring for authentication for remote requirements files.

@@ -5606,6 +5804,8 @@ uv pip uninstall [OPTIONS] >

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter from which packages should be uninstalled.

@@ -5686,6 +5886,12 @@ uv pip freeze [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-editable

Exclude any editable packages from output

--help, -h

Display the concise help for this command

@@ -5721,6 +5927,8 @@ uv pip freeze [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter for which packages should be listed.

@@ -5799,6 +6007,12 @@ uv pip list [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--editable, -e

Only include editable projects

--exclude exclude

Exclude the specified package(s) from the output

@@ -5850,6 +6064,8 @@ uv pip list [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter for which packages should be listed.

@@ -5934,6 +6150,12 @@ uv pip show [OPTIONS] [PACKAGE]...

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -5967,6 +6189,8 @@ uv pip show [OPTIONS] [PACKAGE]...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to find the package in.

@@ -6048,6 +6272,12 @@ uv pip tree [OPTIONS]
--depth, -d depth

Maximum display depth of the dependency tree

[default: 255]

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--invert

Show the reverse dependencies for the given package. This flag will invert the tree and display the packages that depend on the given package

@@ -6087,6 +6317,8 @@ uv pip tree [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--prune prune

Prune the given package from the display of the dependency tree

@@ -6169,6 +6401,12 @@ uv pip check [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -6202,6 +6440,8 @@ uv pip check [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter for which packages should be checked.

@@ -6311,6 +6551,12 @@ uv venv [OPTIONS] [PATH]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -6421,6 +6667,8 @@ uv venv [OPTIONS] [PATH]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--prompt prompt

Provide an alternative prompt prefix for the virtual environment.

@@ -6544,6 +6792,12 @@ uv build [OPTIONS] [SRC]

May also be set with the UV_CONFIG_FILE environment variable.

--config-setting, -C config-setting

Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--exclude-newer exclude-newer

Limit candidate packages to those that were uploaded prior to the given date.

Accepts both RFC 3339 timestamps (e.g., 2006-12-02T02:07:43Z) and local dates in the same format (e.g., 2006-12-02) in your system’s configured time zone.

@@ -6701,6 +6955,8 @@ uv build [OPTIONS] [SRC]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python, -p python

The Python interpreter to use for the build environment.

@@ -6997,6 +7253,12 @@ uv cache clean [OPTIONS] [PACKAGE]...

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -7030,6 +7292,8 @@ uv cache clean [OPTIONS] [PACKAGE]...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -7098,6 +7362,12 @@ uv cache prune [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -7131,6 +7401,8 @@ uv cache prune [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -7201,6 +7473,12 @@ uv cache dir [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -7234,6 +7512,8 @@ uv cache dir [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -7296,6 +7576,12 @@ uv version [OPTIONS]

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -7329,6 +7615,8 @@ uv version [OPTIONS]

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.

@@ -7375,12 +7663,20 @@ uv generate-shell-completion [OPTIONS]

Options

-
--project project

Run the command within the given project directory.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+ +
--project project

Run the command within the given project directory.

All pyproject.toml, uv.toml, and .python-version files will be discovered by walking up the directory tree from the project root, as will the project’s virtual environment (.venv).

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

@@ -7423,6 +7719,12 @@ uv help [OPTIONS] [COMMAND]...

While uv configuration can be included in a pyproject.toml file, it is not allowed in this context.

May also be set with the UV_CONFIG_FILE environment variable.

+
--directory directory

Change to the given directory prior to running the command.

+ +

Relative paths are resolved with the given directory as the base.

+ +

See --project to only change the project root directory.

+
--help, -h

Display the concise help for this command

--native-tls

Whether to load TLS certificates from the platform’s native certificate store.

@@ -7458,6 +7760,8 @@ uv help [OPTIONS] [COMMAND]...

Other command-line arguments (such as relative paths) will be resolved relative to the current working directory.

+

See --directory to change the working directory entirely.

+

This setting has no effect when used in the uv pip interface.

--python-preference python-preference

Whether to prefer uv-managed or system Python installations.