Skip to content

sync

Resolve SPM dependencies and refresh CLI-managed regenerable files.

Re-resolves Swift Package Manager dependencies and rewrites the small set of files the CLI fully owns.

Terminal window
swiftspawn sync

Run sync after changing .swiftspawn.yml, after pulling teammates’ changes, or whenever you suspect the regenerable files are out of date. It does not touch hand-written code; it only re-emits files whose contents are entirely CLI-owned.

sync is safe to run repeatedly. Its job is convergence: regardless of starting state, the project ends in the same shape the templates describe.

  1. Reads .swiftspawn.yml to find the project name and config.
  2. Runs swift package resolve to refresh Package.resolved.
  3. Re-renders any fully CLI-owned files in place.

It does not rewrite files that have marker-edit regions; those are only updated by the specific generator that owns them.

Terminal window
swiftspawn sync
  • Updates Package.resolved.
  • May rewrite fully-managed regenerable files if templates have drifted.
CodeMeaning
5Not in a swiftspawn project (no .swiftspawn.yml found).
6Prerequisite missing (e.g. swift on PATH).