| Crates.io | gini |
| lib.rs | gini |
| version | 0.1.7 |
| created_at | 2025-06-30 10:35:43.315184+00 |
| updated_at | 2025-08-15 09:20:48.278482+00 |
| description | A lightweight CLI tool for saving and restoring project checkpoints. Think of it as mini git snapshots. |
| homepage | |
| repository | https://github.com/somendrajaat/gini_cli |
| max_upload_size | |
| id | 1731669 |
| size | 55,629 |
A simple, fast, and secure command-line checkpoint system for your projects. gini lets you create, list, and restore checkpoints with the efficiency of Git's snapshot model, making it easy to save and roll back to different states without duplicating data.
It's a lightweight but powerful tool for managing project states with confidence. 🚀
⚡ Efficient Snapshots: Instead of making full copies, gini uses a content-addressed storage model inspired by Git. It only stores unique file contents (blobs), saving significant disk space.
🌱 Initialize: Set up gini in your project with a single command.
📸 Create Checkpoints: Instantly save a snapshot of your project's state with a descriptive message.
⏪ Restore Checkpoints: Safely roll back your entire project to any previous checkpoint.
📜 View History: See a clean, chronological log of all your checkpoints.
🛡️ Automatic Backups: Before any destructive operation like a restore, gini automatically creates a backup, giving you a complete safety net.
🔒 Enhanced Security: Protects against common issues with input validation, path traversal protection, and file size limits.
You can install gini directly from crates.io using Cargo:
cargo install gini
Or, you can build from source:
git clone https://github.com/somendrajaat/gini_cli.git
cd gini_cli
cargo install --path .
Here's how to use gini:
gini in Your ProjectTo start using gini, you first need to initialize it in your project's root directory.
gini init
This command creates a .gini/checkpoints directory where all your checkpoints will be stored.
To save a snapshot of your project, create a checkpoint with a descriptive message.
gini checkpoint -m "my-first-checkpoint"
You can also use the shorter command:
gini c -m "refactoring-done"
This saves the current state of your files (excluding .gini, .git, and target) into a new checkpoint. Each checkpoint is a full, independent copy of your project at that moment.
To see a list of all the checkpoints you've saved:
gini log
Or use the shorter command:
gini l
If you need to revert your project to a previous state, use the restore command. You will be prompted to select a checkpoint interactively:
gini restore
Or use the shorter command:
gini r
This will replace your current files with the files from the selected checkpoint. Warning: This will overwrite existing files in your project directory.
If you need to restore from a backup (created automatically before each restore operation), use the backup command:
gini backup
Or use the shorter command:
gini b
This will show you all available backups with their creation timestamps and allow you to restore from any of them.
gini is built on the same principles as Git. Instead of copying your entire project for each checkpoint, it uses a content-addressed object store.
Blobs: The content of each file is hashed and stored as a "blob." If a file doesn't change, its blob is reused across multiple checkpoints.
Trees: The directory structure is stored in "tree" objects, which point to blobs (files) and other trees (subdirectories).
Commits: A "commit" (or checkpoint) is a snapshot that points to a single top-level tree, along with metadata like the author and your commit message.
This model is incredibly efficient, ensuring that you only store what has changed, which saves both time and disk space.
This project is licensed under the MIT License. See the LICENSE file for details.