Skip to main content

Overview

m87 provides powerful file transfer capabilities using device:path syntax to reference remote locations. All file transfers use SFTP over the secure m87 tunnel.

Path Syntax

Remote paths use scp-style resolution:

Path Resolution Rules

  • Relative paths (no leading /) → Resolve to user’s home directory
  • Absolute paths (starting with /) → Used as-is
  • Tilde expansion (~) → Expands to home directory

Examples


Copy Command (cp)

Copy individual files between local and remote devices (SCP-style).

Syntax

Either source or destination must be a remote path using <device>:<path> format.

Examples

The cp command is best for copying individual files or directories. For continuous synchronization with change detection, use the sync command.

Sync Command

Synchronize directories between local and remote devices (rsync-style).

Syntax

Options

Basic Examples

Exclude Patterns

The --exclude flag supports:
  • Exact names: --exclude node_modules (matches any path component)
  • Wildcards: --exclude "*.log" (matches app.log, error.log, etc.)

Dry Run

Preview what will be synced without making changes:
Always use --dry-run first when using --delete to ensure you won’t accidentally remove important files.

List Files Command (ls)

List contents of a remote directory.

Syntax

Examples


Real-World Examples

Deploy Application

Development Workflow

Backup Remote Files

Clean Deploy with Verification

Quick Script Deployment

Database Backup


Performance Notes

  • File transfers use SFTP over the m87 secure tunnel
  • Large files are transferred efficiently without loading into memory
  • --watch mode polls for changes every 2 seconds
  • Relative remote paths resolve to home directory for convenience