omp packages

@juanem1/pi-git0.1.0

Focused Git tools for Pi with explicit confirmation for mutations.

juanem1 Published 9 days ago MIT ~237 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

Package pi-git

A Pi package for Git, with no npm dependencies or installation scripts. Commits, pushes, and worktree changes require individual confirmation. It does not add co-authors or impose a commit message format.

Requirements

  • Pi
  • Git
  • Node.js 22 or later

Install in Pi

Install from npm:

pi install npm:@juanem1/pi-git

Or from a local clone:

git clone https://github.com/juanem1/pi-git.git
pi install ./pi-git

Add -l to install it only for the current project (.pi/settings.json). Restart Pi or run /reload if it is already open.

To try it without installing, from a local clone:

pi -e ./pi-git

To update or uninstall:

pi update npm:@juanem1/pi-git
pi remove npm:@juanem1/pi-git

Tools

Tool Behavior
git_status Branch, staged, modified, and new files.
git_diff Local or staged diff, or diff against a revision; optional literal paths.
git_log Up to 200 commits; 20 by default.
git_show Commit message and diff.
git_commit Confirms the message, branch, and files; commits only those complete files, without pushing.
git_push Confirms the remote, destination, branch, and commit; pushes only the current branch.
git_worktree_list Lists existing worktrees.
git_worktree_add Confirms a new path and branch; does not change the current worktree's branch.
git_worktree_remove Confirms removal of a clean worktree; preserves its branch.
git_worktree_prune Previews and confirms cleanup of metadata for missing worktrees.

File paths are relative to the root of the current repository. Commit does not accept directories: list individual files and both paths of a renamed file. If a file is partially staged, its entire working tree content is committed. Other already-staged files are excluded from the commit.

Security limits

  • Runs only git, with separate arguments and no shell. It does not use eval, downloads, cleanup commands, or background processes.
  • Does not offer reset, discarding changes, rebase, amend, force push, branch deletion, or forced worktree removal.
  • Refuses to remove worktrees with modified, new, or ignored files, as well as the main, current, or locked worktrees.
  • Push requires an explicit remote with a single HTTPS/SSH URL. It does not accept local paths, remote helpers, tags, or refspecs from the model.
  • Mutations are rejected without a Pi confirmation interface.
  • Does not disable hooks or configured signing. Git hooks, filters, and transports can run programs from the repository or environment: use trusted repositories and Git configurations.

This is not a sandbox and does not block Pi's general Bash access or other extensions. Queries disable external diff, textconv, and signature verification. Large outputs are explicitly limited; a process that exceeds 120 seconds or 4 MiB of output fails. If a mutation fails, check the status before retrying.

Development

No npm install is needed.

npm test

Release

Publishing runs in GitHub Actions with npm trusted publishing when a v* tag is pushed. Add the version's entry to CHANGELOG.md, then:

npm version patch   # or minor / major; commits and tags vX.Y.Z
git push --follow-tags