Skip to main content

One-command git workflow helper: add, summarize, commit, pull --rebase, and push.

Project description

GitLazy (gz)

gz is a cross-platform Git automation helper designed to streamline everyday workflows. It stages, summarizes, commits, rebases, and pushes changes with a single command, adapting intelligently to the state of your repository.

Features

  • Works from any subdirectory by auto-detecting the repository root (or via an explicit path argument).
  • Generates commit messages with [add], [refactor], or [removed] tags based on the staged changes.
  • Summarizes added, modified, renamed, and removed files in the commit body.
  • Performs git pull --rebase --autostash for safe synchronization.
  • Pushes automatically when an upstream is configured and guides you when it is not.
  • Handles conflicts gracefully by surfacing clear next steps.

Installation

Via PyPI (recommended)

pip install gitlazy-cli

This installs the gz console script on your PATH.

Manual install (macOS / Linux)

sudo cp gz /usr/bin/gz
# or, without sudo:
mkdir -p ~/.local/bin
cp gz ~/.local/bin/
chmod +x ~/.local/bin/gz
# ensure ~/.local/bin is on your PATH

Manual install (Windows PowerShell or CMD)

  1. Install Python 3.8+ and Git.
  2. Save gz to %USERPROFILE%\bin\gz.
  3. Create gz.cmd somewhere on your PATH containing:
    @echo off
    python "%USERPROFILE%\bin\gz" %*
    

Now gz is available globally.

Usage

# Run from the current repo
gz

# Target an explicit repo
gz /path/to/repo

# Or via python -m
python -m gitlazy /path/to/repo

Example Output

[refactor] 2 updated, 1 added
3 files changed, 54 insertions(+), 23 deletions(-)
Done. Changes committed, rebased, and pushed.

Behavior

  • Always stages everything with git add -A.
  • Skips committing when no changes are staged but still performs a safe pull/push.
  • Skips pull/push and prints the upstream command when the current branch has no upstream configured.
  • On pull failures, surfaces Git’s stderr and reminds you to finish any rebase with git rebase --continue before pushing.
  • When no upstream is configured:
    git push --set-upstream origin <branch>
    

Acceptance Checks

  1. Add only: create a repo, add files, run gz[add] <count> added.
  2. Modify + add: modify and add files, run gz[refactor] … updated, … added.
  3. Rename + delete: rename and delete files, run gz[removed] … renamed, … removed.
  4. No changes: run gz with a clean tree → prints “Nothing to commit. Syncing with remote…” and still pulls/pushes.
  5. New branch: run on a branch without upstream → shows git push --set-upstream origin <branch>.
  6. Cross-path: run from subfolders or via gz /path/to/repo → operates on the correct repository.
  7. Outside repo: run where no .git exists → exits with a helpful error message.

Development Notes

  • Python 3.8+ package with a single CLI module.
  • Depends only on the Python standard library modules: os, sys, pathlib, subprocess, and shutil.

Building and publishing

python -m build
twine upload dist/*

Use TestPyPI first: twine upload --repository testpypi dist/*.


Happy automating! 🎯

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitlazy_cli-0.1.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitlazy_cli-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file gitlazy_cli-0.1.2.tar.gz.

File metadata

  • Download URL: gitlazy_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for gitlazy_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5a1f2a8c7cf54512c6c4bc6d08b875797bd6e1e16c81baccfb5ff6f4286cc868
MD5 dec4797d69a8d922f79eae8374c173df
BLAKE2b-256 22409a20e92474a474c3cd0946dada892a2e54c0b10abf2ba5d8766b3d69fe7c

See more details on using hashes here.

File details

Details for the file gitlazy_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: gitlazy_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for gitlazy_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d47c8fe05e2ddc3691179076648a361ddb76caccf10eca37c64fba8e5ce238b2
MD5 e234e37b7cdd96301fcc722e9f5dba32
BLAKE2b-256 c6a88d97e1bfbfb229e391481d3eefe2dc13789e76285380f74bf9fe5a28fbde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page