Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/fastapi_cloud_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/fastapi_cloud_cli/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_logout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_unlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_whoami.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_env_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/test_env_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_env_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading