Sandbox
ssh()
| Type | Description |
|---|---|
SandboxSshOps | SSH client and server helpers |
SandboxSshOps
connect()
| Name | Type | Description |
|---|---|---|
| opts? | SshClientOptions | Client options |
| Type | Description |
|---|---|
Promise<SshClient> | Native SSH client session |
server()
| Name | Type | Description |
|---|---|---|
| opts? | SshServerOptions | Server options |
| Type | Description |
|---|---|
Promise<SshServer> | Server endpoint |
SshClient
exec()
| Name | Type | Description |
|---|---|---|
| command | string | Command string sent through SSH |
| opts? | SshExecOptions | Exec options |
| Type | Description |
|---|---|
Promise<SshOutput> | Captured output and status |
attach()
| Name | Type | Description |
|---|---|---|
| opts? | SshAttachOptions | Attach options |
| Type | Description |
|---|---|
Promise<number> | Exit code |
sftp()
| Type | Description |
|---|---|
Promise<SftpClient> | SFTP client session |
close()
SftpClient
| Method | Returns | Description |
|---|---|---|
| read(path) | Promise<Buffer> | Read a file into memory |
| write(path, data) | Promise<void> | Create or truncate a file |
| mkdir(path) | Promise<void> | Create a directory |
| removeFile(path) | Promise<void> | Remove a file |
| removeDir(path) | Promise<void> | Remove an empty directory |
| rename(oldPath, newPath) | Promise<void> | Rename a file or directory |
| realPath(path) | Promise<string> | Resolve a canonical path |
| readLink(path) | Promise<string> | Read a symlink target |
| symlink(target, linkPath) | Promise<void> | Create a symlink |
| close() | Promise<void> | Close the SFTP session |
SshServer
serveConnection()
close()
Types
SshOutput
| Property | Type | Description |
|---|---|---|
| status | number | Exit status code |
| stdout | Buffer | Captured stdout bytes |
| stderr | Buffer | Captured stderr bytes |
SshClientOptions
| Property | Type | Description |
|---|---|---|
| user | string | SSH login user. Defaults to root |
| term | string | Terminal name for interactive sessions |
| sftp | boolean | Enable or disable SFTP on the internal server |
SshExecOptions
| Property | Type | Description |
|---|---|---|
| tty | boolean | Request a PTY for the exec channel |
SshAttachOptions
| Property | Type | Description |
|---|---|---|
| term | string | Terminal name for the shell |
| detachKeys | string | Detach key sequence |
SshServerOptions
| Property | Type | Description |
|---|---|---|
| hostKeyPath | string | Override the host private key path |
| authorizedKeysPath | string | Override the authorized-keys path |
| user | string | Override the guest user used for exec requests |
| sftp | boolean | Enable or disable SFTP |