← Catalog

@diegopetrucci/pi-dirty-repo-guard

A pi extension that prompts before session changes when the current git repo has uncommitted changes.

Package

Install

Install with PiG

pig install npm:@diegopetrucci/pi-dirty-repo-guard

Install with Pi

pi install npm:@diegopetrucci/pi-dirty-repo-guard
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": [
    "index.ts"
  ]
}

README

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

dirty-repo-guard

A small pi extension that prompts before session changes when the current git repo has uncommitted changes.

This is copied from the original dirty-repo-guard.ts example in earendil-works/pi and kept basically the same.

What it checks

Before creating a new session, switching sessions, or forking, the extension runs:

git status --porcelain

If the command reports changed files, pi asks whether to proceed anyway. If pi is running without an interactive UI, matching actions are cancelled by default.

Install

Standalone npm package

pi install npm:@diegopetrucci/pi-dirty-repo-guard

Collection package

pi install npm:@diegopetrucci/pi-extensions

GitHub package

pi install git:github.com/diegopetrucci/pi-extensions

Then reload pi:

/reload

Notes

  • Hooks session_before_switch and session_before_fork.
  • Allows session changes outside git repos.
  • Cancels the action when the user declines.