Jjinn is a script for nix projects that runs a program (such as opencode) sandboxed inside in an ephemeral jj workspace.
It uses the contents of your project's devShells to construct the sandbox environment using bwrap.
jjinn integrates nicely into a regular jj workflow. You simply run jjinn <revset> and it will make sure every change made in the ephemeral workspace is synced to a new revset before terminating. You can then jj describe, jj squash, jj merge, jj edit, etc to deal with the resulting revision.
Edit from the current revision in the current repo:
jjinnEdit from the previous commit in ./project using the my-package devshell output:
jjinn @- --repo ./project --devshell "my-package"This project can be used as a flake from github:anglesideangle/jjinn. For example, nix profile add github:anglesideangle/jjinn#jjinn-opencode.
The default jjinn configuration uses opencode. However, it is not tightly coupled to opencode, and you can create your own package using this flake's lib.makeJjinn wrapper.
Here is example configuration for claude code:
jjinn.lib.makeJjinn pkgs {
executable = lib.getExe pkgs.claude-code;
sandboxInputs = with pkgs; [
claude-code
nix
coreutils
curl
which
findutils
diffutils
gnupatch
gnugrep
...etc
];
homeBinds = [ ".claude" ];
}