@@ -69,6 +69,16 @@ def start(
6969 "--image-tag" ,
7070 help = "Custom image tag to use for the remote development environment" ,
7171 ),
72+ ssh : bool = typer .Option (
73+ False ,
74+ "--ssh" ,
75+ help = "Set up SSH configuration for connecting to the remote environment. This is a blocking command that keeps SSH connections alive." ,
76+ ),
77+ no_ssh_key : bool = typer .Option (
78+ False ,
79+ "--no-ssh-key" ,
80+ help = "When used with --ssh, skip SSH key generation and use token-only authentication (less secure)" ,
81+ ),
7282 ** options ,
7383) -> None :
7484 """
@@ -83,9 +93,16 @@ def start(
8393 - Resume existing service: snow remote start myproject
8494 - Create new service: snow remote start --compute-pool my_pool
8595 - Create named service: snow remote start myproject --compute-pool my_pool
96+ - Start with SSH setup: snow remote start myproject --ssh
97+ - Start with SSH (no key): snow remote start myproject --ssh --no-ssh-key
8698
8799 The --compute-pool parameter is only required when creating a new service. For resuming
88100 existing services, the compute pool is not needed.
101+
102+ SSH Options:
103+ - Use --ssh to set up SSH configuration for secure terminal access
104+ - Use --no-ssh-key with --ssh for token-only authentication (less secure)
105+ - SSH setup is a blocking command that continuously refreshes authentication tokens
89106 """
90107 try :
91108 manager = RemoteManager ()
@@ -96,6 +113,8 @@ def start(
96113 external_access = eai_name ,
97114 stage = stage ,
98115 image_tag = image_tag ,
116+ generate_ssh_key = ssh
117+ and not no_ssh_key , # Only generate SSH key if --ssh and not --no-ssh-key
99118 )
100119
101120 # Display appropriate success message based on what happened
@@ -132,6 +151,10 @@ def start(
132151 if image_tag :
133152 log .debug ("Using custom image tag: %s" , image_tag )
134153
154+ # Handle SSH setup if requested - this is a blocking operation
155+ if ssh :
156+ manager .setup_ssh_connection (service_name )
157+
135158 except ValueError as e :
136159 cc .warning (f"Error: { e } " )
137160 raise typer .Exit (code = 1 )
0 commit comments