From 05e6ed0a2e3826b3386146da67a7d8e4020f0e76 Mon Sep 17 00:00:00 2001 From: Luke Alvoeiro Date: Thu, 29 Aug 2024 17:06:27 -0700 Subject: [PATCH 1/2] fix: `--help` option --- src/goose/cli/main.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/goose/cli/main.py b/src/goose/cli/main.py index b79bbfab5475..bf953aab1a70 100644 --- a/src/goose/cli/main.py +++ b/src/goose/cli/main.py @@ -12,10 +12,12 @@ from goose.utils import load_plugins from goose.utils.session_file import list_sorted_session_files + @click.group() def goose_cli() -> None: pass + @goose_cli.command() def version() -> None: """Lists the version of goose and any plugins""" @@ -100,22 +102,28 @@ def session_clear(keep: int) -> None: def get_session_files() -> Dict[str, Path]: return list_sorted_session_files(SESSIONS_PATH) + +all_cli_groups = load_plugins("goose.cli.group") +all_cli_group_options = load_plugins("goose.cli.group_option") + + @click.group( - invoke_without_command=True, - name="goose", - help="AI-powered tool to assist in solving programming and operational tasks",) + # we only want to override --help if there are top-level command options + invoke_without_command=len(all_cli_group_options.items()) > 0, + name="goose", + help="AI-powered tool to assist in solving programming and operational tasks", +) @click.pass_context def cli(_: click.Context, **kwargs: Dict) -> None: pass -all_cli_group_options = load_plugins("goose.cli.group_option") -for option in all_cli_group_options.values(): - cli = option()(cli) -all_cli_groups = load_plugins("goose.cli.group") for group in all_cli_groups.values(): for command in group.commands.values(): cli.add_command(command) +for option in all_cli_group_options.values(): + cli = option()(cli) + if __name__ == "__main__": cli() From cfb8eeb157d829b7cc90a8c5fa8a80a471cddb6e Mon Sep 17 00:00:00 2001 From: Luke Alvoeiro Date: Thu, 29 Aug 2024 17:07:16 -0700 Subject: [PATCH 2/2] upgrade version --- pyproject.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 11b7b532a5f2..b42e50c62cce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "goose-ai" description = "a programming agent that runs on your machine" -version = "0.8.3" +version = "0.8.4" readme = "README.md" requires-python = ">=3.10" dependencies = [ @@ -46,7 +46,4 @@ requires = ["hatchling"] build-backend = "hatchling.build" [tool.uv] -dev-dependencies = [ - "pytest>=8.3.2", - "codecov>=2.1.13", -] +dev-dependencies = ["pytest>=8.3.2", "codecov>=2.1.13"]