A simple Terminal User Interface for Git operations.
See docs/ for detailed project state and coverage info.
See CONTRIBUTING.md for guidelines.
This project follows conventional commit standards.
To enable commit message validation:
- Copy the commit hook:
cp scripts/commit-msg .git/hooks/commit-msg - Make it executable:
chmod +x .git/hooks/commit-msg
Commit messages must:
- Start with a type:
feat:,fix:,docs:,style:,refactor:,test:,chore:,perf:,ci:,build:,revert: - Be lowercase
- First line ≤60 characters
To rewrite existing commit messages in the history:
Run scripts/rewrite_msg.sh
This will lowercase and truncate first lines, then force-push the changes.
pip install .
python main.py
If files or folders are not visible (especially hidden files starting with .), on macOS:
- In Finder: Press
Cmd+Shift+.to temporarily toggle hidden files. - Via Terminal (persistent):
defaults write com.apple.finder AppleShowAllFiles YES && killall Finder. To hide again, replaceYESwithNO.
Build and run with Docker Compose:
docker-compose up --build
Run tests with coverage and security scan: python run_tests.py
Or manually: pytest --cov=main --cov-report=html tests/
Run all checks before commit/push: python check_all.py
Code scanned with Bandit and CodeQL. Dependabot enabled for dependency updates.
Code linted and formatted with Ruff. Run ruff check . for linting and ruff format . for formatting. CI runs on push/PR.
Bump version: python bump_version.py <major|minor|patch>
Then tag a version (e.g., v1.0.0) to trigger automated release with built package.
The app is built with Textual for the TUI framework. Main components:
GitTUIclass: Core app logic, UI composition, event handling- Git command execution: Uses
subprocessto run shell commands - Database: Optional PostgreSQL for command history (falls back gracefully)
- UI: Buttons for actions, input for commit messages, output display
.
├── .github/
│ ├── ISSUE_TEMPLATE/ # Issue templates
│ ├── workflows/ # GitHub Actions
│ └── PULL_REQUEST_TEMPLATE.md # PR template
├── docs/ # Documentation
├── tests/ # Test files
├── CONTRIBUTING.md # Contributing guide
├── Dockerfile # Docker image
├── README.md # This file
├── bump_version.py # Version bumping script
├── check_all.py # Pre-commit checks
├── docker-compose.yml # Docker Compose
├── main.py # Main app code
├── pyproject.toml # Packaging config
└── run_tests.py # Test runner
main.py: Entry point, app definitiontests/: Unit and e2e testspyproject.toml: Packaging and dependencies- Workflows: CI/CD automation
- Run the App:
python main.pylaunches the TUI - Git Operations: Click buttons or use keyboard shortcuts (s=status, a=add, etc.)
- Commit: Type message in input field, press Enter or click Commit
- History: View past commands if DB is connected
- Development: Run
python check_all.pybefore committing
- App initializes DB connection (optional)
- UI built with Textual widgets (Header, Buttons, Input, Static)
- Events handled via
on_button_pressedandon_key - Git commands executed synchronously with error checking
- Tests use pytest and Textual's Pilot for e2e
- Git status, add, diff, log, commit, push, pull
- Command history (with PostgreSQL)
- Keyboard shortcuts