Skip to main content

Push Files (zeysdk push)

Upload local files to the ZeyOS server, overwriting server versions.

zeysdk push [files...] [options]

Parameters

ParameterDescriptionRequiredExample
filesSpecific files to pushservices/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

# Push all files
zeysdk push --verbose
# Output:
# Loading sync info and package info...
# Building change list...
# Pushing changes to server...
# ✓ Push successful

# Force rehashing of all files
zeysdk push --rehash


# Push specific files
zeysdk push services/backup.js weblets/dashboard.js

# Force push without confirmation
zeysdk push -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
File errorCannot read local fileCheck permissions