Control your keyboard and voice input with hand gestures through your camera. No wearable devices needed β pure vision-based recognition, built for vibecoding workflows.
| Gesture | Action | Description |
|---|---|---|
| π OK | Enter | Confirm |
| β Open Palm | Escape | Cancel |
| βοΈ Scissor | Ctrl+Z | Undo |
| π€ Pinch | Toggle Mode | Switch Auto-Approve / Manual Confirm |
| π€ Phone Call | Voice Input | Detects foreground AI app and injects its voice shortcut |
- Python 3.10 - 3.12
- MediaPipe β 21-point hand + 468-point face real-time landmark detection
- PySide6 (Qt6) β GUI framework, frameless transparent always-on-top panel
- OpenCV β camera capture and image preprocessing
- pynput β keyboard event injection
- pywin32 / psutil β Windows foreground window detection & process identification
- PyYAML β configuration file management
The UI ships with English (default) and Simplified Chinese. Switch in Settings β Interface β Language, then restart the app.
π¨π³ δΈζηζζ‘£θ§ README.cn.md
aircoding/
βββ main.py # App entry: startup flow & signal wiring
βββ test_runner.py # Test program (real camera + log analysis)
βββ start.bat # Windows launcher (silent, pythonw)
βββ AI-SETUP.md # AI-agent environment setup guide (read by AI tools)
βββ requirements.txt # Python dependencies
βββ config/
β βββ default_config.yaml # Default config (gesture mapping, thresholds, AI app registry)
βββ resources/
β βββ aircoding.ico # App icon (multi-size)
β βββ aircoding.png # App icon PNG
βββ src/
β βββ core/ # Core modules
β β βββ enums.py # Enums (gesture types, light states, system modes)
β β βββ config_manager.py # Config manager (default + user config merge)
β β βββ gesture_config.py # Default gesture mappings
β β βββ i18n.py # Internationalization (en/zh)
β β βββ state_machine.py # State machine (light effect transitions)
β βββ camera/ # Camera modules
β β βββ camera_manager.py # Camera capture (dedicated thread, auto-reconnect)
β β βββ image_processor.py # Image preprocessing (brightness, denoise)
β βββ recognition/ # Recognition modules
β β βββ recognition_engine.py # Recognition engine (multi-threaded inference)
β β βββ hand_classifier.py # Gesture classifier (per-finger thresholds, 5 gestures)
β β βββ phone_call_detector.py # Phone-call gesture detection (thumb + pinky)
β β βββ gesture_validator.py # Gesture validator (multi-frame confirm, cooldown)
β β βββ calibrator.py # Calibrator (registration, feature extraction, adaptive)
β β βββ face_expression.py # Facial expression (eyebrow raise detection)
β βββ action/ # Action modules
β β βββ gesture_mapper.py # Gesture β keyboard mapping
β β βββ keyboard_injector.py # Keyboard injection (pynput first, SendInput fallback)
β β βββ ai_software_detector.py # AI app detection (foreground window match)
β β βββ auto_approval.py # Auto-approval controller
β βββ ui/ # UI modules
β β βββ main_window.py # Main window (frameless, tray, calibration)
β β βββ privacy_preview.py # Privacy preview (skeleton drawing, valid area)
β β βββ settings_dialog.py # Settings dialog (hotkeys, AI apps, calibration)
β β βββ onboarding.py # First-run tutorial
β β βββ light_effect_widget.py # Light effect animations
β β βββ toast.py # Toast notifications
β βββ utils/
β βββ logger.py # Logging (file + console)
β βββ audio.py # Audio feedback
βββ tests/ # Unit tests
βββ test_hand_classifier.py
βββ test_gesture_validator.py
βββ test_state_machine.py
- MediaPipe 21-point hand landmarks, gesture decided by finger extension/curl ratios
- Per-finger independent thresholds (personalized after calibration)
- Dual-threshold hysteresis (extend/curl/gray zone) reduces boundary jitter
- False-trigger blacklist (finger spacing, direction checks)
- Guided registration: each gesture captures 30 frames Γ 2 angles
- Extracts 8 features (5 finger ratios, thumb direction, thumb-index distance, index-middle angle)
- Computes per-finger thresholds, persisted to
%APPDATA%/AirCoding/calibration_profile.json - Continuous adaptation at runtime (auto-updates every 100 successful recognitions)
- Rising edge (gesture appears) β detect foreground AI app β inject voice hotkey β start recording
- Falling edge (gesture released) β inject hotkey again β stop recording
- Supported apps: WorkBuddy, Doubao, Feishu, WeChat, WeCom + custom entries
- Dedicated thread at 10fps with frame queue buffering
- Auto-releases camera when occupied by other apps, auto-recovers when freed
- Multi-person detection: pauses recognition when a second person appears
- Circular area centered on the face (radius = face width Γ 1.625)
- Hands outside the circle are ignored
- Dashed circle guide drawn in the preview
- UI window shows first (~0.6s)
- MediaPipe import and camera open run in parallel in the background (~4s total)
- QTimer polling checks background init completion
- Windows 10/11
- Python 3.10, 3.11 or 3.12 (MediaPipe does not support 3.13+ yet)
- A webcam
AirCoding is designed to be set up by AI coding assistants (Claude Code, WorkBuddy, Cursor, Windsurf, etc.). The repository ships with AI-SETUP.md β a step-by-step environment configuration guide written for AI agents.
- Download the project β
git clone https://github.com/mushi888/AirCoding.git(or download the ZIP and extract it) - Open the folder as a local task in your AI tool β point your AI assistant at the project root (the folder containing
main.py) - Tell the AI to read
AI-SETUP.mdand configure the environment β the AI will follow the guide: check Python 3.10~3.12, create the.venv_runvirtual environment, install all dependencies (~400MB), and verify the install (unit tests included) - Launch the app β double-click
start.bat(silent launcher, no console window) and allow camera access
π‘ For AI agents: AI-SETUP.md contains everything needed β prerequisites (Gate 0), installation steps, verification gates, troubleshooting, and a Definition of Done checklist. Follow it strictly in order.
For users who prefer to set up without an AI assistant:
# Clone
git clone https://github.com/mushi888/AirCoding.git
cd AirCoding
# Create virtual environment (name MUST be .venv_run)
python -m venv .venv_run
# Install dependencies
.venv_run\Scripts\pip install -r requirements.txt
# Global users: pip uses PyPI by default (no flags needed)
# China users: add -i https://pypi.tuna.tsinghua.edu.cn/simple# Method 1: launcher script (silent, no console window) β recommended
start.bat
# Method 2: run directly
.venv_run\Scripts\pythonw.exe main.py
# Method 3: dev mode (console window + live logs)
.venv_run\Scripts\python.exe main.py# Unit tests
.venv_run\Scripts\python.exe -m pytest tests/ -q
# Gesture test program (real camera)
.venv_run\Scripts\python.exe test_runner.py --frames 30
# Analyze test logs
.venv_run\Scripts\python.exe test_runner.py --analyze <log-file-path>| File | Path | Description |
|---|---|---|
| Default config | config/default_config.yaml |
Factory defaults, do not edit |
| User config | %APPDATA%/AirCoding/user_config.yaml |
User overrides |
| Calibration profile | %APPDATA%/AirCoding/calibration_profile.json |
Calibration data |
| Logs | %APPDATA%/AirCoding/logs/aircoding.log |
Runtime logs |
- Ctrl+Alt+K β show/hide panel
| Symptom | Likely Cause | Fix |
|---|---|---|
| UI shows, camera light on, but no video | mediapipe β₯ 0.10.15 (legacy API removed) | .venv_run\Scripts\pip install "mediapipe>=0.10.0,<0.10.15" --force-reinstall |
Log: No module named 'mediapipe.python' |
mediapipe too new | Same as above |
Python venv not found on launch |
venv missing or wrong name | Recreate with name .venv_run |
No module named 'src' |
wrong working directory | cd to project root first |
| Camera won't open | occupied by another app | Close the app holding the camera, restart |
| Gestures unresponsive | not calibrated / hand outside valid area | Keep hand in the dashed circle; run calibration |
MIT License
Copyright (c) 2026 mushi888
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.