@@ -644,7 +644,7 @@ enum Commands {
644644 /// Two mutually exclusive modes:
645645 ///
646646 /// **Token mode** (used internally by `sandbox connect`):
647- /// `openshell ssh-proxy --gateway <url> --sandbox-id <id > --token <token>`
647+ /// `openshell ssh-proxy --gateway <url> --sandbox <name > --token <token>`
648648 ///
649649 /// **Name mode** (for use in `~/.ssh/config`):
650650 /// `openshell ssh-proxy --gateway <name> --name <sandbox-name>`
@@ -655,9 +655,9 @@ enum Commands {
655655 #[ arg( long, short = 'g' ) ]
656656 gateway : Option < String > ,
657657
658- /// Sandbox id . Required in token mode.
658+ /// Sandbox name . Required in token mode.
659659 #[ arg( long) ]
660- sandbox_id : Option < String > ,
660+ sandbox : Option < String > ,
661661
662662 /// SSH session token. Required in token mode.
663663 #[ arg( long) ]
@@ -2141,7 +2141,7 @@ enum ServiceCommands {
21412141 page_token : String ,
21422142
21432143 /// List services across all workspaces (overrides --workspace).
2144- #[ arg( long) ]
2144+ #[ arg( long, conflicts_with = "sandbox" ) ]
21452145 all_workspaces : bool ,
21462146
21472147 /// Output format.
@@ -3785,23 +3785,24 @@ async fn run_async() -> Result<()> {
37853785 }
37863786 Some ( Commands :: SshProxy {
37873787 gateway,
3788- sandbox_id ,
3788+ sandbox ,
37893789 token,
37903790 server,
37913791 gateway_name,
37923792 name,
37933793 } ) => {
3794- match ( gateway, sandbox_id , token, server, gateway_name, name) {
3794+ match ( gateway, sandbox , token, server, gateway_name, name) {
37953795 // Token mode (existing behavior): pre-created session credentials.
3796- ( Some ( gw) , Some ( sid ) , Some ( tok) , _, gateway_name_opt, _) => {
3796+ ( Some ( gw) , Some ( sandbox ) , Some ( tok) , _, gateway_name_opt, _) => {
37973797 let mut effective_tls = match gateway_name_opt {
37983798 Some ( ref g) => tls. with_gateway_name ( g) ,
37993799 None => tls,
38003800 } ;
38013801 if let Some ( ref g) = gateway_name_opt {
38023802 apply_auth ( & mut effective_tls, g) ?;
38033803 }
3804- run:: sandbox_ssh_proxy ( & gw, & sid, & tok, & effective_tls) . await ?;
3804+ run:: sandbox_ssh_proxy ( & gw, & sandbox, & cli. workspace , & tok, & effective_tls)
3805+ . await ?;
38053806 }
38063807 // Name mode with --gateway-name: resolve endpoint from metadata.
38073808 ( _, _, _, server_override, Some ( g) , Some ( n) ) => {
@@ -3827,7 +3828,7 @@ async fn run_async() -> Result<()> {
38273828 }
38283829 _ => {
38293830 return Err ( miette:: miette!(
3830- "provide either --gateway/--sandbox-id /--token or --gateway-name/--name (or --server/--name)"
3831+ "provide either --gateway/--sandbox/--token or --gateway-name/--name (or --server/--name)"
38313832 ) ) ;
38323833 }
38333834 }
@@ -4477,19 +4478,22 @@ mod tests {
44774478 "ssh-proxy" ,
44784479 "--gateway" ,
44794480 "https://gw.example.com:8080/proxy/connect" ,
4480- "--sandbox-id" ,
4481- "sbx-123" ,
4481+ "--sandbox" ,
4482+ "my-box" ,
4483+ "--workspace" ,
4484+ "team-a" ,
44824485 "--token" ,
44834486 "tok-abc" ,
44844487 "--gateway-name" ,
44854488 "my-gateway" ,
44864489 ] )
44874490 . expect ( "TUI proxy command flags must be accepted by the CLI" ) ;
4491+ assert_eq ! ( cli. workspace, "team-a" ) ;
44884492
44894493 match cli. command {
44904494 Some ( Commands :: SshProxy {
44914495 gateway,
4492- sandbox_id ,
4496+ sandbox ,
44934497 token,
44944498 gateway_name,
44954499 ..
@@ -4499,7 +4503,7 @@ mod tests {
44994503 Some ( "https://gw.example.com:8080/proxy/connect" ) ,
45004504 "gateway URL must land in SshProxy.gateway, not the global flag"
45014505 ) ;
4502- assert_eq ! ( sandbox_id . as_deref( ) , Some ( "sbx-123 " ) ) ;
4506+ assert_eq ! ( sandbox . as_deref( ) , Some ( "my-box " ) ) ;
45034507 assert_eq ! ( token. as_deref( ) , Some ( "tok-abc" ) ) ;
45044508 assert_eq ! ( gateway_name. as_deref( ) , Some ( "my-gateway" ) ) ;
45054509 }
@@ -6091,6 +6095,19 @@ mod tests {
60916095 }
60926096 }
60936097
6098+ #[ test]
6099+ fn service_list_rejects_sandbox_with_all_workspaces ( ) {
6100+ let result = Cli :: try_parse_from ( [
6101+ "openshell" ,
6102+ "service" ,
6103+ "list" ,
6104+ "my-sandbox" ,
6105+ "--all-workspaces" ,
6106+ ] ) ;
6107+
6108+ assert ! ( result. is_err( ) ) ;
6109+ }
6110+
60946111 #[ test]
60956112 fn service_get_accepts_optional_service_name ( ) {
60966113 let cli = Cli :: try_parse_from ( [ "openshell" , "service" , "get" , "my-sandbox" , "api" ] )
0 commit comments