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.
Synopsis
Section titled “Synopsis”swiftspawn syncDescription
Section titled “Description”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.
What it does
Section titled “What it does”- Reads
.swiftspawn.ymlto find the project name and config. - Runs
swift package resolveto refreshPackage.resolved. - 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.
Examples
Section titled “Examples”swiftspawn syncSide effects
Section titled “Side effects”- Updates
Package.resolved. - May rewrite fully-managed regenerable files if templates have drifted.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 5 | Not in a swiftspawn project (no .swiftspawn.yml found). |
| 6 | Prerequisite missing (e.g. swift on PATH). |