spawn pin cleanup
Usage
spawn pin cleanup [--dry-run] Overview
Section titled “Overview”Over time, your pinned/ directory may accumulate orphaned files – snapshots of components that are no longer referenced by any migration’s lock.toml. This can happen when you:
- Delete a migration
- Re-pin a migration after changing components
The cleanup command identifies and removes these orphaned files to reclaim disk space and keep your repository clean.
Behavior
Section titled “Behavior”- Scans all migrations for
lock.tomlfiles - Walks the tree structure of each pinned snapshot to find all referenced hashes
- Lists all files in the
pinned/directory - Deletes files that exist in
pinned/but aren’t referenced by any migration
Examples
Section titled “Examples”Preview what would be deleted
Section titled “Preview what would be deleted”spawn pin cleanup --dry-runOutput:
Would delete 4 orphaned pinned file(s): 7a3f5e8b9c2d1a4e6f8b0c2d4e6f8a0b 93b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8 c6e8f0a2b4c6d8e0f2a4b6c8d0e2f4a6 fd1e2f3a4b5c6d7e8f9a0b1c2d3e4f5a
2 pinned file(s) are still referenced by migrations.
Run without --dry-run to delete orphaned files.Delete orphaned files
Section titled “Delete orphaned files”spawn pin cleanupOutput:
Deleted 4 orphaned pinned file(s).2 pinned file(s) are still referenced by migrations.Nothing to clean up
Section titled “Nothing to clean up”spawn pin cleanupOutput:
No orphaned pinned files found. Nothing to clean up.When to run
Section titled “When to run”- Before committing: Run
spawn pin cleanup --dry-runto check if there are orphans worth cleaning up - After deleting migrations: Clean up pinned files that are no longer needed
- Periodically: As part of repository maintenance
Safety
Section titled “Safety”The command only deletes files in the pinned/ directory that are provably unreferenced. Files referenced by any migration’s lock.toml are never deleted.
Use --dry-run first if you want to review what will be removed.
Options
| Option | Description |
|---|---|
--dry-run | Show what would be deleted without actually deleting any files. |
--target <name> | Select which target from spawn.toml to use. |
--config-file <path> | Path to config file. Defaults to spawn.toml. |
-d, --debug | Turn on debug output. |