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
+ (
+ " If the interpreter request is satisfied by a discovered environment, the environment will be used. See See uv python to view supported request formats. Path to the cache directory. The Python interpreter to use to determine the minimum supported Python version. See See uv python to view supported request formats. Path to the cache directory. The Python interpreter to use for resolving and syncing. See See uv python for details on Python discovery and supported request formats. Path to the cache directory. The Python interpreter to use for resolving and syncing. See See uv python for details on Python discovery and supported request formats. Path to the cache directory. 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 See uv python for details on Python discovery and supported request formats. Path to the cache directory. The interpreter is also used as the fallback value for the minimum Python version if See See uv python for details on Python discovery and supported request formats. Path to the cache directory. By default, the tree is filtered to match the platform as reported by the Python interpreter. Use See See uv python for details on Python discovery and supported request formats. Path to the cache directory. The Python interpreter to use to build the run environment. See See uv python for details on Python discovery and supported request formats. Path to the cache directory. The Python interpreter to use to build the tool environment. See See uv python for details on Python discovery and supported request formats. Path to the cache directory. If not provided, the requested Python version(s) will be read from the See See uv python to view supported request formats. The Python request. See See uv python to view supported request formats. uv supports more formats than other tools that read See See uv python to view supported request formats. The Python version(s) to uninstall. See See uv python to view supported request formats. The interpreter is also used to determine the default minimum Python version, unless See See uv python for details on Python discovery and supported request formats. Don’t install pre-built wheels. 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 See uv python for details on Python discovery and supported request formats. 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 directoryuv 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] uv help python
to view supported request formats.--cache-dir
cache-dir--python
, -p
pythonuv help python
to view supported request formats.--cache-dir
cache-dir--python
, -p
pythonuv help python
for details on Python discovery and supported request formats.--cache-dir
cache-dir--python
, -p
pythonuv help python
for details on Python discovery and supported request formats.--cache-dir
cache-diruv help python
for details on Python discovery and supported request formats.--cache-dir
cache-dirrequires-python
is not set.uv help python
for details on Python discovery and supported request formats.--cache-dir
cache-dir--universal
to display the tree for all platforms, or use --python-version
or --python-platform
to override a subset of markers.uv help python
for details on Python discovery and supported request formats.--cache-dir
cache-dir--python
, -p
pythonuv help python
for details on Python discovery and supported request formats.--cache-dir
cache-dir--python
, -p
pythonuv help python
for details on Python discovery and supported request formats.--cache-dir
cache-dir.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.uv help python
to view supported request formats.
@@ -2147,7 +2147,7 @@ uv python pin [OPTIONS] [REQUEST]
REQUEST
uv help python
to view supported request formats..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
.uv help python
to view supported request formats.
@@ -2523,7 +2523,7 @@ uv pip compile [OPTIONS] TARGETS
uv help python
to view supported request formats.--python-version
is provided.uv help python
for details on Python discovery and supported request formats.--no-binary
no-binaryuv help python
for details on Python discovery and supported request formats.--target
target
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
targetInstall 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-providerAttempt to use keyring
for authentication for remote requirements files.
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-dirPath 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-dirPath 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-dirPath 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-dirPath 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-dirPath to the cache directory.