File Sync¶
Shed supports syncing files from your local machine to shed containers. This is useful for development certificates, dotfiles, SSH keys, and custom scripts.
Quick Start¶
Sync files using the default profile:
Preview without syncing:
Configuration¶
Create ~/.shed/sync.yaml on your local machine:
features:
devproxy:
description: "Sync mkcert certificates for HTTPS development"
paths:
- source: ~/.local/share/mkcert/rootCA.pem
target: /usr/local/share/ca-certificates/mkcert-ca.crt
- source: ~/.devproxy/certs
target: /etc/ssl/devproxy
include: "*.pem"
postSync:
- run: update-ca-certificates
dotfiles:
description: "Sync shell config and git settings"
paths:
- source: ~/.gitconfig
target: /home/shed/.gitconfig
- source: ~/.bashrc
target: /home/shed/.bashrc
scripts:
description: "Sync custom scripts"
paths:
- source: ~/bin
target: /usr/local/bin
include: "*.sh"
profiles:
default:
features: [devproxy]
full:
features: [devproxy, dotfiles, scripts]
Features¶
A feature is a self-contained sync unit with paths and optional post-sync commands.
Feature Fields¶
| Field | Type | Description |
|---|---|---|
description |
string | Human-readable description |
paths |
list | Files or directories to sync |
postSync |
list | Commands to run after syncing |
Path Fields¶
| Field | Type | Description |
|---|---|---|
source |
string | Local path (supports ~ expansion) |
target |
string | Remote path in container |
include |
string | Optional glob pattern to filter files |
Profiles¶
Profiles group features together for common sync scenarios.
- The
defaultprofile syncs automatically onshed create - Use
--profileto specify a different profile - Use
--featureto sync a single feature
Commands¶
Sync Files¶
| Flag | Short | Default | Description |
|---|---|---|---|
--profile |
-p |
default |
Sync profile to use |
--feature |
-f |
Sync single feature | |
--dry-run |
false |
Preview without syncing |
Examples:
# Sync default profile
shed sync myproj
# Sync specific profile
shed sync myproj -p full
# Sync single feature
shed sync myproj -f devproxy
# Preview without syncing
shed sync myproj --dry-run
Auto-Sync on Create¶
# Auto-sync with default profile
shed create myproj --repo user/repo
# Create with specific profile
shed create myproj --sync-profile full
# Skip sync on create
shed create myproj --no-sync
Example: Development Certificates¶
Sync mkcert certificates so containers trust your local CA:
features:
devproxy:
description: "Sync mkcert certificates for devproxy"
paths:
- source: ~/.local/share/mkcert/rootCA.pem
target: /usr/local/share/ca-certificates/mkcert-ca.crt
- source: ~/.devproxy/certs
target: /etc/ssl/devproxy
include: "*.pem"
postSync:
- run: update-ca-certificates
profiles:
default:
features: [devproxy]
Verify the CA was added:
Direct File Transfer¶
In addition to the profile-based sync system, shed supports standard file transfer tools through its SSH proxy. These work with any shed on any backend.
SFTP¶
# Using the generated SSH config
sftp shed-myproject
# Or directly via shed-server SSH port
sftp -P 2222 myproject@server.tailnet.ts.net
SCP¶
# Copy a file into a shed
scp localfile.txt shed-myproject:/workspace/
# Copy a file out of a shed
scp shed-myproject:/workspace/output.json ./
rsync¶
# Sync a directory into a shed
rsync -avz ./src/ shed-myproject:/workspace/src/
# Sync with delete (mirror local to remote)
rsync -avz --delete ./src/ shed-myproject:/workspace/src/
All three tools work through the SSH config entries generated by shed ssh-config --all --install. Without the SSH config, use the server address and port directly (e.g., -P 2222 myproject@server).
When to use which:
shed sync— repeatable, config-driven syncing of dotfiles, certificates, and scripts (runs automatically on create)sftp/scp— ad-hoc file transfersrsync— efficient incremental syncing of large directories
Logs¶
Sync output is saved to /var/log/shed/sync.log in the container: