Lazy Git Push command
  • Go 90.3%
  • Shell 9.7%
Find a file
j 6ee2a1decc
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 26s
Build-Test-Publish / build (linux/arm64) (push) Successful in 58s
Retrigger CI
2026-05-20 23:22:54 +12:00
.gitea/workflows Add Go setup step to CI workflow 2026-05-10 10:54:18 +12:00
.gitignore Rewrite gp as a Go program with configurable LLM, multi-repo support, 2026-05-10 10:33:02 +12:00
build.sh Rewrite gp as a Go program with configurable LLM, multi-repo support, 2026-05-10 10:33:02 +12:00
ci.go Fix stty commands by connecting Stdin to the terminal 2026-05-10 13:42:54 +12:00
display.go Default confirm prompts to yes on empty input 2026-05-12 23:37:31 +12:00
git.go Rewrite gp as a Go program with configurable LLM, multi-repo support, 2026-05-10 10:33:02 +12:00
go.mod Rewrite gp as a Go program with configurable LLM, multi-repo support, 2026-05-10 10:33:02 +12:00
llm.go Add LLM source tracking to commit message generation 2026-05-13 22:11:59 +12:00
llm_test.go Add LLM source tracking to commit message generation 2026-05-13 22:11:59 +12:00
main.go Process multi-repo commits in parallel using goroutines 2026-05-20 22:54:38 +12:00
publish.sh Replace commit-msg with ask utility for LLM commit messages 2026-05-13 12:56:40 +12:00
README.md Add LLM source tracking to commit message generation 2026-05-13 22:11:59 +12:00
setup_script.sh Replace commit-msg with ask utility for LLM commit messages 2026-05-13 12:56:40 +12:00
test.sh Add Go PATH detection to test.sh for non-interactive shells 2026-05-10 10:34:51 +12:00

gp - Git Push

Add, commit, and push in one command.

Generates commit messages using a configurable LLM with a heuristic fallback. Supports pushing multiple repos and waiting for all CI workflows in parallel.

Install

getpkg install gp

Usage

gp                              # Add all, auto-generate commit message, push
gp "Fix the parser"             # Custom commit message
gp --dry-run                    # Preview without executing
gp --staged-only                # Only commit staged changes
gp -y                           # Skip confirmations
gp -b develop                   # Push to a specific branch
gp --no-wait                    # Don't wait for CI after push
gp --llm ask                    # Use ask for commit messages
gp -y repo1/ repo2/ repo3/     # Push multiple repos, parallel CI wait

Options

Option Description
-n, --dry-run Preview changes without executing
-f, --force Skip all confirmations
-y, --yes Auto-answer yes to prompts
-a, --add-all Add all files including untracked (default)
--staged-only Only commit staged changes
-b, --branch Push to specified branch
--no-wait Skip waiting for CI workflow
--llm NAME LLM for commit messages (see below)

Commit Message Generation

The LLM used for commit messages is configurable via --llm, GP_LLM env var, or git config gp.llm:

Value Description
auto Try ask, claude, ollama, then heuristic (default)
ask Use the ask utility, configured by ~/.config/ask/ask.env
claude Use Claude CLI (claude --print)
ollama Use Ollama API with default model (qwen2.5:0.5b)
ollama:MODEL Use Ollama API with a specific model (e.g. ollama:qwen2.5:1.5b)
none Heuristic only, no LLM

ask reads its router settings from ~/.config/ask/ask.env, usually LLM_ROUTER_URL="http://rtx6000pro.home:8585". When ask is used, gp runs it with -v and reports the routed model when ask includes one, for example ask:qwen3.6-27b-fp8. Generated messages are shown with their source, for example Generated commit message using ask:qwen3.6-27b-fp8: 'Update gp commit message reporting'.

The Ollama API URL defaults to http://localhost:11434 and can be changed with GP_OLLAMA_URL or git config gp.ollama-url.

Heuristic fallback examples:

  • Single file: Add src/auth.py, Update README.md, Remove old_config.json
  • Multiple files: feat: Add 2 and update 3 files, docs: Update 2 files

Multi-Repo

Pass directory arguments to commit and push multiple repos, then wait for all CI workflows in parallel:

gp -y repo1/ repo2/ repo3/

Each repo gets its own auto-generated commit message. All commits and pushes happen first, then all CI workflows are monitored simultaneously. This replaces the old waterfall pattern of running gp in each repo one at a time.

CI Workflow Monitoring

After pushing to a Gitea remote, gp automatically monitors CI workflow progress:

[INFO] Waiting for CI workflows... (press ESC to stop)

  myproject
    ✓ build (linux/amd64)
    ⠹ build (linux/arm64) running
  otherproject
    ⠋ build (linux/amd64) running
    · build (linux/arm64) queued
  • Press ESC at any time to stop waiting (CI continues in background)
  • Requires a Gitea API token (from the remote URL, GITEA_TOKEN env, or git credential store)
  • Automatically skipped for GitHub/GitLab remotes or when no token is available
  • Use --no-wait to disable

Config Defaults

Set per-repo or global defaults via git config:

git config gp.auto-yes true           # Skip confirmations (like -y)
git config gp.wait false              # Don't wait for CI (like --no-wait)
git config gp.llm ask                 # Default LLM for commit messages
git config gp.ollama-url http://...   # Ollama API URL
git config --global gp.llm claude     # Apply globally