Skip to main content
View Markdown

Compare Files (zeysdk compare)

The compare command compares local files with their server versions to detect content and property differences.

Bash
zeysdk compare [ASSET_PATH...] [options]

Parameters

ParameterDescriptionRequiredExample
ASSET_PATHSpecific asset paths to compareNoservices/backup.ixml weblets/dashboard.ixml

Options

OptionDescription
--verboseShow detailed output

Process

  1. State Loading

    • Reads local sync configuration
    • Loads local file metadata
    • Fetches matching server metadata
  2. Comparison

    • Compares local file hashes with stored sync hashes
    • Compares server hashes with stored sync hashes
    • Checks metadata properties for differences
  3. Output

    • Groups results by asset type
    • Marks local, server, and conflict states
    • Opens a diff tool when comparing selected files with content differences

Status Indicators

SymbolMeaning
+Created locally or added on server
-Deleted locally or deleted on server
~Modified locally or modified on server
!Conflict
<>Property conflict
->Local changes to be pushed
<-Server changes to be pulled

Comparison Categories

The output is organized by asset type:

  • Settings
  • Services
  • Assets
  • Resources
  • Weblets

Examples

Bash
zeysdk compare
zeysdk compare services/backup.ixml weblets/dashboard.ixml
zeysdk compare --verbose

Error Handling

ErrorDescriptionResolution
Missing sync.jsonNo sync configurationRun zeysdk link first
Invalid sync.jsonMissing id/urlRe-link instance
Diff tool errorTool launch failedSelect alternative tool
Server errorCannot fetch remoteCheck connection/auth
Parse errorInvalid file contentCheck file format

Notes

  • compare does not change local files or server state
  • compare reads the active instance and may fetch remote file contents to support a diff
  • compare does not acquire .zeysdk/.sync.lock; avoid running it during a modifying synchronization command if you need a consistent snapshot
  • Passing specific asset paths limits comparison and may open a diff workflow
  • Metadata differences are reported separately from content changes
  • Diff tool behavior depends on the global CLI configuration
  • Remote snapshots reuse the content fetched during comparison, including empty files, and are removed after the comparison tool exits
  • Beyond Compare uses its waiting launcher (bcomp on macOS, BComp.com on Windows), so an already-open window can read the remote snapshot before it is removed
  • Beyond Compare's normal result codes (0, 1, 2, 11–14) finish the comparison without prompting for another tool; launch failures and error codes remain failures
  • To use Hunk, install its CLI separately, then select Default Diff Tool → Hunk in zeysdk configure; the viewer runs in the current terminal
  • Custom comparison commands must wait until the viewer is finished before exiting

Best Practices

  • Run zeysdk compare before push, pull, or sync when remote state may have changed
  • Compare specific files when investigating a focused change
  • Configure a diff tool with zeysdk configure for easier conflict review
  • Resolve unexpected differences before running forced sync commands