at master 1.8 kB view raw
1diff --git a/llm/cli.py b/llm/cli.py 2index 5d53e74..c2b4707 100644 3--- a/llm/cli.py 4+++ b/llm/cli.py 5@@ -2895,30 +2895,38 @@ def display_truncated(text): 6 help="Include pre-release and development versions", 7 ) 8 def install(packages, upgrade, editable, force_reinstall, no_cache_dir, pre): 9- """Install packages from PyPI into the same environment as LLM""" 10- args = ["pip", "install"] 11- if upgrade: 12- args += ["--upgrade"] 13- if editable: 14- args += ["--editable", editable] 15- if force_reinstall: 16- args += ["--force-reinstall"] 17- if no_cache_dir: 18- args += ["--no-cache-dir"] 19- if pre: 20- args += ["--pre"] 21- args += list(packages) 22- sys.argv = args 23- run_module("pip", run_name="__main__") 24+ """Install packages from PyPI into the same environment as LLM. Disabled for nixpkgs.""" 25+ raise click.ClickException( 26+"""Install command has been disabled for Nix. To install extra `llm` plugins, use the `llm.withPlugins` function. 27+ 28+Example: 29+ 30+```nix 31+llm.withPlugins { 32+ @listOfPackagedPlugins@ 33+} 34+``` 35+""" 36+ ) 37 38 39 @cli.command() 40 @click.argument("packages", nargs=-1, required=True) 41 @click.option("-y", "--yes", is_flag=True, help="Don't ask for confirmation") 42 def uninstall(packages, yes): 43- """Uninstall Python packages from the LLM environment""" 44- sys.argv = ["pip", "uninstall"] + list(packages) + (["-y"] if yes else []) 45- run_module("pip", run_name="__main__") 46+ """Uninstall Python packages from the LLM environment. Disabled for nixpkgs.""" 47+ raise click.ClickException( 48+"""Uninstall command has been disabled for Nix. To remove `llm` plugins, use the `llm.withPlugins` function with the desired set of plugins specified. 49+ 50+Example: 51+ 52+```nix 53+llm.withPlugins { 54+ @listOfPackagedPlugins@ 55+} 56+``` 57+""" 58+ ) 59 60 61 @cli.command() 62-- 632.49.0 64