MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / sandbox_connect_editor

Function sandbox_connect_editor

crates/openshell-cli/src/ssh.rs:293–322  ·  view source on GitHub ↗
(
    server: &str,
    gateway: &str,
    name: &str,
    editor: Editor,
    tls: &TlsOptions,
)

Source from the content-addressed store, hash-verified

291}
292
293pub async fn sandbox_connect_editor(
294 server: &str,
295 gateway: &str,
296 name: &str,
297 editor: Editor,
298 tls: &TlsOptions,
299) -> Result<()> {
300 // Verify the sandbox exists before writing SSH config / launching the editor.
301 let mut client = grpc_client(server, tls).await?;
302 client
303 .get_sandbox(GetSandboxRequest {
304 name: name.to_string(),
305 })
306 .await
307 .into_diagnostic()?
308 .into_inner()
309 .sandbox
310 .ok_or_else(|| miette::miette!("sandbox not found: {name}"))?;
311
312 let host_alias = host_alias(name);
313 install_ssh_config(gateway, name)?;
314 launch_editor(editor, &host_alias)?;
315 eprintln!(
316 "{} Opened {} for sandbox {}",
317 "✓".green().bold(),
318 editor.label(),
319 name
320 );
321 Ok(())
322}
323
324/// Forward a local port to a sandbox via SSH.
325///

Callers 2

mainFunction · 0.85
sandbox_createFunction · 0.85

Calls 5

grpc_clientFunction · 0.85
host_aliasFunction · 0.85
install_ssh_configFunction · 0.85
launch_editorFunction · 0.85
get_sandboxMethod · 0.45

Tested by

no test coverage detected