@@ -69,6 +69,16 @@ def start(
6969 "--image" ,
7070 help = "Custom image to use (can be full path like 'repo/image:tag' or just tag like '1.7.1')" ,
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,9 @@ def start(
96113 external_access = eai_name ,
97114 stage = stage ,
98115 image = image ,
116+ generate_ssh_key = (
117+ ssh and not no_ssh_key
118+ ), # Only generate SSH key if --ssh and not --no-ssh-key
99119 )
100120
101121 # Display appropriate success message based on what happened
@@ -132,6 +152,10 @@ def start(
132152 if image :
133153 log .debug ("Using custom image: %s" , image )
134154
155+ # Handle SSH setup if requested - this is a blocking operation
156+ if ssh :
157+ manager .setup_ssh_connection (service_name )
158+
135159 except ValueError as e :
136160 cc .warning (f"Error: { e } " )
137161 raise typer .Exit (code = 1 )
0 commit comments