2025-05-29 11:36:25 -07:00
diff --git a/llm/cli.py b/llm/cli.py
index 5d53e74..c2b4707 100644
--- a/llm/cli.py
+++ b/llm/cli.py
@@ -2895,30 +2895,38 @@ def display_truncated(text):
help="Include pre-release and development versions",
2023-10-29 12:50:47 +01:00
)
2025-05-29 11:36:25 -07:00
def install(packages, upgrade, editable, force_reinstall, no_cache_dir, pre):
- """Install packages from PyPI into the same environment as LLM"""
2023-10-29 12:50:47 +01:00
- args = ["pip", "install"]
- if upgrade:
- args += ["--upgrade"]
- if editable:
- args += ["--editable", editable]
- if force_reinstall:
- args += ["--force-reinstall"]
- if no_cache_dir:
- args += ["--no-cache-dir"]
2025-05-29 11:36:25 -07:00
- if pre:
- args += ["--pre"]
2023-10-29 12:50:47 +01:00
- args += list(packages)
- sys.argv = args
- run_module("pip", run_name="__main__")
2025-05-29 11:36:25 -07:00
+ """Install packages from PyPI into the same environment as LLM. Disabled for nixpkgs."""
+ raise click.ClickException(
2025-05-10 14:55:55 -07:00
+"""Install command has been disabled for Nix. To install extra `llm` plugins, use the `llm.withPlugins` function.
+
+Example:
+
+```nix
+llm.withPlugins {
+ @listOfPackagedPlugins@
+}
+```
+"""
+ )
2025-05-29 11:36:25 -07:00
2023-10-29 12:50:47 +01:00
@cli.command()
2025-05-29 11:36:25 -07:00
@click.argument("packages", nargs=-1, required=True)
2023-10-29 12:50:47 +01:00
@click.option("-y", "--yes", is_flag=True, help="Don't ask for confirmation")
def uninstall(packages, yes):
2025-05-29 11:36:25 -07:00
- """Uninstall Python packages from the LLM environment"""
2023-10-29 12:50:47 +01:00
- sys.argv = ["pip", "uninstall"] + list(packages) + (["-y"] if yes else [])
- run_module("pip", run_name="__main__")
2025-05-29 11:36:25 -07:00
+ """Uninstall Python packages from the LLM environment. Disabled for nixpkgs."""
+ raise click.ClickException(
2025-05-10 14:55:55 -07:00
+"""Uninstall command has been disabled for Nix. To remove `llm` plugins, use the `llm.withPlugins` function with the desired set of plugins specified.
+
+Example:
+
+```nix
+llm.withPlugins {
+ @listOfPackagedPlugins@
+}
+```
+"""
+ )
2025-05-29 11:36:25 -07:00
2023-10-29 12:50:47 +01:00
@cli.command()
2025-05-29 11:36:25 -07:00
--
2.49.0