Product Introduction
- Definition: LidCommit is an autonomous, open-source desktop application (a Rust daemon with a native GUI) that automates the Git commit and push workflow. It functions as an intelligent system service that triggers upon a hardware event—the closing of a laptop lid.
- Core Value Proposition: LidCommit exists to eliminate the risk of losing uncommitted code progress when a developer physically leaves their workstation. Its core value is providing zero-click, context-aware version control backup by leveraging native OS lid-close detection, active IDE workspace scanning, and AI-powered commit message generation to safely sync changes to GitHub.
Main Features
- Native OS Lid-Close Detection: The daemon uses low-level, platform-specific APIs to listen for hardware events without polling, ensuring minimal battery drain. On Windows, it hooks into
WM_POWERBROADCASTmessages withGUID_LIDSWITCH_STATE_CHANGE. On macOS, it uses IOKit sleep notifications, and on Linux, it monitors thelogindD-Bus forPrepareForSleepsignals. This allows the system to perform work while the lid is closed, provided the OS power policy is set to "Do nothing." - Intelligent IDE & Git Workspace Discovery: Instead of scanning the entire filesystem, LidCommit actively detects running processes for major IDEs (VS Code, JetBrains suite, Cursor) and terminal sessions to identify only relevant, "dirty" Git repositories with uncommitted changes. This targeted approach increases efficiency and relevance.
- Multi-Provider AI Commit Synthesis: The tool extracts a unified diff (staged and unstaged changes) and sends it to a configurable AI provider to generate a semantic, conventional-style commit message. It supports Google's Gemini API (default, using
gemini-2.0-flash), local Ollama models (likellama3.2for complete privacy), the OpenAI API, and a fallback timestamp-based auto-save mode, all hot-reloadable via a TOML configuration file. - Safety-First Git Automation Engine: Before any action, it runs a series of guards: it checks for a clean working tree, aborts if a merge conflict is detected, verifies the presence of a remote origin, and enforces a configurable maximum file change threshold (default 50) to prevent accidental commits of build artifacts or dependencies.
- Native Desktop GUI & System Tray Integration: Version 0.2.0 introduced a dark-mode desktop application built with a native webview. It provides a real-time dashboard showing active repositories, a per-project pause toggle, manual "Sync Now" triggers, activity history logs, and centralized configuration for AI providers and safety settings.
Problems Solved
- Pain Point: The "Oh no" moment of realizing unsaved or uncommitted work was lost because a laptop was closed, put to sleep, or the battery died. This disrupts workflow and causes data loss.
- Target Audience: The primary audience is software developers and engineers who work across multiple machines (e.g., office desktop and personal laptop) or who are prone to context switching and may forget to commit. It's especially valuable for solo developers, freelancers, and small teams without enforced CI/CD check-in policies.
- Use Cases:
- End-of-Day/Meeting Rush: Automatically securing all code changes when hastily closing the laptop to leave the office or join a meeting.
- Cross-Device Development: Ensuring the latest work on a office laptop is committed and pushed, ready to be pulled on a home desktop without manual intervention.
- Experimentation & Spike Solutions: Providing automatic checkpointing for experimental code branches, allowing for risk-free exploration.
Unique Advantages
Strengths & Limitations (Pros & Cons):
- Pros:
- Truly Hands-Free: The trigger is a physical action (closing the lid), requiring no developer discipline or remembered keyboard shortcuts.
- Context-Aware: Scans only active IDE projects, avoiding noise from unrelated Git repos.
- Privacy-Centric Option: Full offline operation with local Ollama LLMs ensures code diffs never leave the machine.
- Robust Safety Guards: Built-in checks for merge conflicts, remote presence, and file count thresholds prevent common git automation pitfalls.
- Native & Lightweight: Built in Rust, it has a minimal footprint and integrates cleanly with the OS via system tray and notifications.
- Cons:
- OS Configuration Required: Users must manually change their OS power settings (e.g., "Do nothing" when lid closes) for the tool to function, which can be a barrier and affects default battery behavior.
- Cloud AI Cost/Key Management: While Ollama is free, using Gemini or OpenAI requires API keys and incurs potential costs, adding setup complexity.
- Limited to Git/GitHub: Currently designed around Git and pushing to a remote (implicitly GitHub/GitLab), not for other VCS or pure local backup scenarios.
- New Project Risk: As a relatively new open-source tool, it may have undiscovered edge cases compared to established, manual git workflows.
- Pros:
Key Alternatives & Differentiation:
- Manual
git commit && git push: The standard alternative. LidCommit differentiates by being fully autonomous, triggered by a hardware event, and enhanced with AI commit messaging, eliminating human forgetfulness and message writer's block. - IDE Auto-Save/Time-based Commit Plugins: Many IDEs have auto-save, and plugins exist for timed commits. LidCommit is IDE-agnostic, works across all open projects simultaneously, and uses a more intentional, context-rich trigger (lid close vs. a timer) linked to a user's physical departure.
- Git Hooks (pre-commit, post-merge): Git hooks are powerful but are repository-specific and trigger on git actions, not external events. LidCommit operates at the system level, independent of repository configuration, and is triggered by a non-git event (lid closure).
- Manual
Frequently Asked Questions (FAQ)
- Is LidCommit safe for my Git history? Yes, LidCommit is engineered with multiple safeguards. It will not commit if there are no changes, if a merge conflict is in progress, if no remote is configured, or if the diff exceeds a configurable file count (default 50). It also allows per-repository pausing via the GUI.
- Does LidCommit work when I'm offline or without an AI API key?
Yes. LidCommit has a zero-config fallback mode. If offline or if no AI provider is configured, it will generate a simple, timestamped commit message like
[LidCommit] auto-save at 2024-01-01, ensuring your changes are still saved locally and ready to push later. - How does LidCommit handle privacy with my code diffs?
You have full control. For maximum privacy, use the integrated Ollama provider with a local model (e.g.,
llama3.2). This processes your diffs entirely on your machine with no data sent to the cloud. Cloud providers like Gemini only receive the diff necessary to generate the commit message. - Can I use LidCommit on a desktop computer without a lid? The core trigger is the OS-level lid-close event. On a desktop, this event does not exist. However, the desktop GUI provides a "Sync Now" button to manually trigger the commit/push pipeline on demand, which can be used as a one-click backup utility.
- What happens if I close my lid while LidCommit is still processing? LidCommit is designed to complete its workflow after the lid-close signal is received. This requires the OS to be configured to "Do nothing" or "Sleep" after a delay, allowing the process to finish. The tool stages changes, generates the commit, and pushes it before the system potentially suspends.
