Zum Hauptinhalt springen

Watch Files (zeysdk watch)

Monitor files for changes and automatically push updates to the ZeyOS server.

zeysdk watch [options]

Options

OptionDescriptionDefault
--verboseShow detailed monitoring outputfalse

Watched Directories

The following directories and files are monitored for changes:

  • settings - Configuration files
  • services - Service scripts
  • weblets - Web components
  • resources - Static resources
  • zeyos.app.json - Application manifest

Examples

# Start watching with basic output
zeysdk watch

# Start watching with detailed logging
zeysdk watch --verbose
# Output:
# Starting to watch for file changes...
# Watchers set up successfully.
# Change detected in services/backup.ixml
# Running zeysdk push...
# Push completed for changes in services/backup.ixml

Error Handling

ErrorDescriptionResolution
Missing sync.jsonNo sync configurationRun zeysdk link first
Invalid sync.jsonMissing id/urlRelink instance
Watch errorCannot monitor directoryCheck permissions
Push errorFailed to upload changesCheck connection
Auth errorInvalid/expired tokenAuto-relinks

Important Notes

  1. Auto-Push

    • Changes are pushed automatically
    • No confirmation prompts
    • Force mode is enabled
  2. Performance

    • Monitors all asset directories
    • Recursive watching enabled
    • Real-time updates
  3. Limitations

    • No debouncing of rapid changes
    • Cannot watch specific files
    • All changes trigger push
  4. Best Practices

    • Use in development environment
    • Monitor verbose output for issues
    • Check sync status periodically