Yazi includes a Virtual Filesystem (VFS) that abstracts file operations across different storage backends. This enables seamless remote file management alongside local files using the same interface.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/sxyazi/yazi/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The VFS provides a unified API for file operations regardless of the underlying storage:- Local files - Standard filesystem operations
- SFTP - SSH-based remote file access
- Archive files - Navigate inside archives (future)
- Custom providers - Extensible for new backends
Architecture
The VFS is implemented through a provider system inyazi-vfs/:
URL Scheme
Yazi uses URL-based paths to identify resources:Example URLs
- Local:
/home/user/documents/file.txt - SFTP:
sftp://server.example.com/var/www/ - Archive:
/home/user/archive.zip!/folder/file.txt(future) - Search:
fzf://search-query
SFTP Support
Yazi provides full SFTP support for remote file management over SSH.Configuration
Configure SFTP hosts in~/.config/yazi/yazi.toml:
Connecting
Connect to SFTP servers using thecd command:
- Authenticate via SSH agent or key file
- Establish SFTP connection
- Navigate to the specified path
- Display remote files like local ones
Connection Management
SFTP connections are pooled and reused for efficiency:- Persistent - Reused across operations
- Automatic reconnect - Handle network interruptions
- Concurrent - Multiple operations use same connection
- Pooled - Connection pool prevents resource exhaustion
Supported Operations
All standard file operations work over SFTP:Reading
- List directories
- Read file contents
- Get file metadata
- Follow symbolic links
- Calculate directory sizes
Writing
- Create files and directories
- Copy files (SFTP → SFTP, local → SFTP, SFTP → local)
- Move/rename files
- Delete files and directories
- Create symbolic links
- Create hard links (if supported by server)
Bulk Operations
- Copy multiple files
- Bulk rename
- Multi-select operations
- Progress tracking for large transfers
Implementation
The SFTP provider is implemented inyazi-vfs/src/provider/sftp/sftp.rs:78:
Progress Tracking
Large SFTP transfers show progress:Cross-Provider Operations
The VFS seamlessly handles operations across different providers:Local ↔ SFTP
- Routes to appropriate provider
- Handles different path formats
- Preserves attributes when possible
- Shows unified progress tracking
Capabilities System
Providers declare their capabilities:- Feature detection
- Graceful degradation
- Provider-specific optimizations
- Error prevention
Metadata Handling
The VFS normalizes metadata across providers:Cha (characteristics) includes:
- File type (regular, directory, symlink)
- Permissions
- Size
- Modified time
- Link target (for symlinks)
Error Handling
VFS operations return standard I/O errors:- Consistent - Same error types across providers
- Actionable - Clear error messages
- Recoverable - Retry logic for network issues
Directory Reading
Directory listing works uniformly:Performance Optimizations
The VFS includes several performance optimizations:Connection Pooling
SFTP connections are pooled to avoid reconnection overhead.Buffered I/O
Large buffers (512KB) maximize throughput:Async Operations
All I/O is non-blocking and runs on Tokio runtime.Parallel Transfers
Multiple files transfer simultaneously when possible.Limitations
Current Limitations
- Trash not supported - SFTP files are permanently deleted
- No compression - Files transfer uncompressed
- SFTP only - Other protocols (FTP, S3, etc.) not yet supported
Future Plans
- Additional protocols (FTP, WebDAV, S3)
- Archive mounting (browse ZIP/TAR as directories)
- Custom search providers
- Cloud storage integration
Advanced Usage
Case-Insensitive Paths
The VFS handles case-insensitive filesystems:Absolute Path Resolution
Identity Checking
See Also
- Async Tasks - Task system for VFS operations
- DDS - Sync operations across instances
- Configuration - VFS configuration options