gcp-snap-crab 0.3.0

A minimalist, powerful, terminal-based GCP backup and restore tool written in Rust
Documentation

Version https://spdx.org/licenses/CC-BY-NC-SA-4.0.json Platform Rust Version https://crates.io/crates/gcp-snap-crab GitHub Repo Stars

🦀 GCP Snap Crab

A minimalist, terminal-based tool to create and restore Google Cloud SQL database backups — no browser required.

Table of Contents

✨ Features

  • Create Cloud SQL backups — select a project, instance, and backup name through a guided TUI flow.
  • Restore Cloud SQL backups — restore a backup from any project/instance to any target project/instance (cross-project restore supported).
  • Search & filter — press / in any instance or backup list to filter by name; results update live as you type.
  • Scrollable lists — instance and backup lists scroll with a visible scrollbar; handles large GCP environments gracefully.
  • Progress indicator — animated spinner and elapsed time shown while a restore or backup operation is running.
  • Copy to clipboard — press y to copy the current backup ID or operation ID to the system clipboard.
  • Input validation — project IDs, instance names, and backup names are validated against GCP naming rules before submission.
  • Manual input — press m to type a project ID, instance name, or backup name directly; useful for projects not listed in your active account.
  • Dry-run mode — run with --dry-run to simulate the full flow without making any changes to your GCP resources.
  • Token caching — GCP access token is cached with a TTL to avoid repeated gcloud calls.

Prerequisites

  • Google Cloud SDK (gcloud) installed and authenticated (gcloud auth login / gcloud auth application-default login).
  • A GCP project with Cloud SQL Admin API enabled.
  • IAM permissions: roles/cloudsql.admin (or equivalent) on both source and target projects.

📸 Screenshots

⌨️ Keyboard Shortcuts

Key Action
/ Navigate list
Enter Select item / confirm
Esc Go back one step
/ Enter search/filter mode (instance & backup lists)
m Manual input (project ID, instance name, backup name)
y Copy highlighted backup ID or active operation ID to clipboard
r Refresh current list or poll operation status
n Start a new operation
h Toggle help screen
q Quit

In search mode:

Key Action
Type Filter the list live
Enter or / Exit search, keep filter
Esc Exit search, clear filter

📦 Installation

Using Cargo

cargo install gcp-snap-crab

Using Homebrew (macOS)

Coming soon.

From source

git clone https://github.com/ruteckimikolaj/gcp-snap-crab
cd gcp-snap-crab
cargo build --release
./target/release/gcp-snap-crab

Flags

gcp-snap-crab [OPTIONS]

Options:
      --dry-run    Simulate operations without making any GCP API changes
  -h, --help       Print help
  -V, --version    Print version

🚀 Special thanks

❤️ Contributing

Contributions are welcome — bug reports, feature ideas, and pull requests alike.

  1. Fork the repository.
  2. Create a branch: git checkout -b feature/your-feature.
  3. Make your changes and add tests where relevant.
  4. Open a Pull Request describing what changed and why.