Push Files (zeysdk push)
Upload local files to the ZeyOS server, overwriting server versions.
zeysdk push [files...] [options]
Parameters
| Parameter | Description | Required | Example |
|---|---|---|---|
files | Specific files to push | ❌ | 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
# 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
| 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 |
| File error | Cannot read local file | Check permissions |