@@ -113,7 +113,7 @@ def status() -> None:
113113 has_credentials = bool (config .cloud_api_key ) or tokens is not None
114114 if not has_credentials :
115115 console .print (
116- "\n [dim]No cloud credentials found. Run: bm cloud login or bm cloud set -key <key>[/dim]"
116+ "\n [dim]No cloud credentials found. Run: bm cloud login or bm cloud api -key save <key>[/dim]"
117117 )
118118 return
119119
@@ -140,7 +140,7 @@ def status() -> None:
140140 except CloudAPIError as e :
141141 console .print (f"[yellow]Cloud health check failed: { e } [/yellow]" )
142142 console .print (
143- "[dim]Try re-authenticating with 'bm cloud login' or setting API key with 'bm cloud set -key'.[/dim]"
143+ "[dim]Try re-authenticating with 'bm cloud login' or setting API key with 'bm cloud api -key save '.[/dim]"
144144 )
145145 except Exception as e :
146146 console .print (f"[yellow]Unexpected health check error: { e } [/yellow]" )
@@ -219,17 +219,22 @@ def promo(enabled: bool = typer.Option(True, "--on/--off", help="Enable or disab
219219 console .print ("[yellow]Cloud promo messages disabled[/yellow]" )
220220
221221
222- @cloud_app .command ("set-key" )
223- def set_key (
222+ # --- API key management subcommand group ---
223+
224+ api_key_app = typer .Typer (help = "Manage cloud API keys" )
225+ cloud_app .add_typer (api_key_app , name = "api-key" )
226+
227+
228+ @api_key_app .command ("save" )
229+ def api_key_save (
224230 api_key : str = typer .Argument (..., help = "API key (bmc_ prefixed) for cloud access" ),
225231) -> None :
226- """Save a cloud API key for per-project cloud routing .
232+ """Save an existing API key to local config .
227233
228- The API key is account-level and used by projects set to cloud mode.
229- Create a key in the web app or use 'bm cloud create-key'.
234+ Use when you already have an API key (e.g., from the web app).
230235
231236 Example:
232- bm cloud set -key bmc_abc123...
237+ bm cloud api -key save bmc_abc123...
233238 """
234239 if not api_key .startswith ("bmc_" ):
235240 console .print ("[red]Error: API key must start with 'bmc_'[/red]" )
@@ -245,17 +250,16 @@ def set_key(
245250 console .print ("[dim]Set a project to cloud mode: bm project set-cloud <name>[/dim]" )
246251
247252
248- @cloud_app .command ("create-key " )
249- def create_key (
253+ @api_key_app .command ("create" )
254+ def api_key_create (
250255 name : str = typer .Argument (..., help = "Human-readable name for the API key" ),
251256) -> None :
252- """Create a new cloud API key and save it locally.
257+ """Create a new API key via the cloud API and save it locally.
253258
254259 Requires active OAuth session (run 'bm cloud login' first).
255- The key is created via the cloud API and saved to local config.
256260
257261 Example:
258- bm cloud create -key "my-laptop"
262+ bm cloud api -key create "my-laptop"
259263 """
260264
261265 async def _create_key ():
0 commit comments