Skip to content

feat(cli): add backup subcommands (backup, backup list, backup restore) #542

@Aureliolo

Description

@Aureliolo

Summary

Add Go CLI backup subcommands to complement the Python API backup endpoints implemented in #449.

Motivation

Issue #449 acceptance criterion #4 requires "Manual backup via API and CLI". The API endpoints are fully implemented (PR #541), but the CLI subcommands were deferred as out of scope for that PR. This issue tracks the CLI portion.

CLI Commands

Command Description Backend Endpoint
synthorg backup Trigger manual backup POST /api/v1/admin/backup
synthorg backup list List available backups GET /api/v1/admin/backups
synthorg backup restore <id> Restore from backup POST /api/v1/admin/restore

Implementation Notes

  • Add Cobra subcommands under cli/cmd/
  • Follow existing CLI patterns (e.g., start, stop, status commands)
  • backup restore should stop running containers, call restore endpoint, restart
  • Display backup list in a formatted table (lipgloss styling)
  • Include --confirm flag for restore (safety gate)

Dependencies

Acceptance Criteria

  • synthorg backup triggers a manual backup and displays the manifest
  • synthorg backup list shows available backups in a formatted table
  • synthorg backup restore <id> restores from a backup with confirmation prompt
  • All commands handle errors gracefully with user-friendly messages
  • Tests cover happy paths and error cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:mediumShould do, but not blockingscope:smallLess than 1 day of workspec:toolsDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions