Skip to main content

Automatic GitHub commit bot that logs developer activity.

Project description

๐Ÿš€ AutoCommitBot (v1.4.0)

Python Version License GitHub activity

Maintain a professional GitHub presence with AI-powered automation and built-in security.

AutoCommitBot is an intelligent CLI tool for developers who want a consistent contribution history without the manual overhead. It monitors your local repositories, generates meaningful commit messages using Google's Gemini AI, and manages the full Git lifecycle automatically โ€” all authenticated through the GitHub CLI so no tokens or passwords ever need to be configured by hand.


๐Ÿ–ฅ๏ธ Preview

AutoCommitBot CLI


๐ŸŒŸ Why AutoCommitBot?

  • Zero-friction auth โ€” Piggybacks on your existing gh login; no tokens, no PATs, no manual username entry
  • AI Commit Messages โ€” Generates meaningful, context-aware commits instead of generic updates
  • Security (Secret Shield) โ€” Prevents accidental exposure of sensitive files and credentials
  • Natural Activity Mode โ€” Simulates realistic developer commit patterns
  • Manual vs. Background Control โ€” [NEW] Choose between interactive manual runs and strictly automated background heartbeats
  • Backup & Restore โ€” Enables complete rollback of local and remote states
  • Automated Execution โ€” Runs seamlessly in the background on system logon

โœจ Features

Core Capabilities

  • GitHub CLI Auth โ€” Identity verified through your active gh session; repos fetched & cloned via gh automatically
  • AI Commit Generation โ€” Context-aware commit messages using Gemini with model fallback
  • Security Layer (Secret Shield) โ€” Automatic protection against sensitive file and credential exposure
  • Interactive Manual Mode โ€” [NEW] Choose whether to commit real work or perform a Heartbeat commit manually
  • Strict Background Heartbeats โ€” [NEW] Background tasks now strictly perform "Random Activity" commits to maintain streaks without cluttering code history
  • Scheduling Engine โ€” Supports logon, fixed-time, and natural activity-based execution
  • Backup & Restore โ€” Pre-commit snapshots with full local and remote rollback capability
  • Dashboard & Analytics โ€” CLI-based insights into commit history and activity
  • Execution Reliability โ€” Built-in retry logic, conflict handling, and network checks
  • Decent CLI Theme โ€” Clean, professional, and subtle color-coded output for repository tracking
  • Secret Shield โ€” Now includes refined visual markers for protected and exposed files
๐Ÿ” View Full Feature Breakdown

โš™๏ธ Setup & Configuration

  • Identity verified via GitHub CLI (gh auth login) โ€” no username prompt, no tokens
  • Repository list fetched with gh repo list (authenticated)
  • Interactive multi-select repo setup
  • Base folder configuration
  • Automatic cloning via gh repo clone (inherits your gh session)
  • Git authentication verification
  • Backward navigation during setup

๐Ÿ• Scheduling System

  • Logon trigger (Windows Task Scheduler) โ€” Strictly performs Random Activity (Heartbeat) commits in the background
  • Fixed-time daily scheduling
  • Randomized daily execution (9 AM โ€“ 11 PM)
  • Natural Activity Mode (probabilistic commits with 48h enforcement)
  • Runs with highest privileges
  • Works on battery power

๐Ÿ” Commit Engine

  • Smart change detection across repositories
  • Manual Run: Interactive menu to choose between User Changes vs. Heartbeat
  • Background Run: Strictly Heartbeat (Random Activity) mode
  • Automatic pull โ†’ merge โ†’ push workflow
  • Push retry logic on failure

๐Ÿค– AI Commit System

  • Gemini AI integration for commit messages
  • AI Key Validation โ€” Real-time verification of your API key during setup
  • Model fallback chain: 2.5 Flash โ†’ 2.0 Flash โ†’ 1.5 Flash โ†’ Pro
  • Diff truncation for large inputs (8000 chars)

๐Ÿ’พ Backup & Restore

  • ZIP snapshot before every commit
  • Configurable backup retention (config-backup)
  • Restore command with snapshot selection
  • Automatic GitHub rollback via force push
  • Clear all backups on demand (clear-backups)

๐Ÿ“Š Dashboard & Management

  • Dashboard with last 50 commits (rich table view)
  • Commit classification (User vs Activity)
  • Status command for tracked repos
  • Add/remove repositories dynamically
  • Persistent history tracking (500 entries)
  • Clean uninstall command โ€” removes scheduler task before uninstalling
  • Version check command โ€” shows installed version and detects available updates

๐ŸŒ Reliability Layer

  • Internet availability check (retry up to 2 minutes)
  • Automatic admin privilege escalation
  • Resilient Git operations with fallback handling

โš™๏ธ How It Works

  1. Verifies your GitHub identity via the GitHub CLI (gh)
  2. Detects changes in tracked repositories
  3. Syncs with remote using git pull
  4. Analyzes git diff using Gemini AI (in Manual mode)
  5. Generates a contextual commit message
  6. Runs security checks (Secret Shield)
  7. Commits and pushes changes
  8. Stores a backup snapshot

All of this runs automatically in the background.


๐Ÿš€ Getting Started

Prerequisites

Before installing AutoCommitBot, make sure you have all of the following:

Requirement Why it's needed Get it
Python 3.8+ Runtime python.org
Git Version control git-scm.com
GitHub CLI (gh) Identity verification & repo access cli.github.com
Gemini API key (optional but recommended) AI-generated commit messages aistudio.google.com

Important: AutoCommitBot v1.2.7+ requires the GitHub CLI. It uses your existing gh login to verify who you are and to fetch and clone your repositories โ€” no passwords or personal-access tokens needed.


Step 0 โ€” Install & authenticate the GitHub CLI

If you haven't already:

# macOS (Homebrew)
brew install gh

# Windows (winget)
winget install --id GitHub.cli

# Debian / Ubuntu
sudo apt install gh

Then sign in:

gh auth login

Follow the interactive prompts (choose HTTPS, then authenticate via browser). Confirm it worked:

gh auth status
# โ†’ โœ“ Logged in to github.com as YourUsername

๐Ÿ“ฆ Installation

Option 1: Via pip (Recommended)

pip install autocommitbot

Option 2: From Source

git clone https://github.com/RohitKSahoo/auto-commit-bot.git
cd auto-commit-bot
pip install -e .

๐Ÿ› ๏ธ First-Time Setup

Run the setup wizard once after installation:

autocommit setup

The wizard will:

  1. Verify your GitHub identity via gh auth status โ€” no username prompt
  2. Fetch your repositories from GitHub using gh repo list
  3. Let you select which repos to automate (multi-select checklist)
  4. Ask for a base folder where repos should be cloned if not already present
  5. Ask you to pick a schedule (on logon / fixed time / natural activity)
  6. Optionally let you enter a Gemini API key for AI commit messages

Tip: Running autocommit setup again on an already-configured machine shows a short menu so you can update just one section (Repositories, Schedule, or AI key) without repeating the full wizard. On a fresh install the full wizard always runs โ€” no menu.


๐Ÿ› ๏ธ Usage

All commands follow the pattern: autocommit <command>

Run autocommit <command> --help for full details on any command.

โš™๏ธ Setup & Config

Command What it does
autocommit setup First-time wizard, or edit repos / schedule / AI
autocommit config-backup <days> Set how long backups are kept

๐Ÿ“ Repositories

Command What it does
autocommit add [path] Track a new local git repo
autocommit remove Stop tracking a repo
autocommit status List all tracked repos

๐Ÿ” Automation

Command What it does
autocommit run [Interactive] Commit changes or heartbeat now
autocommit enable Register the Windows auto-start task
autocommit disable Remove the Windows auto-start task

๐Ÿ“Š History & System

Command What it does
autocommit dashboard View commit history & stats
autocommit restore Roll back a bot commit from snapshot
autocommit clear-backups Delete all backup snapshots to free disk space
autocommit version Check installed version & updates
autocommit uninstall Remove scheduler task then pip uninstall

โš ๏ธ Notes

  • GitHub CLI required โ€” autocommit setup will exit with a clear error if gh is not installed or you're not logged in
  • Automation runs only on tracked repositories
  • restore performs a force push โ€” rewrites remote history, use with caution
  • run is for manual triggering, not regular use
  • Internet connection required for push, version check, and AI commit messages
  • On Logon mode caps random activity at 5 per calendar day โ€” real code changes always push through, even after the cap is reached
  • Always use autocommit uninstall instead of pip uninstall directly โ€” running pip uninstall alone will leave an orphaned task in Windows Task Scheduler that silently fails on every trigger

๐Ÿ”„ Staying Up to Date

Run the following command to check your current version and see if a newer release is available:

autocommit version

Example output when up to date:

AutoCommitBot  v1.3.0
Checking for updates...
โœ” You are on the latest version (1.3.0).

๐ŸŽ‰ New in this version (v1.3.0):
  โ€ข Fixed background hangs in Task Scheduler by redirecting output to logs
  โ€ข Added global timeouts to all Git operations to prevent indefinite stalls
  โ€ข Fixed encoding crashes on Windows (UTF-8 support for log files)
  โ€ข Optimized Secret Shield performance for faster repository scanning
  โ€ข Shortened scheduler commands to fit within Windows path limits

Example output when an update is available:

AutoCommitBot  v1.2.7
Checking for updates...
โšก New version available: 1.2.8 (you have 1.2.7)

๐Ÿ“‹ What's New in v1.2.9:
  โ€ข Refined, easier-on-the-eyes color theme for better commit and security tracking
  โ€ข Setup wizard now pre-selects existing repos and suggests your base folder
  โ€ข Fixed a bug in the setup flow that prevented repository updates from saving

Run to update:  pip install --upgrade autocommitbot

To update manually at any time:

pip install --upgrade autocommitbot

๐Ÿ” Security Notes

  • Your code is not stored externally (only analyzed for commit messages)
  • Sensitive files are automatically excluded via .gitignore
  • Identity is verified through your local gh session โ€” no credentials are stored by AutoCommitBot
  • restore uses force push โ€” use with caution

๐Ÿ†˜ Support & Contributions


๐Ÿ‘ค Maintainer

Maintained by @RohitKSahoo


๐Ÿ“„ License

This project is licensed under the GNU General Public License v3.0.

You are free to use, modify, and distribute this software under the terms of the license. Any derivative work must also be open-sourced under GPL v3.

See the LICENSE file for full details.


๐Ÿงพ TL;DR

AutoCommitBot is a smart Git automation layer with AI, security, and recovery built in โ€” authenticated entirely through your existing GitHub CLI session.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autocommitbot-1.4.1.tar.gz (38.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

autocommitbot-1.4.1-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file autocommitbot-1.4.1.tar.gz.

File metadata

  • Download URL: autocommitbot-1.4.1.tar.gz
  • Upload date:
  • Size: 38.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for autocommitbot-1.4.1.tar.gz
Algorithm Hash digest
SHA256 9ce972a2891bbfdd5b8ee2dd5ad128fcc2142b0bba8669d839659ff07aabec8a
MD5 b8207c2790d39c993a8d1b8e7878495d
BLAKE2b-256 5cde4a06d8eb26a32ba8afb0907511676a0c6f9a3cb540fa89b6d946010d423f

See more details on using hashes here.

File details

Details for the file autocommitbot-1.4.1-py3-none-any.whl.

File metadata

  • Download URL: autocommitbot-1.4.1-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for autocommitbot-1.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b94c31afba8234af1f22f0a263c4289cbc73836b14286b21f0090871be2ee513
MD5 c1b5fec5aa68cf291e20dd264ed4eb20
BLAKE2b-256 09729c5edd54d7bd698fb20c6699d97f3466291681ecc15f09dd5ba86e7e3bfb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page