Documentation Index
Fetch the complete documentation index at: https://docs.microsandbox.dev/llms.txt
Use this file to discover all available pages before exploring further.
Native sessions keep the SSH protocol boundary but do not expose a listener. microsandbox creates an in-process SSH client/server pair over an in-memory stream, then forwards SSH channels to the sandbox.
Use this path when you want a quick shell from msb, or when SDK code wants SSH semantics without running an external SSH client.
CLI
msb ssh devbox
msb ssh connect devbox
With no remote command, the CLI opens an interactive shell. With --, the remaining tokens become the SSH command string and run through the sandbox shell.
msb ssh devbox -- uname -a
msb ssh devbox -- sh -lc "cd /app && npm test"
If a sandbox name collides with an SSH subcommand such as serve or authorize, use --name:
msb ssh --name serve
msb ssh --name authorize -- uptime
SDK
let sb = Sandbox::start("devbox").await?;
let ssh = sb.ssh().connect().await?;
let output = ssh.exec("uname -a").await?;
println!("{}", String::from_utf8_lossy(&output.stdout));
ssh.close().await?;
Interactive attach
SDK clients can attach the local terminal to an SSH shell. This requires a real terminal.
let code = sb
.ssh()
.connect_with(|ssh| ssh.term("xterm-256color"))
.await?
.attach()
.await?;
SFTP from a native client
The native SSH client can open SFTP over the same SSH connection.
let sftp = ssh.sftp().await?;
sftp.write("/tmp/hello.txt", b"hello").await?;
let data = sftp.read("/tmp/hello.txt").await?;
sftp.close().await?;
For exact SDK signatures, see the SSH reference for Rust, TypeScript, Python, or Go.