← Catalog

@svyaddict/pi-git-commands

Pi package that adds /git status, fetch, pull, push, branch and cleanup commands, branch autocomplete and a git-aware footer with ahead/behind counters

Extension

Install

Install with PiG

pig install npm:@svyaddict/pi-git-commands

Install with Pi

pi install npm:@svyaddict/pi-git-commands
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.

pi-git-commands

npm version npm downloads License: MIT pi package

Everyday git workflow, right inside pi — check status, fetch, pull, push, switch, create and clean up branches without leaving the agent, and always know whether you are ahead or behind your upstream.

Features

  • 📋 /git status — compact summary of conflicts, staged, unstaged and untracked files, with ↓incoming ↑outgoing counters.
  • 📡 /git fetch — fetch all remotes and prune stale branches, then tell you whether there is something to pull.
  • 🔄 /git pull — fast-forward pull and prune in one step; never merges or rebases on your behalf. Offers to set the upstream when it is missing.
  • 🚀 /git push — push the current branch; when it has no upstream, pi picks the remote and sets it. Never force-pushes.
  • 🌿 /git branch — list branches, switch to one, check out a remote branch with tracking, or create a new one.
  • 🧹 /git cleanup — delete branches already merged or whose upstream is gone, after confirmation.
  • ⌨️ Autocomplete — subcommands and branch names (local and remote) are suggested as you type.
  • 📊 Git-aware footer — current branch with ↓incoming ↑outgoing commit counters, refreshed automatically, alongside the usual token, cost and context stats. Turn it on or off for every session with /git footer on|off.
  • 🔒 Never hangs on a prompt — git runs non-interactively: missing credentials fail fast instead of blocking pi.

Installation

pi install npm:@svyaddict/pi-git-commands

Then start pi inside a git repository and type /git. Other ways to install (from GitHub, per project, single session), updating and removing are covered in the installation guide.

Requires git on your PATH and Node.js >= 22.19.0.

Upgrading from 0.1.x

Run pi update npm:@svyaddict/pi-git-commands to get the latest version. Version 0.2.0 changes /git pull: it now only fast-forwards, whatever pull.rebase says. When your branch and its upstream have diverged, it reports it and leaves the branch untouched instead of merging or rebasing: integrate the changes yourself, then pull again. See the changelog for everything new.

Commands

CommandWhat it does
/git statusSummary of conflicts, staged, unstaged and untracked files
/git fetchFetch all remotes, prune stale branches, report incoming commits
/git pullFast-forward the current branch, setting its upstream if needed
/git pushPush the current branch, setting its upstream if needed
/git branchList local branches (> current, * local only)
/git branch <name>Switch to a branch, check out a remote one, or create it
/git cleanupDelete merged branches and branches whose upstream is gone
/git footer [on|off]Show or change whether the git footer is used, in every session

Every command, with examples and edge cases: docs/commands.md.

Git-aware footer showing the branch with incoming and outgoing commit counters

Next to the branch name, ↓ counts commits to pull and ↑ commits to push. ↓ reflects the last fetch: run /git fetch to update it. To keep pi's built-in footer instead, run /git footer off once: the choice is saved and applies to every session. Details: docs/footer.md.

Documentation

  • Commands: every command in detail
  • Footer: counters, refresh, stats, turning it on or off
  • Installation: all install options and compatibility notes
  • Development: project layout, adding a command, releasing

Contributing

Bug reports, ideas and pull requests are welcome. See CONTRIBUTING.md.

Changelog

See CHANGELOG.md.

License

MIT © svyaddict