Pull Files (zeysdk pull)
Download server files to local environment, overwriting local versions.
zeysdk pull [files...] [options]
Parameters
| Parameter | Description | Required | Example |
|---|---|---|---|
files | Specific files to pull | ❌ | services/backup.js |
Options
| Option | Description | Default |
|---|---|---|
-f, --force | Skip confirmation prompts | false |
--rehash | Force rehashing of all files | false |
--verbose | Show detailed progress | false |
File Hashing and Synchronization
The sync process determines which files need to be synchronized by comparing file hashes and timestamps:
-
Automatic Rehashing: Files are automatically rehashed when:
- The file's last modified timestamp is newer than the stored timestamp
- The file size has changed
- No hash exists in the sync.json file
- The lastmodified field is empty or invalid
-
Manual Rehashing: Use the
--rehashflag to force rehashing of all files, which is useful when:- Timestamps are unreliable
- You suspect hash inconsistencies
- After manually editing files outside the SDK
-
Verbose Logging: Use
--verboseto see detailed information about:- Which files are being rehashed and why
- Cache hits and misses
Examples
# Pull all files
zeysdk pull --verbose
# Output:
# Loading sync info and package info...
# Fetching server changes...
# Updating local files...
# ✓ Pull successful
# Force rehashing of all files
zeysdk pull --rehash
# Pull specific files
zeysdk pull services/backup.js weblets/dashboard.js
# Force pull without confirmation
zeysdk pull -f
Error Handling
| Error | Description | Resolution |
|---|---|---|
| Missing sync.json | No sync configuration | Run zeysdk link first |
| Invalid sync.json | Missing id/url | Relink instance |
| Network error | Server unreachable | Check connection |
| Auth error | Invalid/expired token | Auto-relinks |
| Write error | Cannot write local file | Check permissions |
Warning
⚠️ Pull operations will overwrite local changes without merge. Use zeysdk compare first to check for local modifications.