List Snapshots
The snapshot list command displays existing snapshots and supports interactive snapshot management.
Bash
zeysdk snapshot list
Features
| Feature | Description |
|---|---|
| List | View all snapshots with comments and dates |
| Restore | Revert to a selected snapshot |
| Delete | Remove selected snapshot |
| Details | View snapshot metadata |
Process
-
Metadata Loading
- Reads local snapshot metadata
- Exits when no snapshots are available
- Formats snapshot rows for interactive display
-
Snapshot Selection
- Displays snapshot ID, comment, and date
- Uses configured list height when available
- Prompts you to select a snapshot
-
Action Selection
- Shows details for the selected snapshot
- Offers restore or delete actions
- Confirms deletion before removing a snapshot
- Press Escape in a restore/delete confirmation to return to snapshot actions without making changes
- Press Escape in snapshot actions to return to the snapshot list, or in the list to exit
- Declining deletion returns to snapshot actions, with Delete still selected
- Returning to either menu preserves its selected row
Display Format
| Column | Description |
|---|---|
| ID | Snapshot identifier (YYYYMMDD-HHMMSS, optionally with a collision suffix) |
| Comment | User-provided description |
| Date | Creation timestamp |
Examples
Bash
zeysdk snapshot list
Error Handling
| Error | Description | Resolution |
|---|---|---|
| No snapshots | Snapshot metadata is empty | Create a snapshot first |
| Metadata error | Snapshot metadata cannot be read | Check snapshot metadata file |
| Restore failed | Selected restore action failed | Check snapshot archive and permissions |
| Delete failed | Selected delete action failed | Check file permissions |
Notes
- Snapshot IDs are displayed without the
.zipsuffix - Missing or invalid comments and dates display as
No commentandNo date - The list is driven by
.zeysdk/snapshots/snapshots.json; an orphan ZIP without metadata is not displayed - The interactive list supports restore and delete actions
- Delete actions ask for confirmation before removing the archive
- Restore actions use the current working directory as the restore target
Best Practices
- Review comments before restoring a snapshot
- Keep comments specific enough to identify the project state
- Delete old snapshots that are no longer useful
- Keep at least one known-good snapshot before risky local changes