Transparent shims

Opt-in shims let you type node, python or a tool alias directly, and still get the right runtime every time.

Enable

shell
jrt shim enable                  # create the shim directory + one shim per registered tool
jrt shim add node npm npx python # shim runtime commands too
jrt shim path                    # shows the directory and the PATH line for your shell

Shims are never installed implicitly and jrt does not edit your PATH. Put the shim directory first on your PATH:

PowerShell
$shims = "$env:APPDATA\JervisRuntime\shims"      # use the directory printed by jrt shim path
[Environment]::SetEnvironmentVariable('Path', "$shims;" + [Environment]::GetEnvironmentVariable('Path','User'), 'User')

How a shim routes

When you run a shimmed command name, jrt resolves it in this order:

  1. Registered tool alias → runs like jrt run <alias>: locked version, selected runtime.
  2. Runtime command (node, npm, pnpm, python, go, cargo, …) inside a project → runs like jrt exec -- with the nearest .jrt.toml, including packageManager routing.
  3. Anything else → the next executable with the same name on PATH runs unchanged.
shell
cd legacy-app && node -v      # v18 (from .jrt.toml)
cd ~ && node -v               # your system node, untouched
desktop-commander             # registered tool, on its own runtime, from anywhere

Managing shims

shell
jrt shim list                 # each shim with ok / stale
jrt shim sync                 # recreate shims after upgrading jrt
jrt shim remove npx
jrt shim disable              # remove all shims

Tool shims are re-synchronized automatically after jrt tool add and jrt tool remove.

Behaviour details

  • Windows: each shim is a hard link (or copy) of jrt.exe, not a .cmd file. Arguments are passed through without cmd.exe re-parsing, and Ctrl+C never asks “Terminate batch job?”.
  • Linux / macOS: each shim is a tiny POSIX sh script that execs jrt.
  • The routed program’s exit code is returned unchanged, and jrt prints nothing extra when it fails.
  • Arguments with spaces, empty strings and quotes arrive exactly as typed.
  • Nested shim re-entry is bounded by JRT_SHIM_DEPTH, so a misconfigured PATH cannot loop forever.