refactor: remove all backwards compat aliases from cloud CLI

One canonical way to do everything:
- hanzo cloud <service> create/describe/list/delete/update
- hanzo cloud <service> connect/env/status
- hanzo cloud <service> start/stop/restart (stateful)
- hanzo cloud <service> enable/disable (functions, cron)
- hanzo cloud <service> pause/resume (queues)
- hanzo cloud services list
- hanzo cloud instances list
- hanzo cloud operations list/describe/wait
- hanzo cloud init
This commit is contained in:
2026-01-19 23:59:58 -08:00
parent 891f97afa1
commit 165c63c653
4 changed files with 7 additions and 147 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "hanzo"
version = "0.3.36"
version = "0.3.37"
description = "Hanzo AI - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime"
authors = [
{name = "Hanzo AI", email = "[email protected]"},
+1 -1
View File
@@ -1,6 +1,6 @@
"""Hanzo - Complete AI Infrastructure Platform with CLI, Router, MCP, and Agent Runtime."""
__version__ = "0.3.36"
__version__ = "0.3.37"
__all__ = ["main", "cli", "__version__"]
from .cli import cli, main
+4 -144
View File
@@ -10,13 +10,6 @@ Lifecycle verbs (resource-dependent):
- start, stop, restart (stateful services)
- enable, disable (functions, cron)
- pause, resume (queues)
Aliases:
- ls → list
- rm/destroy → delete
- get → describe
- provision → create
- up → create
"""
import os
@@ -175,10 +168,6 @@ def cloud_group():
\b
Services: vector, kv, documentdb, storage, search,
pubsub, tasks, queues, cron, functions
\b
Aliases:
ls → list, rm → delete, get → describe, provision → create
"""
pass
@@ -243,7 +232,6 @@ def instances_list(fmt: str):
table.add_column("Status", style="yellow")
for svc_name, svc_config in instances.items():
info = SERVICES.get(svc_name, {})
table.add_row(
svc_name,
svc_config.get("name", "default"),
@@ -400,7 +388,7 @@ def operations_wait(operation_id: str, timeout: int):
status = data.get("status", "")
if status in ("done", "completed", "succeeded"):
console.print(f"[green]✓ Operation completed[/green]")
console.print("[green]✓ Operation completed[/green]")
return
elif status in ("failed", "error"):
console.print(f"[red]✗ Operation failed: {data.get('error', 'Unknown error')}[/red]")
@@ -412,7 +400,7 @@ def operations_wait(operation_id: str, timeout: int):
console.print(f"[red]Error: {e}[/red]")
return
console.print(f"[yellow]Timeout waiting for operation[/yellow]")
console.print("[yellow]Timeout waiting for operation[/yellow]")
# ============================================================================
@@ -437,24 +425,6 @@ def create_service_group(service_key: str, service_info: dict):
"""Create a new instance."""
_create_instance(service_key, name, tier, region)
# provision alias
@service_group.command(name="provision", hidden=True)
@click.option("--name", default="default")
@click.option("--tier", type=click.Choice(["free", "pro", "enterprise"]), default="free")
@click.option("--region", default="us-west-2")
def provision(name: str, tier: str, region: str):
"""Alias for create."""
_create_instance(service_key, name, tier, region)
# up alias
@service_group.command(name="up", hidden=True)
@click.option("--name", default="default")
@click.option("--tier", type=click.Choice(["free", "pro", "enterprise"]), default="free")
@click.option("--region", default="us-west-2")
def up(name: str, tier: str, region: str):
"""Alias for create."""
_create_instance(service_key, name, tier, region)
# describe command
@service_group.command(name="describe")
@click.option("--name", default="default", help="Instance name")
@@ -462,25 +432,12 @@ def create_service_group(service_key: str, service_info: dict):
"""Show instance details."""
_describe_instance(service_key, name)
# get alias
@service_group.command(name="get", hidden=True)
@click.option("--name", default="default")
def get(name: str):
"""Alias for describe."""
_describe_instance(service_key, name)
# list command
@service_group.command(name="list")
def list_cmd():
"""List instances of this service type."""
_list_service_instances(service_key)
# ls alias
@service_group.command(name="ls", hidden=True)
def ls():
"""Alias for list."""
_list_service_instances(service_key)
# delete command
@service_group.command(name="delete")
@click.option("--name", default="default", help="Instance name")
@@ -489,22 +446,6 @@ def create_service_group(service_key: str, service_info: dict):
"""Delete an instance."""
_delete_instance(service_key, name, force)
# rm alias
@service_group.command(name="rm", hidden=True)
@click.option("--name", default="default")
@click.option("--force", is_flag=True)
def rm(name: str, force: bool):
"""Alias for delete."""
_delete_instance(service_key, name, force)
# destroy alias
@service_group.command(name="destroy", hidden=True)
@click.option("--name", default="default")
@click.option("--force", is_flag=True)
def destroy(name: str, force: bool):
"""Alias for delete."""
_delete_instance(service_key, name, force)
# connect command
@service_group.command(name="connect")
@click.option("--name", default="default", help="Instance name")
@@ -701,7 +642,6 @@ def _list_service_instances(service: str):
console.print(f"Run 'hanzo cloud {service} create' to create one.")
return
# For now, we only support one instance per service type
svc_config = instances[service]
info = SERVICES[service]
@@ -979,89 +919,9 @@ for svc_key, svc_info in SERVICES.items():
# ============================================================================
# Backwards compatibility aliases (top-level)
# Init command
# ============================================================================
@cloud_group.command(name="list", hidden=True)
def compat_list():
"""[Deprecated] Use 'hanzo cloud instances list'."""
console.print("[dim]Hint: Use 'hanzo cloud instances list' for the new syntax[/dim]")
console.print()
instances_list.callback("table")
@cloud_group.command(name="ls", hidden=True)
def compat_ls():
"""[Deprecated] Alias for list."""
compat_list.callback()
@cloud_group.command(name="provision", hidden=True)
@click.argument("service", type=click.Choice(SERVICE_NAMES))
@click.option("--tier", type=click.Choice(["free", "pro", "enterprise"]), default="free")
@click.option("--region", default="us-west-2")
def compat_provision(service: str, tier: str, region: str):
"""[Deprecated] Use 'hanzo cloud <service> create'."""
console.print(f"[dim]Hint: Use 'hanzo cloud {service} create' for the new syntax[/dim]")
console.print()
_create_instance(service, "default", tier, region)
@cloud_group.command(name="destroy", hidden=True)
@click.argument("service", type=click.Choice(SERVICE_NAMES))
@click.option("--force", is_flag=True)
def compat_destroy(service: str, force: bool):
"""[Deprecated] Use 'hanzo cloud <service> delete'."""
console.print(f"[dim]Hint: Use 'hanzo cloud {service} delete' for the new syntax[/dim]")
console.print()
_delete_instance(service, "default", force)
@cloud_group.command(name="connect", hidden=True)
@click.argument("service", type=click.Choice(SERVICE_NAMES), required=False)
def compat_connect(service: Optional[str]):
"""[Deprecated] Use 'hanzo cloud <service> connect'."""
if service:
console.print(f"[dim]Hint: Use 'hanzo cloud {service} connect' for the new syntax[/dim]")
console.print()
_connect_instance(service, "default")
else:
console.print("[yellow]Specify a service: hanzo cloud <service> connect[/yellow]")
@cloud_group.command(name="env", hidden=True)
@click.option("--shell", type=click.Choice(["bash", "zsh", "fish", "powershell"]), default="bash")
@click.option("--export", "do_export", is_flag=True)
def compat_env(shell: str, do_export: bool):
"""[Deprecated] Use 'hanzo cloud <service> env'."""
console.print("[dim]Hint: Use 'hanzo cloud <service> env' for the new syntax[/dim]")
console.print()
config = get_cloud_config()
instances = config.get("instances", {})
if not instances:
console.print("[yellow]No instances provisioned.[/yellow]")
return
for svc in instances:
_env_instance(svc, "default", shell, do_export)
@cloud_group.command(name="status", hidden=True)
@click.argument("service", type=click.Choice(SERVICE_NAMES), required=False)
def compat_status(service: Optional[str]):
"""[Deprecated] Use 'hanzo cloud <service> status'."""
if service:
console.print(f"[dim]Hint: Use 'hanzo cloud {service} status' for the new syntax[/dim]")
console.print()
_status_instance(service, "default")
else:
config = get_cloud_config()
for svc in config.get("instances", {}):
_status_instance(svc, "default")
@cloud_group.command(name="init")
def init():
"""Initialize infrastructure from hanzo.yaml config file."""
@@ -1097,7 +957,7 @@ def init():
console.print(f"[red]Error parsing {config_file}: {e}[/red]")
return
cloud_config = config.get("cloud", config.get("infra", {}))
cloud_config = config.get("cloud", {})
if not cloud_config:
console.print("[yellow]No 'cloud' section in config file.[/yellow]")
return
+1 -1
View File
@@ -1445,7 +1445,7 @@ wheels = [
[[package]]
name = "hanzo"
version = "0.3.35"
version = "0.3.36"
source = { editable = "." }
dependencies = [
{ name = "anthropic" },