Zum Hauptinhalt springen

Pull Files (zeysdk pull)

Download server files to local environment, overwriting local versions.

zeysdk pull [files...] [options]

Parameters

ParameterDescriptionRequiredExample
filesSpecific files to pullservices/backup.js

Options

OptionDescriptionDefault
-f, --forceSkip confirmation promptsfalse
--rehashForce rehashing of all filesfalse
--verboseShow detailed progressfalse

File Hashing and Synchronization

The sync process determines which files need to be synchronized by comparing file hashes and timestamps:

  1. 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
  2. Manual Rehashing: Use the --rehash flag to force rehashing of all files, which is useful when:

    • Timestamps are unreliable
    • You suspect hash inconsistencies
    • After manually editing files outside the SDK
  3. Verbose Logging: Use --verbose to 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

ErrorDescriptionResolution
Missing sync.jsonNo sync configurationRun zeysdk link first
Invalid sync.jsonMissing id/urlRelink instance
Network errorServer unreachableCheck connection
Auth errorInvalid/expired tokenAuto-relinks
Write errorCannot write local fileCheck permissions

Warning

⚠️ Pull operations will overwrite local changes without merge. Use zeysdk compare first to check for local modifications.