A Python clone of lazygit with TUI interface
Project description
lazygit-python
A Python clone of lazygit with terminal UI for Git operations.
๐ Quick Start
python -m lazygit
Features
- ๐ File staging/unstaging with visual status indicators
- ๐ Commit creation with message editor
- ๐ฟ Branch management (create, checkout, delete)
- ๐ Push/Pull/Fetch operations
- ๐ Repository status overview
- ๐ Commit history viewer
- ๐ Diff viewer for files and commits
- ๐พ Stash management
- ๐ Merge and rebase operations
- โจ๏ธ Keyboard-driven interface
Installation
Method 1: Install from source (recommended)
# Clone the repository
git clone <repository-url>
cd lazygit-python
# Install using pip
pip install .
# Or install in development mode
pip install -e .
Method 2: Install from PyPI (when available)
pip install lazygit-python
Method 3: Standalone Installers
Download pre-built installers for your platform:
Windows
- Download
lazygit-python-0.1.0-setup.exefrom releases - Run the installer and follow the setup wizard
- The application will be available in Start Menu and Desktop
macOS
- Download
lazygit-python-0.1.0.dmgfrom releases - Open the DMG and drag the app to Applications
- Run from Applications or use
lazygit-pyin terminal
Linux
- AppImage: Download
lazygit-python-0.1.0-x86_64.AppImage, make executable withchmod +x, and run - Debian/Ubuntu: Download
lazygit-python_0.1.0_all.deband install withsudo dpkg -i - Snap:
sudo snap install lazygit-python(when available)
Method 4: Build from source
# Clone and enter directory
git clone <repository-url>
cd lazygit-python
# Build standalone executable
make installer
# Or build specific format
python build_installers.py [pyinstaller|windows|macos|linux]
๐ง Building Installers
You can create platform-specific installers using the included build script:
Prerequisites
- Python 3.8+
- Git
- Platform-specific tools (see below)
Build Commands
# Build for current platform (auto-detects)
python build_installers.py
# Build PyInstaller executable only
python build_installers.py pyinstaller
# Build Windows installer (.exe)
python build_installers.py windows
# Build macOS app bundle and DMG
python build_installers.py macos
# Build Linux packages (deb, AppImage)
python build_installers.py linux
Platform-Specific Requirements
Windows
- NSIS (Nullsoft Scriptable Install System) for
.exeinstaller - Install from: https://nsis.sourceforge.io/
- After running the build script, execute:
makensis installer.nsi
macOS
- Xcode Command Line Tools for DMG creation
- Install with:
xcode-select --install - After running the build script, execute:
./create_dmg.sh
Linux
- Standard build tools (gcc, make, etc.)
- wget for AppImage tools
- For Debian packages:
sudo apt-get install build-essential - After running the build script, execute:
./build_appimage.sh
Build Output
The build process creates the following files:
- Windows:
lazygit-python-0.1.0-setup.exe - macOS:
lazygit-python-0.1.0.dmg - Linux:
lazygit-python-0.1.0-x86_64.AppImagelazygit-python_0.1.0_all.deb
- All platforms:
dist/lazygit-py(standalone executable)
Distribution
- Run the appropriate build command for your platform
- Test the generated installer/package
- Upload to GitHub Releases or your preferred distribution method
Troubleshooting
PyInstaller Issues:
- Ensure all dependencies are installed:
pip install -r requirements.txt - For missing modules, add them to
hiddenimportsin the spec file
Windows NSIS Issues:
- Make sure NSIS is in your PATH
- Check that
dist/lazygit-py.exeexists before running NSIS
macOS Code Signing:
- For distribution, you may need to sign the app:
codesign -s "Your Developer ID" dist/lazygit-py - For notarization, use
xcrun notarytool
Linux Dependencies:
- AppImage requires
fuseto run:sudo apt-get install fuse - For older systems, you may need to install
libfuse2
Usage
Run from within a git repository:
# If installed via pip or installer
lazygit-py
# Short alias
lgpy
# Or run directly with Python
python -m lazygit
Keyboard Shortcuts
Navigation
Tab- Next panelShift+Tab- Previous panelโ/โ- Navigate itemsq- Quit
Files
s- Stage/Unstage selected filea- Stage all filesu- Unstage all filesD- View diff of selected file
Commits
c- Create commitEnter- Show commit details
Branches
b- Checkout branchn- Create new branchd- Delete branchm- Merge selected branchR- Rebase onto selected branch
Remote Operations
p- PushP- Pullf- Fetch
Stash
S- Stash changesCtrl+S- Pop latest stash
Other
r- Refresh?- Show help
Requirements
- Python 3.8+
- Git installed and accessible from command line
- Terminal with Unicode support
Dependencies
textual- Terminal UI frameworkGitPython- Git operationsclick- CLI frameworkpyyaml- Configuration support
Project Structure
lazygit-python/
โโโ lazygit/
โ โโโ __init__.py
โ โโโ __main__.py
โ โโโ git_operations.py # Git command wrapper
โ โโโ ui/
โ โโโ __init__.py
โ โโโ app.py # Main TUI application
โ โโโ dialogs.py # Dialog components
โโโ requirements.txt
โโโ setup.py
โโโ README.md
Limitations
- Some advanced Git features are not yet implemented
- Remote branch deletion is not supported from the UI
- Interactive rebase is not supported
- Cherry-pick is not implemented
License
This is a educational project inspired by the original lazygit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lazygit_python-0.1.0.tar.gz.
File metadata
- Download URL: lazygit_python-0.1.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63097c43d6ddabff871c0e75beb01b641660051571c39f70269f6a976c29ba14
|
|
| MD5 |
c9a429692580e161b72291128fbda956
|
|
| BLAKE2b-256 |
30616b5cee11787e060d78aeb971630a96588eff09e6f9b82bfc706ed9275fa1
|
File details
Details for the file lazygit_python-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lazygit_python-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b27aad0d09725de70a34f603763e03fc66cedb61fa34d9f66ddf1b3842ca787f
|
|
| MD5 |
c91c925c959a2b6cef726078fbeae0b8
|
|
| BLAKE2b-256 |
48f5907df3e750b67e433615090e25ea52b75fe9b4c186ed2761dcfcf6df1266
|