Skip to content

About

Autonomous Git auto-commit and push powered by AI when you close your laptop lid.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Latest commit

Β 

History

50 Commits

Folders and files

Repository files navigation

πŸ”’ LidCommit

Autonomous Git auto-commit and push powered by AI when you close your laptop lid.

Official Website License: MIT Featured as TrendingNOW on BrandifyDomains

🌐 Official Website & Interactive Guide: https://lid-commit-web.netlify.app/

Never lose unsaved progress again. LidCommit runs quietly on your system, automatically detects your actively open IDE workspaces, drafts intelligent commit messages from your git diffs using Gemini/OpenAI/Ollama, commits your changes, and pushes them to your remote repository.

When you open another device, simply run git pull and continue right where you left off.


⚑ Crucial Setup: Windows Lid Close Power Setting

Important

To allow LidCommit to safely inspect your repositories, stage changes, generate AI messages, and push to GitHub while the lid is down, Windows must not abruptly put the network card and CPU to sleep before the git operations complete.

How to configure "Do Nothing" on Lid Close:

  1. Press Win + R, type control, and hit Enter to open the classic Control Panel.
  2. Set View by (top right) to Large icons or Small icons, then click Power Options.
  3. In the left sidebar, click "Choose what closing the lid does".
  4. Locate the row "When I close the lid":
    • Set On battery to Do nothing.
    • Set Plugged in to Do nothing.
  5. Click Save changes.

Your screen will now turn off safely when closing the lid, but your background processes, Wi-Fi network connection, and LidCommit Git sync will execute seamlessly without being abruptly cut off!


✨ Features

  • πŸ–₯️ Native Desktop Dashboard & System Tray β€” Modern dark-mode GUI to manage projects, monitor live daemon status, and review commit logs.
  • ⏸️ Per-Project Pause / Resume Controls β€” Choose which specific repositories should auto-commit on lid close and which ones to skip.
  • ⚑ Instant "Sync Now" & "Commit This" β€” Trigger manual commits across all or individual repositories anytime without needing to close your lid.
  • 🎯 Active Window Filter β€” Only tracks projects currently open in an active IDE window; closed historical folders are automatically ignored.
  • πŸ”’ Native Lid Close Detection β€” Real-time OS power broadcast monitoring with zero CPU polling.
  • πŸ€– AI & Fallback Commit Messages β€” Context-aware commit messages generated from your diffs via Gemini/OpenAI/Ollama, with seamless automatic fallback to [LidCommit] auto-save at <timestamp> when no API key is provided or offline.
  • πŸ” IDE-Aware β€” Detects VS Code, Antigravity IDE, Cursor, Windsurf, JetBrains, and any running process with a git root.
  • πŸš€ Auto Push β€” Automatically pushes to your branch with safety checks.
  • πŸ›‘οΈ Safety Guards β€” Automatically skips if there are merge conflicts, untracked bulk files (>50), missing remotes, or if the repo is paused.
  • πŸ”” OS Notifications & Popups β€” Foreground status summary modal upon wake-up so you always know what was synced.
  • βš™οΈ TOML Config & In-App Preferences β€” Edit preferences directly in the desktop interface or via config.toml.
  • 🌍 Cross-Platform β€” Windows, macOS, and Linux.

πŸ–₯️ Desktop Dashboard Controls

When you launch lid-commit.exe, it docks in your system tray and displays the native dashboard:

Feature Description
πŸ“ Detected Projects Real-time list of all git repositories open in your active IDE windows with diff indicators (Clean vs Uncommitted Changes).
⏸️ Pause Auto-Commit Toggle button on each repository card to selectively exempt projects from lid-close commits.
⚑ Commit This Manually commits and pushes a single project on demand.
⚑ Sync Now Forces an immediate safe commit & push across all unpaused projects.
⏸️ Pause / ▢️ Resume Daemon Global pause toggle to temporarily suspend all background lid monitoring.
πŸ“œ Activity & History Live feed of recent automated commits with timestamp and file count.
βš™οΈ Configuration Configure AI providers (Gemini / OpenAI / Ollama), push settings, and safety thresholds.

πŸ“¦ Easy Download & Installation

LidCommit installs just like any standard modern application β€” zero technical setup, compiling, or Rust installations required for end users!

πŸͺŸ Windows (Recommended: 1-Click Setup Installer)

  1. Download the latest LidCommit-Setup-x86_64.exe installer from GitHub Releases.
  2. Double-click the .exe and follow the setup wizard:
    • Installs cleanly into your Windows Apps directory (%LocalAppData%\Programs\LidCommit).
    • Automatically registers LidCommit in your Windows Start Menu and creates an optional Desktop Shortcut.
    • Optional: Check "Automatically launch LidCommit on Windows startup" so your work is always protected.
    • Clean, standard uninstaller registered in Windows Installed apps / Add or remove programs.
  3. Launch LidCommit from your Start menu or system tray!

Alternatively, portable standalone zip packages (lid-commit-windows-x86_64.zip) are also available under GitHub Releases.


🍎 macOS (Pre-Built Binary)

  1. Download lid-commit-macos-aarch64.tar.gz (Apple Silicon M1/M2/M3) or lid-commit-macos-x86_64.tar.gz (Intel) from Releases.
  2. Extract and move lid-commit into /usr/local/bin or your Applications folder:
    tar -xvf lid-commit-macos-*.tar.gz
    sudo mv lid-commit /usr/local/bin/
  3. Run lid-commit from terminal, or add it to macOS Login Items for automatic background protection.

🐧 Linux (Pre-Built Binary)

  1. Download lid-commit-linux-x86_64.tar.gz from Releases.
  2. Extract and install:
    tar -xvf lid-commit-linux-x86_64.tar.gz
    sudo mv lid-commit /usr/local/bin/
  3. (Optional) Run as a systemd user service to keep it running smoothly in the background.

πŸ› οΈ Build from Source (For Developers & Contributors)

If you are developing or contributing to LidCommit:

# Ensure Rust toolchain (v1.75+) is installed
git clone https://github.com/Gingaaa/lid-commit.git
cd lid-commit
cargo build --release

# Run GUI dashboard:
./target/release/lid-commit

# To build the Windows Inno Setup installer:
iscc installer.iss

3. Configure Your AI Key

Set your environment variable or configure it via the dashboard settings tab:

Windows (PowerShell):

[System.Environment]::SetEnvironmentVariable("GEMINI_API_KEY", "your_gemini_key_here", "User")

macOS / Linux:

export GEMINI_API_KEY="your_gemini_key_here"

πŸ€– AI Providers & Fallback Commit Messages

Provider Model Examples Setup In-App UI Configuration
Google Gemini (default) gemini-2.0-flash, gemini-1.5-pro Free key from Google AI Studio Enter API key directly in Dashboard UI or use GEMINI_API_KEY
Ollama (offline) llama3.2, codellama, mistral Runs 100% offline via local Ollama instance Configure custom local URL (default: http://localhost:11434) & model
OpenAI gpt-4o-mini, gpt-4o Set OPENAI_API_KEY Enter API key directly in Dashboard UI or use OPENAI_API_KEY
Clean Auto-Save Timestamps (offline) Zero configuration / no API keys required 1-click toggle in Dashboard UI

You can switch between any of the 4 providers directly in the Desktop Dashboard Settings tab with one click. When one provider is selected, the others are deactivated, and the relevant configuration fields (API key input, endpoint URL, or model tag) adapt dynamically.

πŸ“ Fallback Commit Message (No API Key Required)

If you don't have a Google Gemini API key or any other AI API key configured, or if your machine is offline when the laptop lid closes, LidCommit still works seamlessly without any errors.

In such cases, it automatically switches to a clean, standardized timestamp-based commit message:

[LidCommit] auto-save at YYYY-MM-DD HH:MM

(Example: [LidCommit] auto-save at 2026-10-31 11:25)

  • You can customize the commit prefix (default: [LidCommit]) anytime via config.toml or the dashboard settings.
  • When an API key is provided later, LidCommit will automatically resume generating descriptive, AI-powered summaries of your diffs.

πŸ›‘οΈ Safety Guards

LidCommit skips auto-committing a project if:

  • ⏸️ Project is paused by the user in the dashboard.
  • 🧹 Working tree is clean (no modified or untracked files).
  • πŸ“¦ More than 50 files changed (guards against unignored node_modules, target/, or build artifacts).
  • 🌐 No remote repository configured (prevents dangling commits).
  • πŸ’₯ Merge conflicts exist in the working tree.
  • 🚫 Path matches user-defined excluded_paths in config.toml.

πŸ—οΈ Architecture

src/
β”œβ”€β”€ main.rs          β€” Daemon entry point, event loop, manual sync dispatch
β”œβ”€β”€ gui.rs           β€” Native desktop window, system tray, and IPC controller
β”œβ”€β”€ dashboard.html   β€” Modern dark-mode dashboard UI
β”œβ”€β”€ config.rs        β€” Configuration parser & serializer
β”œβ”€β”€ lid_monitor/     β€” Native OS lid-switch & sleep event listeners
β”‚     Windows: WM_POWERBROADCAST + GUID_LIDSWITCH_STATE_CHANGE
β”‚     macOS:   IOKit kIOMessageSystemWillSleep
β”‚     Linux:   logind D-Bus PrepareForSleep
β”œβ”€β”€ ide_scanner/     β€” Active IDE window & process scanner
β”œβ”€β”€ git/             β€” Safe git diff analysis, add, commit, and push
β”œβ”€β”€ ai/              β€” AI commit message generator (Gemini / OpenAI / Ollama)
└── notifier.rs      β€” Toast notifications and resume modal dialogs

🀝 Contributing

Contributions are welcome and appreciated! Like Next.js, shadcn/ui, and standard open source ecosystems, we follow clear guidelines to keep contributions smooth and organized:

  1. Read our Contributing Guide (CONTRIBUTING.md) for development setup, conventional commit rules, and PR submission steps.
  2. Read our Code of Conduct (CODE_OF_CONDUCT.md) to ensure an inclusive community.
  3. Review our Security Policy (SECURITY.md) to report vulnerabilities responsibly.

By submitting a Pull Request, you agree that your contribution is your original work and is granted under the project's MIT License while Anshu Kumar retains project ownership and maintainer rights.


πŸ“„ License & Copyright

Released under the MIT License.

Copyright (c) 2026 Anshu Kumar. All rights reserved.

About

Autonomous Git auto-commit and push powered by AI when you close your laptop lid.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages