Autonomous Git auto-commit and push powered by AI when you close your laptop lid.
π 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.
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.
- Press
Win + R, typecontrol, and hit Enter to open the classic Control Panel. - Set View by (top right) to Large icons or Small icons, then click Power Options.
- In the left sidebar, click "Choose what closing the lid does".
- Locate the row "When I close the lid":
- Set On battery to Do nothing.
- Set Plugged in to Do nothing.
- 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!
- π₯οΈ 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.
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 / |
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. |
LidCommit installs just like any standard modern application β zero technical setup, compiling, or Rust installations required for end users!
- Download the latest
LidCommit-Setup-x86_64.exeinstaller from GitHub Releases. - Double-click the
.exeand 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.
- Installs cleanly into your Windows Apps directory (
- 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.
- Download
lid-commit-macos-aarch64.tar.gz(Apple Silicon M1/M2/M3) orlid-commit-macos-x86_64.tar.gz(Intel) from Releases. - Extract and move
lid-commitinto/usr/local/binor yourApplicationsfolder:tar -xvf lid-commit-macos-*.tar.gz sudo mv lid-commit /usr/local/bin/ - Run
lid-commitfrom terminal, or add it to macOS Login Items for automatic background protection.
- Download
lid-commit-linux-x86_64.tar.gzfrom Releases. - Extract and install:
tar -xvf lid-commit-linux-x86_64.tar.gz sudo mv lid-commit /usr/local/bin/
- (Optional) Run as a
systemduser service to keep it running smoothly in the background.
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.issSet 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"| 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.
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 viaconfig.tomlor the dashboard settings. - When an API key is provided later, LidCommit will automatically resume generating descriptive, AI-powered summaries of your diffs.
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_pathsinconfig.toml.
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
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:
- Read our Contributing Guide (CONTRIBUTING.md) for development setup, conventional commit rules, and PR submission steps.
- Read our Code of Conduct (CODE_OF_CONDUCT.md) to ensure an inclusive community.
- 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.
Released under the MIT License.
Copyright (c) 2026 Anshu Kumar. All rights reserved.