diff --git a/crates/uv-dev/src/generate_cli_reference.rs b/crates/uv-dev/src/generate_cli_reference.rs index eec835e27cf7..7beac5963334 100644 --- a/crates/uv-dev/src/generate_cli_reference.rs +++ b/crates/uv-dev/src/generate_cli_reference.rs @@ -13,6 +13,15 @@ use crate::ROOT_DIR; use uv_cli::Cli; +const REPLACEMENTS: &[(&str, &str)] = &[ + // Replace suggestions to use `uv help python` with a link to the + // `uv python` section + ( + "uv help python", + "uv python", + ), +]; + #[derive(clap::Args)] pub(crate) struct Args { /// Write the generated output to stdout (rather than to `settings.md`). @@ -84,6 +93,10 @@ fn generate() -> String { output.push_str("# CLI Reference\n\n"); generate_command(&mut output, &uv, &mut parents); + for (value, replacement) in REPLACEMENTS { + output = output.replace(value, replacement); + } + output } diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 63060b510ade..a92dc5490be8 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -195,7 +195,7 @@ uv run [OPTIONS]

If the interpreter request is satisfied by a discovered environment, the environment will be used.

-

See uv help python to view supported request formats.

+

See uv python to view supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -279,7 +279,7 @@ uv init [OPTIONS] [PATH]
--python, -p python

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

-

See uv help python to view supported request formats.

+

See uv python to view supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -464,7 +464,7 @@ uv add [OPTIONS] ...
--python, -p python

The Python interpreter to use for resolving and syncing.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -641,7 +641,7 @@ uv remove [OPTIONS] ...
--python, -p python

The Python interpreter to use for resolving and syncing.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -818,7 +818,7 @@ uv sync [OPTIONS]

If a Python interpreter in a virtual environment is provided, the packages will not be synced to the given environment. The interpreter will be used to create a virtual environment in the project.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -989,7 +989,7 @@ uv lock [OPTIONS]

The interpreter is also used as the fallback value for the minimum Python version if requires-python is not set.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -1210,7 +1210,7 @@ uv tree [OPTIONS]

By default, the tree is filtered to match the platform as reported by the Python interpreter. Use --universal to display the tree for all platforms, or use --python-version or --python-platform to override a subset of markers.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -1411,7 +1411,7 @@ uv tool run [OPTIONS] [COMMAND]
--python, -p python

The Python interpreter to use to build the run environment.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -1588,7 +1588,7 @@ uv tool install [OPTIONS]
--python, -p python

The Python interpreter to use to build the tool environment.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -2013,7 +2013,7 @@ uv python install [OPTIONS] [TARGETS]...

If not provided, the requested Python version(s) will be read from the .python-versions or .python-version files. If neither file is present, uv will check if it has installed any Python versions. If not, it will install the latest stable version of Python.

-

See uv help python to view supported request formats.

+

See uv python to view supported request formats.

@@ -2079,7 +2079,7 @@ uv python find [OPTIONS] [REQUEST]
REQUEST

The Python request.

-

See uv help python to view supported request formats.

+

See uv python to view supported request formats.

@@ -2147,7 +2147,7 @@ uv python pin [OPTIONS] [REQUEST]

uv supports more formats than other tools that read .python-version files, i.e., pyenv. If compatibility with those tools is needed, only use version numbers instead of complex requests such as cpython@3.10.

-

See uv help python to view supported request formats.

+

See uv python to view supported request formats.

@@ -2271,7 +2271,7 @@ uv python uninstall [OPTIONS] ...
TARGETS

The Python version(s) to uninstall.

-

See uv help python to view supported request formats.

+

See uv python to view supported request formats.

@@ -2523,7 +2523,7 @@ uv pip compile [OPTIONS] ...

The interpreter is also used to determine the default minimum Python version, unless --python-version is provided.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--no-binary no-binary

Don’t install pre-built wheels.

@@ -2739,7 +2739,7 @@ uv pip sync [OPTIONS] ...

By default, syncing requires a virtual environment. An path to an alternative Python can be provided, but it is only recommended in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--target target

Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory

@@ -3001,7 +3001,7 @@ uv pip install [OPTIONS] |--editable By default, installation requires a virtual environment. An path to an alternative Python can be provided, but it is only recommended in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--target target

Install packages into the specified directory, rather than into the virtual or system Python environment. The packages will be installed at the top-level of the directory

@@ -3136,7 +3136,7 @@ uv pip uninstall [OPTIONS] >

By default, uninstallation requires a virtual environment. An path to an alternative Python can be provided, but it is only recommended in continuous integration (CI) environments and should be used with caution, as it can modify the system Python installation.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--keyring-provider keyring-provider

Attempt to use keyring for authentication for remote requirements files.

@@ -3217,7 +3217,7 @@ uv pip freeze [OPTIONS]

By default, uv lists packages in a virtual environment but will show packages in a system Python environment if no virtual environment is found.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -3295,7 +3295,7 @@ uv pip list [OPTIONS]

By default, uv lists packages in a virtual environment but will show packages in a system Python environment if no virtual environment is found.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -3365,7 +3365,7 @@ uv pip show [OPTIONS] [PACKAGE]...

By default, uv looks for packages in a virtual environment but will look for packages in a system Python environment if no virtual environment is found.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -3436,7 +3436,7 @@ uv pip tree [OPTIONS]

By default, uv lists packages in a virtual environment but will show packages in a system Python environment if no virtual environment is found.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.

@@ -3500,7 +3500,7 @@ uv pip check [OPTIONS]

By default, uv checks packages in a virtual environment but will check packages in a system Python environment if no virtual environment is found.

-

See uv help python for details on Python discovery and supported request formats.

+

See uv python for details on Python discovery and supported request formats.

--cache-dir cache-dir

Path to the cache directory.