diff --git a/src/fastapi_cloud_cli/cli.py b/src/fastapi_cloud_cli/cli.py index e5a2f2e..85e22cb 100644 --- a/src/fastapi_cloud_cli/cli.py +++ b/src/fastapi_cloud_cli/cli.py @@ -13,17 +13,29 @@ app = typer.Typer(rich_markup_mode="rich") +cloud_app = typer.Typer( + rich_markup_mode="rich", + help="Manage [bold]FastAPI[/bold] Cloud deployments. 🚀", +) # TODO: use the app structure # Additional commands + +# fastapi cloud [command] +cloud_app.command()(deploy) +cloud_app.command()(login) +cloud_app.command()(logout) +cloud_app.command()(whoami) +cloud_app.command()(unlink) + +cloud_app.add_typer(env_app, name="env") + +# fastapi [command] app.command()(deploy) app.command()(login) -app.command()(logout) -app.command()(whoami) -app.command()(unlink) -app.add_typer(env_app, name="env") +app.add_typer(cloud_app, name="cloud") def main() -> None: diff --git a/src/fastapi_cloud_cli/commands/deploy.py b/src/fastapi_cloud_cli/commands/deploy.py index da26c03..1a267b0 100644 --- a/src/fastapi_cloud_cli/commands/deploy.py +++ b/src/fastapi_cloud_cli/commands/deploy.py @@ -581,7 +581,7 @@ def deploy( if not app: toolkit.print_line() toolkit.print( - "If you deleted this app, you can run [bold]fastapi unlink[/] to unlink the local configuration.", + "If you deleted this app, you can run [bold]fastapi cloud unlink[/] to unlink the local configuration.", tag="tip", ) raise typer.Exit(1) diff --git a/tests/test_cli_logout.py b/tests/test_cli_logout.py index 195d3b3..962db4e 100644 --- a/tests/test_cli_logout.py +++ b/tests/test_cli_logout.py @@ -2,7 +2,7 @@ from typer.testing import CliRunner -from fastapi_cloud_cli.cli import app +from fastapi_cloud_cli.cli import cloud_app as app runner = CliRunner() diff --git a/tests/test_cli_unlink.py b/tests/test_cli_unlink.py index 180212c..5c7e284 100644 --- a/tests/test_cli_unlink.py +++ b/tests/test_cli_unlink.py @@ -3,7 +3,7 @@ from typer.testing import CliRunner -from fastapi_cloud_cli.cli import app +from fastapi_cloud_cli.cli import cloud_app as app runner = CliRunner() diff --git a/tests/test_cli_whoami.py b/tests/test_cli_whoami.py index 5bfd101..4e13b6b 100644 --- a/tests/test_cli_whoami.py +++ b/tests/test_cli_whoami.py @@ -5,7 +5,7 @@ from httpx import ReadTimeout, Response from typer.testing import CliRunner -from fastapi_cloud_cli.cli import app +from fastapi_cloud_cli.cli import cloud_app as app from fastapi_cloud_cli.config import Settings runner = CliRunner() diff --git a/tests/test_env_delete.py b/tests/test_env_delete.py index e5203aa..c4d1f4d 100644 --- a/tests/test_env_delete.py +++ b/tests/test_env_delete.py @@ -6,7 +6,7 @@ from httpx import Response from typer.testing import CliRunner -from fastapi_cloud_cli.cli import app +from fastapi_cloud_cli.cli import cloud_app as app from fastapi_cloud_cli.config import Settings from tests.utils import Keys, changing_dir diff --git a/tests/test_env_list.py b/tests/test_env_list.py index 22d9ff2..aa54b78 100644 --- a/tests/test_env_list.py +++ b/tests/test_env_list.py @@ -5,7 +5,7 @@ from httpx import Response from typer.testing import CliRunner -from fastapi_cloud_cli.cli import app +from fastapi_cloud_cli.cli import cloud_app as app from fastapi_cloud_cli.config import Settings from tests.conftest import ConfiguredApp from tests.utils import changing_dir diff --git a/tests/test_env_set.py b/tests/test_env_set.py index e549d76..8bdce4a 100644 --- a/tests/test_env_set.py +++ b/tests/test_env_set.py @@ -6,7 +6,7 @@ from httpx import Response from typer.testing import CliRunner -from fastapi_cloud_cli.cli import app +from fastapi_cloud_cli.cli import cloud_app as app from fastapi_cloud_cli.config import Settings from tests.utils import Keys, changing_dir