From a3414ed15dea43bdb72fe45cf5dd6b64c099d8b1 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Tue, 20 May 2025 18:24:48 -0700 Subject: [PATCH] llm install --pre option, closes #1060 --- docs/help.md | 1 + llm/cli.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/help.md b/docs/help.md index ddb4afb..1f3873e 100644 --- a/docs/help.md +++ b/docs/help.md @@ -829,6 +829,7 @@ Options: --force-reinstall Reinstall all packages even if they are already up-to- date --no-cache-dir Disable the cache + --pre Include pre-release and development versions --help Show this message and exit. ``` diff --git a/llm/cli.py b/llm/cli.py index 4b1474f..e659094 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -2657,7 +2657,12 @@ def display_truncated(text): is_flag=True, help="Disable the cache", ) -def install(packages, upgrade, editable, force_reinstall, no_cache_dir): +@click.option( + "--pre", + is_flag=True, + help="Include pre-release and development versions", +) +def install(packages, upgrade, editable, force_reinstall, no_cache_dir, pre): """Install packages from PyPI into the same environment as LLM""" args = ["pip", "install"] if upgrade: @@ -2668,6 +2673,8 @@ def install(packages, upgrade, editable, force_reinstall, no_cache_dir): args += ["--force-reinstall"] if no_cache_dir: args += ["--no-cache-dir"] + if pre: + args += ["--pre"] args += list(packages) sys.argv = args run_module("pip", run_name="__main__")