Zum Hauptinhalt springen
Markdown anzeigen

List Snapshots

The snapshot list command displays existing snapshots and supports interactive snapshot management.

Bash
zeysdk snapshot list

Features

FeatureDescription
ListView all snapshots with comments and dates
RestoreRevert to a selected snapshot
DeleteRemove selected snapshot
DetailsView snapshot metadata

Process

  1. Metadata Loading

    • Reads local snapshot metadata
    • Exits when no snapshots are available
    • Formats snapshot rows for interactive display
  2. Snapshot Selection

    • Displays snapshot ID, comment, and date
    • Uses configured list height when available
    • Prompts you to select a snapshot
  3. 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

ColumnDescription
IDSnapshot identifier (YYYYMMDD-HHMMSS, optionally with a collision suffix)
CommentUser-provided description
DateCreation timestamp

Examples

Bash
zeysdk snapshot list

Error Handling

ErrorDescriptionResolution
No snapshotsSnapshot metadata is emptyCreate a snapshot first
Metadata errorSnapshot metadata cannot be readCheck snapshot metadata file
Restore failedSelected restore action failedCheck snapshot archive and permissions
Delete failedSelected delete action failedCheck file permissions

Notes

  • Snapshot IDs are displayed without the .zip suffix
  • Missing or invalid comments and dates display as No comment and No 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