Anti-Eneo is a tool to automatically save your work on a git repository by committing and pushing changes periodically or when files change. It keeps your work safe by maintaining a rolling backup of your recent changes.
- Automatic Backup: Periodically commits and pushes your changes to keep work safe
- Rolling Window: Maintains only the 2 most recent commits to avoid cluttering history
- Watch Mode: Monitors file changes and commits automatically with debouncing
- Save-to-Branch: Squash merge all changes to any target branch with a single command
- Graceful Shutdown: Commits pending changes when stopped (Ctrl+C)
- Branch Isolation: Works on a dedicated
anti-eneobranch to avoid interfering with your main workflow
When you run anti-eneo:
At startup:
- Checks if you're on the
anti-eneobranch, creates and switches to it if needed - Sets up remote tracking
Every 3 minutes (configurable):
- Commits all changes with timestamp:
git add . && git commit -m "periodic changes YYYY-MM-DD HH:MM:SS" - Pushes to the remote
anti-eneobranch - Rolling window: Keeps only 2 most recent commits by removing older ones
When you run anti-eneo --watch:
At startup:
- Same branch setup as periodic mode
On file changes:
- Detects when git-tracked files are modified, added, or deleted
- Waits for debounce period (60 seconds by default) to batch multiple rapid changes
- Commits and pushes the batched changes
- Also maintains the 2-commit rolling window
Use anti-eneo --save-to=BRANCH to merge all your work to any branch:
- Validates you're on the
anti-eneobranch - Switches to the target branch and pulls latest changes
- Squash merges all changes from
anti-eneointo a single commit - Prompts for a meaningful commit message
- Pushes to remote and returns to
anti-eneobranch
This is perfect for moving your work to main, develop, or feature branches when ready.
Run the following command in your terminal:
curl -fsSL https://raw.githubusercontent.com/jefcolbi/anti-eneo/main/install.sh | bashOr if you prefer wget:
wget -qO- https://raw.githubusercontent.com/jefcolbi/anti-eneo/main/install.sh | bashThe installer will:
- Clone the repository to
~/.local/bin/anti-eneo - Create symlink for the
anti-eneocommand - Automatically update your shell configuration to include
~/.local/binin PATH - Work without requiring root privileges
To update to the latest version, simply run the installer again.
If you have Git Bash or WSL (Windows Subsystem for Linux) installed, follow the Linux installation instructions above.
-
Clone the repository:
git clone https://github.com/jefcolbi/anti-eneo %USERPROFILE%\.local\bin\anti-eneo -
Add the directory to your PATH:
- Press Win + X and select "System"
- Click "Advanced system settings"
- Click "Environment Variables"
- Under "User variables", select "Path" and click "Edit"
- Click "New" and add:
%USERPROFILE%\.local\bin\anti-eneo - Click "OK" to save
-
Restart your terminal
-
Clone the repository:
git clone https://github.com/jefcolbi/anti-eneo ~/.local/bin/anti-eneo -
Make script executable (Linux/macOS):
chmod +x ~/.local/bin/anti-eneo/anti-eneo -
Add to PATH by adding this line to your shell configuration:
export PATH="$HOME/.local/bin/anti-eneo:$PATH"
# Start periodic backup (every 3 minutes)
anti-eneo
# Start file watching mode with automatic commits
anti-eneo --watch
# Save all changes to main branch
anti-eneo --save-to=main
# Save all changes to develop branch
anti-eneo --save-to=develop
# Show help
anti-eneo --help| Option | Description | Default |
|---|---|---|
--interval=SECONDS |
Commit interval for periodic mode | 180 (3 minutes) |
--watch |
Enable watch mode for file change detection | Off |
--debounce=SECONDS |
Debounce time for watch mode | 60 seconds |
--save-to=BRANCH |
Save all changes to target branch and exit | - |
--branch=NAME |
Custom branch name for auto-saves | anti-eneo |
--remote=NAME |
Remote name to push to | origin |
--quiet, -q |
Suppress informational output | Off |
--help, -h |
Show usage information | - |
# Quick start - periodic backup every 3 minutes
anti-eneo
# Watch mode with custom debounce
anti-eneo --watch --debounce=30
# Periodic mode with custom interval (every 5 minutes)
anti-eneo --interval=300
# Save work to main branch when ready
anti-eneo --save-to=main
# (prompts for commit message)
# Custom branch and remote
anti-eneo --branch=my-backup --remote=upstream
# Quiet mode
anti-eneo --quiet-
Start anti-eneo in your project directory:
anti-eneo --watch # or just 'anti-eneo' for periodic mode -
Work normally - your changes are automatically backed up to the
anti-eneobranch -
When ready to commit to main:
anti-eneo --save-to=main # Enter a meaningful commit message when prompted -
Continue working - anti-eneo keeps running and backing up new changes
-
Stop safely with Ctrl+C - any pending changes are committed before exit
Anti-Eneo includes a comprehensive test suite to ensure reliability:
# Run all tests
./tests/run-all-tests.sh
# Run specific test suites
./tests/test-basic.sh # Basic functionality
./tests/test-save-to.sh # Save-to-branch feature
./tests/test-graceful-shutdown.sh # Graceful shutdown
./tests/test-watch-mode.sh # Watch mode functionality
# Run single test suite
./tests/run-all-tests.sh --suite=test-basic.shThe test suite covers:
- ✅ Periodic commit functionality
- ✅ Rolling window behavior (2-commit limit)
- ✅ Branch management and creation
- ✅ Save-to-branch feature with validation
- ✅ Graceful shutdown with pending changes
- ✅ Watch mode file detection
- ✅ Error handling and edge cases
"Not a git repository"
- Make sure you're in a git repository directory
- Run
git initif you need to create a new repository
Push failed
- Check your remote repository configuration:
git remote -v - Ensure you have push permissions to the remote repository
- Verify your git credentials are set up correctly
Branch conflicts
- Anti-eneo works on the
anti-eneobranch to avoid conflicts - Use
--save-to=mainto merge changes to your main branch when ready
Permission denied
- Make sure the anti-eneo script is executable:
chmod +x anti-eneo - Check that
~/.local/binis in your PATH
For troubleshooting, remove the --quiet flag to see detailed logging:
anti-eneo # Shows all INFO messages
anti-eneo --quiet # Shows only ERROR messages