From 1ea8cd669d8ded719431afbcf9607e8fc92e57a6 Mon Sep 17 00:00:00 2001 From: chelsealong Date: Fri, 7 Aug 2026 14:48:07 +0000 Subject: [PATCH] fix(cli): point to Gemini Enterprise registration docs after agent_engine deploy Fixes #6633 adk deploy agent_engine has no way to push directly to Gemini Enterprise, and users had no indication of how to make a deployed agent available there. Print a pointer to the registration docs after a successful deploy, matching the doc link already used by the --gemini_enterprise_app_name flag on `adk api_server`. --- src/google/adk/cli/cli_deploy.py | 10 ++++++++++ tests/unittests/cli/utils/test_cli_deploy.py | 13 +++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/google/adk/cli/cli_deploy.py b/src/google/adk/cli/cli_deploy.py index db4172f9222..1f3298d2468 100644 --- a/src/google/adk/cli/cli_deploy.py +++ b/src/google/adk/cli/cli_deploy.py @@ -858,6 +858,15 @@ def _print_agent_engine_url(resource_name: str) -> None: ) +def _print_gemini_enterprise_hint() -> None: + """Prints a pointer to the Gemini Enterprise registration docs.""" + click.secho( + 'To make this agent available in Gemini Enterprise, register it by' + ' following:\nhttps://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent\n', + fg='cyan', + ) + + def to_agent_engine( *, agent_folder: str, @@ -1302,6 +1311,7 @@ def create_dockerfile_for_agent_engine(resource_name: str) -> None: click.secho(f'Cleaned up the instance: {resource_name}', fg='green') raise e _print_agent_engine_url(resource_name) + _print_gemini_enterprise_hint() finally: temp_folder_path = os.path.join(parent_folder, temp_folder) click.echo(f'Cleaning up the temp folder: {temp_folder_path}') diff --git a/tests/unittests/cli/utils/test_cli_deploy.py b/tests/unittests/cli/utils/test_cli_deploy.py index 5546f816cca..eb50490125e 100644 --- a/tests/unittests/cli/utils/test_cli_deploy.py +++ b/tests/unittests/cli/utils/test_cli_deploy.py @@ -250,6 +250,19 @@ def test_print_agent_engine_url() -> None: assert "playground" in call_args +def test_print_gemini_enterprise_hint() -> None: + """It should print a pointer to the Gemini Enterprise registration docs.""" + with mock.patch("click.secho") as mocked_secho: + cli_deploy._print_gemini_enterprise_hint() + mocked_secho.assert_called_once() + call_args = mocked_secho.call_args[0][0] + assert "Gemini Enterprise" in call_args + assert ( + "https://docs.cloud.google.com/gemini/enterprise/docs/register-and-manage-an-adk-agent" + in call_args + ) + + @pytest.mark.parametrize("include_requirements", [True, False]) def test_to_agent_engine_happy_path( monkeypatch: pytest.MonkeyPatch,