gg-cli is a robust, highly extensible command-line interface designed to streamline complex Git workflows, enforce a standardized custom Git Flow, manage repository-isolated author profiles, and manipulate commit timestamps seamlessly.
Built with software engineering best practices—including SOLID principles, clean code architecture, and the Command Pattern—this tool is engineered for developers who require precise control over their version control environments without polluting global system configurations.
- Repository-Isolated Profile Management: Configure unique author and committer identities per repository. Settings are stored securely inside a hidden
.git/gg/config.jsonfile, ensuring complete isolation from your global Git configuration. - Flexible Timestamp Manipulation: Easily override author and committer dates for individual commits using an intuitive syntax that accepts both hyphens (
-) and underscores (_) as separators (e.g.,2026-07-04_17-32or26_07_04-17-32). - Automated Custom Git Flow: Simplify branching strategies with automated semantic versioning (
0.0.0). Start and finish features, releases (major/minor bumps), and hotfixes with single commands that handle branching, merging, tagging, and cleanup automatically. - Interactive Unborn Repository Handling: Safely initialize empty repositories with an interactive setup wizard that guides you through profile selection, initial root commit creation (via
--allow-empty), and development branch setup. - Push Confirmation Guard: Enable optional safety prompts before pushing branches and tags to remote servers to prevent accidental deployments.
- Extensible & Modular Design: Every command is decoupled into its own class, making it effortless to add new features or integrate external APIs in the future.
The project follows a modular structure where commands, configuration management, and Git subprocess operations are strictly separated:
gg-cli/
├── pyproject.toml
├── README.md
└── gg_cli/
├── __init__.py
├── main.py # CLI entry point and command router
├── config.py # Isolated JSON configuration manager (.git/gg/)
├── git_ops.py # Subprocess wrapper for Git commands
├── utils.py # Helper functions (time parsing, interactive prompts, logging)
└── commands/
├── __init__.py
├── base.py # Abstract base command class (Command Pattern)
├── init_cmd.py # Repository initialization & unborn branch wizard
├── info_cmd.py # Repository status and configuration display
├── edit_cmd.py # Profile, remote, and setting modifications
├── commit_cmd.py# Commit execution and timestamp overriding
├── push_cmd.py # Push operations with optional confirmation
└── flow_cmd.py # Git Flow management (feature, release, hotfix, finish)
- Python 3.8+
- Git installed and accessible via system PATH.
- Operating System: Linux (Ubuntu/Debian), macOS, or Windows.
- Clone or download the repository to your local machine.
- Navigate to the root directory containing
pyproject.toml. - Install the package in editable mode using
pip:
pip install -e .Note for Ubuntu/Debian users: If you encounter an environment managed error, use a virtual environment (venv) or append --user to the installation command:
pip install --user -e .Once installed, the gg command will be globally accessible in your terminal.
Initialize gg-cli inside any existing Git repository. If the repository is completely empty (no previous commits), an interactive wizard will launch to configure your profile and create the initial root commit before setting up the develop branch.
git init
gg initDisplay the current branch, active semantic version, isolated profile details, configured remotes, and push confirmation settings.
gg infoExample Output:
--- GG Repository Info ---
Current Branch : develop
Flow Version : 0.1.0
Active Profile : John Doe <john@example.com>
Push Confirm : True
Remotes :
- origin git@github.com:username/repository.git (fetch)
- origin git@github.com:username/repository.git (push)
--------------------------
Modify repository-specific settings without affecting your global Git profile.
# Set an isolated author/committer profile for this specific repository
gg edit --profile-name "John Doe" --profile-email "john.doe@example.com"
# Enable push confirmation safeguard
gg edit --push-confirm true
# Add or remove remotes
gg edit --remote-add origin git@github.com:username/repo.git
gg edit --remote-remove originExecute standard commits or combine staging and committing (git add . + git commit) while dynamically overriding commit timestamps.
# Commit staged changes with standard system time
gg commit -m "Implement authentication module"
# Stage all changes and commit with a custom historical timestamp
# Supported formats: YYYY-MM-DD_HH-mm or YY-MM-DD_HH-mm (hyphens and underscores are interchangeable)
gg ac -m "Fix critical routing bug" --time 2026-07-04_17-32
gg ac -m "Update documentation" --time 26_07_04-17_32Manage the project lifecycle using standardized branching conventions and automated version bumping.
Creates a new branch named feature/<name> branching off from develop.
gg feature start user-dashboardAutomatically bumps the version number in the configuration, creates a branch named release/<new_version> from develop. Use m for minor bumps and M for major bumps.
# Minor release bump (e.g., 0.1.0 -> 0.2.0)
gg release start m
# Major release bump (e.g., 0.2.0 -> 1.0.0)
gg release start MBumps the patch version automatically and creates a branch named hotfix/<new_version> branching directly off from main.
# Patch bump (e.g., 1.0.0 -> 1.0.1)
gg hotfix startIntelligently detects the active flow branch type and executes the necessary merge, tagging, and cleanup operations:
- Feature Branches: Merges back into
develop(no-ff) and deletes the feature branch. - Release & Hotfix Branches: Merges into both
mainanddevelop, tags the commit onmainwith the version number (e.g.,1.0.0), and deletes the temporary branch.
gg finishPush all local branches and tags to the configured remote repositories simultaneously. If push confirmation is enabled, the CLI will prompt for user verification prior to execution.
gg pushWhen initialized, gg-cli generates a configuration file at .git/gg/config.json. Because it resides within the .git directory, it is inherently ignored by Git tracking, ensuring your local author overrides and flow states remain private to your local environment.
Sample .git/gg/config.json Structure:
{
"profile": {
"name": "John Doe",
"email": "john.doe@example.com"
},
"push_confirmation": true,
"version": "1.0.0",
"main_branch": "main",
"develop_branch": "develop"
}To add a new command to gg-cli:
- Create a new command file inside
gg_cli/commands/(e.g.,status_cmd.py). - Inherit from
BaseCommandand implementsetup_args(self)andexecute(self, args). - Register the instantiated command in the
commandsdictionary insidegg_cli/main.py.
This project is open-source and available under the MIT License. You are free to modify, distribute, and integrate this tool into your personal or enterprise workflows.