Skip to main content
Spacedrive uses a unified addressing scheme that works seamlessly across local devices, cloud storage, and content-addressed files. Every file has a single, intuitive URI that tells you exactly where it lives - whether it’s on your laptop, in S3, or stored by content hash. Local devices:
Cloud storage:
Content addressed:
The same URI format works across all storage types, matching industry-standard cloud tools like AWS CLI and gsutil. Copy a path from Spacedrive and paste it directly into your terminal.

URI Formats

Cloud Storage - Service-Native URIs

Cloud files use the same URI format as their native tools:
Pattern: {service}://{identifier}/{path} Where:
  • {service}: Cloud service type (s3, gdrive, onedrive, dropbox, azblob, gcs, b2, wasabi, spaces)
  • {identifier}: Service-specific root (bucket name, folder, container)
  • {path}: Path within the service
These URIs match AWS CLI, gsutil, and other cloud tools exactly. Copy a path from Spacedrive and paste it into aws s3 cp without modification.

Local Files - Device-Aware URIs

Local files include the device name for multi-device clarity:
Pattern: local://{device-slug}/{path} Where:
  • {device-slug}: URL-safe device identifier (generated from device name)
  • {path}: Absolute path on that device
Device slugs are generated automatically from your device name by converting to lowercase and replacing non-alphanumeric characters with hyphens. “Jamie’s MacBook Pro” becomes jamies-macbook-pro.

Content-Addressed Files

Content URIs reference files by their content hash, independent of location:
Pattern: content://{uuid} This enables location-independent operations. The same photo stored on multiple devices and in cloud storage shares one content URI. Spacedrive resolves it to the most efficient available location.

Device Slug System

Spacedrive generates URL-safe slugs from device names to create stable, human-readable URIs.

Slug Generation

Examples:
  • “Jamie’s MacBook” → jamies-macbook
  • “Home Server 2024” → home-server-2024
  • “DESKTOP-ABC123” → desktop-abc123

Slug Uniqueness

Each device’s slug must be unique within your Spacedrive network. The database enforces this with a unique constraint on the slug column. If you try to add a device with a duplicate name, you’ll need to rename one device.
If two devices have the same name (e.g., both “MacBook Pro”), you must give them distinct names before they can sync. Spacedrive will warn you during pairing.

Resolution

When parsing a local:// URI, Spacedrive looks up the device by slug:
Currently, slug resolution only works for the current device. Remote device paths use UUIDs internally but display with slugs for user-facing operations.

How It Works

Spacedrive maintains user-friendly URIs in the display layer while using efficient internal identifiers for operations.

User-Facing Display

Internal Representation

Resolution Flow

The service and identifier are stored directly in the SdPath, making cloud paths self-contained. The VolumeManager maintains a mount point cache for fast volume lookups.

Cloud Service Schemes

Spacedrive supports these cloud URI schemes: S3-compatible services (MinIO, Cloudflare R2, Wasabi, etc.) use the s3:// scheme with custom endpoints.

Parsing URIs

From User Input

Error Handling

CLI Usage

The unified addressing scheme makes CLI operations intuitive:

Code Examples

File Operations

Display Paths

Building Paths

Industry Standard Alignment

Spacedrive’s addressing matches industry tools: AWS CLI:
gsutil:
Azure CLI:
The alignment eliminates context switching between tools. URIs copy-paste directly between Spacedrive and native cloud tools.

Benefits

Self-Documenting

URIs clearly show where files live:
No need to remember which cloud provider or check internal IDs.

Cross-Storage Operations

Operations work identically across storage types:

Location Independence

Content URIs enable operations without knowing physical location:

Limitations

Device Slug Resolution

Device slug resolution works for all devices in the library through an in-memory cache. When a library opens, all device slugs are loaded into the DeviceManager’s cache, enabling instant O(1) resolution for any device whether online or offline. The cache updates automatically when:
  • A library is opened (loads all devices from database)
  • New devices pair and sync
  • The library closes (cache is cleared)
This means local:// URIs can reference any device in the library, not just the current device.

Cloud Volume Lookup

Cloud volumes use an O(1) mount point cache for fast lookups. The cache maps mount point strings (e.g., "s3://my-bucket") to volume fingerprints. For volumes added before the cache was implemented, a linear scan serves as a fallback.

Slug Collisions

If two devices would generate the same slug, the second device must be renamed. There’s no automatic disambiguation.

Best Practices

URI Display

Use display() to convert SdPath to a user-facing URI string. The method generates the appropriate format automatically based on the path type.

URI Parsing

Use from_uri() when parsing user input. The method parses service-native URIs and validates the format.

Device Naming

Choose distinct device names to avoid slug collisions. Include location or purpose in names:
  • “jamies-macbook-home”
  • “jamies-macbook-work”
  • “home-server-basement”
  • “backup-nas-office”

Cloud Mount Points

Spacedrive ensures cloud mount points are unique by appending -2, -3 if collisions occur:
This enables multiple configurations for the same cloud resource.