Skip to main content
Sync local files to Contree with smart caching. No VM needed.

Parameters

ParameterTypeDefaultDescription
sourcestringrequiredLocal path or glob pattern
destinationstringrequiredContainer target directory
excludearray[]Patterns to exclude

Examples

Basic:
{"source": "/project", "destination": "/app"}
With exclusions:
{
  "source": "/project",
  "destination": "/app",
  "exclude": ["__pycache__", "*.pyc", ".git", ".venv", "node_modules"]
}
Glob pattern:
{"source": "/project/**/*.py", "destination": "/app"}

Response

Returns an integer directory_state_id for use with the run tool:
42

Using with run

// 1. Sync
{"tool": "rsync", "args": {"source": "/project", "destination": "/app"}}
// Returns: 42

// 2. Run (reuse directory_state_id for multiple runs)
{"tool": "run", "args": {
  "command": "python /app/main.py",
  "image": "uuid",
  "directory_state_id": 42
}}

Caching

Three-tier: local cache → content hash → server dedup. Only changed files upload. Tip: Reuse directory_state_id for the session. Re-sync only when files change.
["__pycache__", "*.pyc", ".git", ".venv", "node_modules", "*.log", ".DS_Store"]