Skip to content
    ↑↓ select↵ openesc close
    English中文
    xesrevinu

    Jj Enforcer

    v0.1.2Git & VCS
    @xesrevinu/opencode-jj-enforcer

    OpenCode plugin that enforces jj over git when a workspace contains a .jj repository.

    GitHub stars

    1

    Monthly installs

    51

    23 in 7 days

    Composite scoreSCORE

    24.7

    Multi-signal model

    Last commit

    5 months ago

    2026-03-17

    Install and configure

    opencode.json

    Writes 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"]
    }

    opencode 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 bash tool calls before execution instead of relying on post-hoc review
    • detects .jj roots from the workspace, git -C, and cd ... && 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