Skip to content

Add CLI commands for cloud snapshot management #488

@phernandez

Description

@phernandez

Summary

Add CLI commands to allow users to manage bucket snapshots from the bm command line tool.

Background

Basic Memory Cloud now supports Tigris bucket snapshots (PR basicmachines-co/basic-memory-cloud#346). Users should be able to manage snapshots via the CLI in addition to the web UI.

CLI Commands

Create snapshot

bm cloud snapshot create "before major refactor"
→ Created snapshot: snap_abc123 (2025-11-25T10:30:00)

List snapshots

bm cloud snapshot list
→ snap_abc123  "before major refactor"  2025-11-25  42 MB
→ snap_xyz789  "daily backup"           2025-11-24  41 MB

Delete snapshot

bm cloud snapshot delete snap_abc123
→ Deleted snapshot snap_abc123

Restore file from snapshot

bm cloud restore notes/project.md --snapshot snap_abc123
→ Restored notes/project.md from snapshot snap_abc123

Restore entire folder

bm cloud restore research/ --snapshot snap_abc123
→ Restored 12 files from research/

API Endpoints

The cloud service already exposes these endpoints:

  • POST /api/bucket-snapshots - Create snapshot
  • GET /api/bucket-snapshots - List snapshots
  • GET /api/bucket-snapshots/{id} - Get snapshot details
  • DELETE /api/bucket-snapshots/{id} - Delete snapshot
  • GET /api/bucket-snapshots/{id}/browse?prefix= - Browse snapshot contents
  • POST /api/bucket-snapshots/{id}/restore - Restore from snapshot

Implementation Notes

  • Commands should be under bm cloud snapshot subgroup
  • Restore command could be bm cloud restore or bm cloud snapshot restore
  • Need to handle authentication (existing cloud auth flow)
  • Consider adding --format json option for scripting

Related

  • basicmachines-co/basic-memory-cloud#346 - SPEC-29: Tigris Bucket Versioning
  • SPEC-29 in specs project for full details

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions