Watch Files (zeysdk watch)
Monitor files for changes and automatically push updates to the ZeyOS server.
zeysdk watch [options]
Options
| Option | Description | Default |
|---|---|---|
--verbose | Show detailed monitoring output | false |
Watched Directories
The following directories and files are monitored for changes:
settings- Configuration filesservices- Service scriptsweblets- Web componentsresources- Static resourceszeyos.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
| Error | Description | Resolution |
|---|---|---|
| Missing sync.json | No sync configuration | Run zeysdk link first |
| Invalid sync.json | Missing id/url | Relink instance |
| Watch error | Cannot monitor directory | Check permissions |
| Push error | Failed to upload changes | Check connection |
| Auth error | Invalid/expired token | Auto-relinks |
Important Notes
-
Auto-Push
- Changes are pushed automatically
- No confirmation prompts
- Force mode is enabled
-
Performance
- Monitors all asset directories
- Recursive watching enabled
- Real-time updates
-
Limitations
- No debouncing of rapid changes
- Cannot watch specific files
- All changes trigger push
-
Best Practices
- Use in development environment
- Monitor verbose output for issues
- Check sync status periodically