Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt

Use this file to discover all available pages before exploring further.

SSHResource opens an SFTP session and mounts the remote root as a filesystem.
Node only. Requires the ssh2 peer dependency. The browser SDK doesn’t ship an SSH client.

Install

pnpm add @struktoai/mirage-node ssh2

Config

import { MountMode, SSHResource, Workspace } from '@struktoai/mirage-node'

const ssh = new SSHResource({
  host: 'jump.example.com',
  username: 'me',
  identityFile: '~/.ssh/id_ed25519',
  root: '/srv/data',
})

const ws = new Workspace({ '/remote': ssh }, { mode: MountMode.READ })
await ws.execute('ls /remote')
FieldDefaultNotes
hostrequiredHost alias from ~/.ssh/config or a real DNS name.
hostnamehostOverride if host is an alias and the actual DNS name differs.
port22
username(from ssh-config)
passwordnoneRedacted in snapshots. Prefer identityFile.
identityFilenonePath to a private key. ~ is expanded.
passphrasenonePassphrase for identityFile. Redacted in snapshots.
root/Path on the remote that becomes the mount root.
timeout10000Connect timeout in ms.
knownHostssystemPath to a known_hosts file.

Mount mode

read, write. Writes flush via SFTP put. For the full set of supported shell commands and snapshot behavior see the Python SSH docs.