@xesrevinu/opencode-jj-enforcerOpenCode plugin that enforces jj over git when a workspace contains a .jj repository.
1
51
23 in 7 days
24.7
Multi-signal model
5 months ago
2026-03-17
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@xesrevinu/opencode-jj-enforcer@0.1.2"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@xesrevinu/opencode-jj-enforcer@0.1.2"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D @xesrevinu/opencode-jj-enforceropencode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
OpenCode plugin that blocks git usage inside Jujutsu workspaces and forces agents onto jj.
Highlights
- inspects
bashtool calls before execution instead of relying on post-hoc review - detects
.jjroots from the workspace,git -C, andcd ... && git ...command patterns - blocks wrapper forms such as
rtk git ...so rewrite plugins cannot bypass the policy - stays repository local with no external service or daemon requirements
- ships as a small npm package that can also be copied directly into
.opencode/plugin
Install
Use the published package from opencode.jsonc:
{
"plugin": ["@xesrevinu/opencode-jj-enforcer@latest"],
}
Restart OpenCode after updating the plugin list.
If you want to iterate from a checkout instead of npm:
mkdir -p .opencode/plugin
cp plugin/jj-enforcer.ts .opencode/plugin/jj-enforcer.ts
Usage
The plugin checks the current workspace plus directories referenced inside the shell command. If any of them belong to a Jujutsu repository, the command is rejected and the agent is told to use jj.
Examples that are blocked inside a .jj workspace:
git status
git -C ../repo log
cd ../repo && git diff
rtk git log
Development
The repository uses Bun for dependency management and local commands.
bun install
bun run check
Release
This package uses Changesets plus the shared GitHub Actions release workflow.
bun run changeset
bun run version-packages
bun run release
License
MIT