jq --from-file Relative Paths and `$ORIGIN`: Module Resolution Explained
When using jq --from-file, relative imports resolve against the filter file's directory (PROGRAM_ORIGIN), while $ORIGIN tokens in library search paths expand to the jq binary's directory (JQ_ORIGIN).
The jqlang/jq repository implements sophisticated path resolution for filter files loaded via --from-file that distinguishes between the location of the jq binary and the location of the filter script itself. Understanding how PROGRAM_ORIGIN and $ORIGIN interact ensures your modules load correctly regardless of where you invoke the command
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →