# jq --from-file Relative Paths and `$ORIGIN`: Module Resolution Explained

> Understand jq --from-file relative paths and $ORIGIN. Learn how filter files and library paths resolve modules to ensure correct execution. Master jq module resolution.

- Repository: [jqlang/jq](https://github.com/jqlang/jq)
- Tags: deep-dive
- Published: 2026-04-11

---

**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