From 85714d25ca0337267bfbd9db2a1e920938f1627a Mon Sep 17 00:00:00 2001 From: Fangyin Cheng Date: Wed, 24 Jul 2024 16:03:44 +0800 Subject: [PATCH] feat: Install and uninstall multiple dbgpts at one time --- dbgpt/util/dbgpts/cli.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dbgpt/util/dbgpts/cli.py b/dbgpt/util/dbgpts/cli.py index dd7b35748..380450f70 100644 --- a/dbgpt/util/dbgpts/cli.py +++ b/dbgpt/util/dbgpts/cli.py @@ -72,23 +72,25 @@ def wrapper(*args, **kwargs): @click.command(name="install") @add_add_common_options -@click.argument("name", type=str) -def install(repo: str | None, update: bool, name: str): +@click.argument("names", type=str, nargs=-1) +def install(repo: str | None, update: bool, names: list[str]): """Install your dbgpts(operators,agents,workflows or apps)""" from .repo import _install_default_repos_if_no_repos, install check_poetry_installed() _install_default_repos_if_no_repos() - install(name, repo, with_update=update) + for name in names: + install(name, repo, with_update=update) @click.command(name="uninstall") -@click.argument("name", type=str) -def uninstall(name: str): +@click.argument("names", type=str, nargs=-1) +def uninstall(names: list[str]): """Uninstall your dbgpts(operators,agents,workflows or apps)""" from .repo import uninstall - uninstall(name) + for name in names: + uninstall(name) @click.command(name="list-remote")