Skip to main content

Overview

The Filesystem Browser provides a full file explorer for sandbox workspaces - both in the dashboard UI and via API.

Dashboard File Browser

Access from Dashboard → Sandboxes → [Select Sandbox] → Files The visual file browser includes:
  • Tree view — Navigate folder hierarchy with expand/collapse
  • File metadata — Size, last modified time, git status
  • Quick actions — Upload, create file, create folder, download all
  • Context menus — Right-click for rename, delete, copy path

Open File Browser

Browse sandbox files in the dashboard

Features

  • Tree View - Navigate folder hierarchy
  • File Preview - View file contents inline
  • Syntax Highlighting - For code files
  • Image Preview - For images
  • Edit Files - Edit and save directly
  • Upload/Download - Transfer files to/from sandbox
  • Search - Find files by name or content
  • Git Integration - See git status, diffs

API Access

// List directory
const files = await sandbox.files.list('/workspace/src');
// [
//   { name: 'App.tsx', type: 'file', size: 3200, modified: '...' },
//   { name: 'components', type: 'directory' },
// ]

// Read file
const content = await sandbox.files.read('/workspace/src/App.tsx');

// Write file
await sandbox.files.write('/workspace/src/App.tsx', newContent);

// Create directory
await sandbox.files.mkdir('/workspace/src/utils');

// Delete
await sandbox.files.remove('/workspace/src/old.ts');

// Check if exists
const exists = await sandbox.files.exists('/workspace/package.json');

// Get file info
const info = await sandbox.files.stat('/workspace/src/App.tsx');
// { size: 3200, modified: '...', created: '...', type: 'file' }

Search Files

// Search by filename
const files = await sandbox.files.search({
  pattern: '*.tsx',
  path: '/workspace/src',
});

// Search by content
const files = await sandbox.files.search({
  content: 'useState',
  path: '/workspace/src',
});

Upload and Download

// Upload file
const buffer = await fs.readFile('local-file.txt');
await sandbox.files.upload('/workspace/data.txt', buffer);

// Upload directory
await sandbox.files.uploadDir('./local-folder', '/workspace/uploads');

// Download file
const content = await sandbox.files.download('/workspace/output.json');
await fs.writeFile('local-output.json', content);

// Download directory as zip
const zip = await sandbox.files.downloadDir('/workspace/dist');
await fs.writeFile('dist.zip', zip);

File Watching

Watch for file changes in real-time:
// Watch for changes
const watcher = await sandbox.files.watch('/workspace/src');

watcher.on('change', (event) => {
  console.log(event.type, event.path);
  // 'modify' '/workspace/src/App.tsx'
  // 'create' '/workspace/src/newfile.ts'
  // 'delete' '/workspace/src/old.ts'
});

// Stop watching
watcher.close();

Git Integration

If the sandbox has a git repository:
// Get git status
const status = await sandbox.git.status();
// { modified: ['src/App.tsx'], untracked: ['newfile.ts'] }

// View diff
const diff = await sandbox.git.diff('src/App.tsx');

// View commit history
const commits = await sandbox.git.log({ limit: 10 });

CLI Usage

# List files
runtools sandbox files sandbox-abc123 /workspace

# Read file
runtools sandbox cat sandbox-abc123 /workspace/src/App.tsx

# Download file
runtools sandbox download sandbox-abc123 /workspace/dist.zip ./local/

# Upload file
runtools sandbox upload sandbox-abc123 ./local/file.txt /workspace/

# Watch for changes
runtools sandbox watch sandbox-abc123 /workspace/src

Permissions

File operations respect sandbox permissions:
PermissionEffect
files:readCan list and read files
files:writeCan create, modify, delete files
files:executeCan execute files
Set permissions when creating sandbox:
const sandbox = await rt.sandboxes.create({
  template: 'nodejs-20',
  permissions: ['files:read', 'files:write'],
});