Automated code playback tool for creating coding tutorials and demo videos with hotkey-driven controls.
Ghost Coder is a Windows application that allows you to load a source code file and automatically "type" it into any text editor or IDE, simulating realistic coding. Perfect for creating coding tutorials, recording demos, or practicing presentations without the stress of live coding.
- Automated Typing Playback: Load any text/code file and have it automatically typed character-by-character
- Hotkey Control: Configure global keyboard, mouse, or gamepad hotkeys to control playback from any application
- Customizable Speed: Adjust typing speed from 50ms to 500ms per character
- Advanced Playback Options:
- Variable typing speed for more realistic coding simulation
- Auto-pause on new lines
- Start playback in paused mode
- Auto-home cursor on newline
- Quad-space to Tab replacement
- Window focus detection with auto-pause
- Special Syntax Support: Includes special commands for pauses, scrolling, and repeated keys
- Modern GUI: Built with NiceGUI for an intuitive interface with dark mode support
- MQTT-Based Architecture: Multi-process design for responsive control and monitoring
pip install ghost-coder- Clone the repository:
git clone https://github.com/sethstenzel/ghost-coder.git
cd ghost-coder- Install dependencies:
pip install -e .- Run Ghost Coder:
ghost-coder- Select a source code file to playback
- Adjust playback speed and settings as needed
- Click on the text editor/IDE window where you want the code to appear
- Click "PLAY" or use your configured hotkey to start playback
Right-click any control button to assign a global hotkey:
- Play/Pause/Resume: Start or pause playback
- Stop: Stop playback and reset to beginning
- Advance to Newline: Skip to the next line
- Advance Token: Skip to the next character/token
Supports keyboard keys, mouse buttons, and gamepad controls.
ghost-coder [--port PORT] [--logging] [--extbroker HOST:PORT]--port: Specify MQTT broker port (default: random available port)--logging: Enable detailed logging toghost_coder.logand console--extbrokeror--extmqtt: Connect to external MQTT broker (format:host:port)
- Ghost Coding Speed: Control typing speed (50-500ms per character)
- Auto Pause on New Line: Automatically pause when reaching a new line
- Start Playback Paused: Begin in paused mode, ready to advance manually
- Auto Home on Newline: Press Home key at the start of each new line
- Ctrl on Newline: Hold Ctrl when pressing Enter (useful for some IDEs)
- Replace Quad Spaces With Tab: Convert 4 spaces to Tab key
- Pause Playback On App Focus Change: Auto-pause when you switch windows
- Refocus Window On Resume: Automatically return focus to target window when resuming
- Varied Coding Speed: Add random variation (-50ms to +150ms) for realistic typing
Ghost Coder supports special syntax in your source files:
<<PAUSE>>: Force a pause at this point in playback<<SCROLL:UP:5>>: Scroll up 5 times<<SCROLL:DOWN:3>>: Scroll down 3 times<<DOWN:10>>: Press down arrow 10 times<<ENTER:5>>: Press Enter 5 times
Ghost Coder uses a multi-process architecture with MQTT messaging:
- Main UI Process: NiceGUI-based interface running in native window mode
- Broker Process: Internal MQTT broker for inter-process communication
- Listener Process: Global input listener for hotkey detection
- Typer Process: Automated text input simulator with window focus tracking
This design ensures responsive UI and reliable hotkey detection while typing is in progress.
- Python 3.13+
- Windows OS (uses
pygetwindowfor window management) - Dependencies (automatically installed):
- nicegui >= 3.3.1
- pynput >= 1.8.1
- paho-mqtt >= 2.1.0
- inputs >= 0.5
- pygetwindow >= 0.0.9
- loguru >= 0.7.3
- pywebview >= 6.1
# Clone the repository
git clone https://github.com/sethstenzel/ghost-coder.git
cd ghost-coder
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# Install in editable mode with dev dependencies
pip install -e ".[dev]"ghost-coder/
├── src/
│ └── ghost_coder/
│ ├── app.py # Main UI application
│ ├── typer.py # Automated typing engine
│ ├── listener.py # Global input listener
│ ├── broker.py # MQTT broker process
│ ├── data.py # Text parsing and token definitions
│ ├── utils.py # Utility functions
│ └── hotkeys.json # Saved hotkey configurations
├── pyproject.toml # Project configuration
└── README.md
MIT License - see LICENSE file for details
Seth Stenzel - [email protected]
- Homepage: https://github.com/sethstenzel/ghost-coder
- Issues: https://github.com/sethstenzel/ghost-coder/issues
- Repository: https://github.com/sethstenzel/ghost-coder
Contributions are welcome! Please feel free to submit a Pull Request.
Built with:
- NiceGUI - Python UI framework
- pynput - Input control and monitoring
- Eclipse Paho - MQTT client
- inputs - Gamepad support
