Resolve the command prefix used to invoke cmv from Claude Code hooks.
Claude Code hooks run in non-interactive shells that don't source .bashrc,
so custom PATH entries (like ~/.npm-global/bin, or nvm's node) aren't
available. We therefore invoke the entry point through the absolute path of
the node binary running us, which needs neither PATH nor the executable bit
and works on Windows too. Both paths are quoted to survive spaces.
Resolution order:
Walk up from this file to find the package's dist/index.js
Fall back to which cmv / where cmv
Fall back to bare cmv (original behavior) if nothing else works
Resolve the command prefix used to invoke cmv from Claude Code hooks.
Claude Code hooks run in non-interactive shells that don't source .bashrc, so custom PATH entries (like ~/.npm-global/bin, or nvm's node) aren't available. We therefore invoke the entry point through the absolute path of the node binary running us, which needs neither PATH nor the executable bit and works on Windows too. Both paths are quoted to survive spaces.
Resolution order:
which cmv/where cmvcmv(original behavior) if nothing else works