Skip to content

cole/pi-jj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pi-jj — jj (jujutsu) extension for pi

Automatically intercepts git commands when working in a jj project and redirects to jj equivalents.

What it does

When a .jj directory is detected in your project:

  • System prompt injection — appends a jj guide to every agent turn, so the agent always knows it's in a jj project
  • Git command interception — intercepts bash tool calls that use git and either:
    • Auto-transforms safe read-only commands (git statusjj status, git logjj log, etc.)
    • Blocks dangerous commands (git commit, git add, git stash, etc.) with a message explaining the jj equivalent
  • Status indicator — shows 🦀 jj in the footer when active

Auto-transformed commands

These git commands are silently rewritten to jj equivalents:

git jj
git status jj status
git log jj log
git diff jj diff
git show jj show
git blame jj annotate
git push jj git push
git pull jj git pull
git fetch jj git fetch
git branch -a jj bookmark list --all

Blocked commands with guidance

These git commands are blocked with a message suggesting the jj equivalent:

git commit, git add, git stash, git checkout, git merge, git rebase, git reset, git cherry-pick, git revert, git switch, and more.

Install

pi install https://github.com/cole/pi-jj
Manual install
cp -r extensions/pi-jj ~/.pi/agent/extensions/

Then /reload in pi.

Commands

Command Description
/jj Show current jj detection status
/jj on Re-enable jj interception
/jj off Disable jj interception for this session
/jj status Show whether jj project is detected
/jj help Show help

How it works

  1. On session_start, checks for .jj directory in the project root
  2. On before_agent_start, injects a jj reference into the system prompt
  3. On tool_call for bash commands, detects git invocations and either transforms or blocks them
  4. Uses /jj command for manual control

Why?

AI agents default to git commands. In a jj project, running git commit or git stash can cause confusion because jj manages the working copy differently. This extension ensures the agent always uses the right tool for the job.

About

jj extension for pi coding agent

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors