ende why
The ende why command explains why a particular package is in your dependency
tree by printing every path from your project's direct dependencies down to the
queried package. It reads the
lockfile, so it works
without touching the network.
It pairs with ende add and
ende remove: once you know why a
transitive dependency is in your tree, you can decide whether to remove a direct
dependency that's pulling it in.
Usage
ende why <package>
<package> is a JSR package name, optionally pinned with @<version>:
| Form | Meaning |
|---|---|
@ende/path |
every version of @ende/path in the tree |
@ende/[email protected] |
only the 2026.10.15 version |
jsr:@ende/path |
the same package by its full specifier |
Examples
Multiple paths to a single package
$ ende why @ende/path
@ende/[email protected]
jsr:@ende/fs@^2026.10.15 > @ende/[email protected]
jsr:@ende/http@^2026.10.15 > @ende/[email protected]
When the same package appears at multiple versions, each is shown in its own block — handy for diagnosing duplicated dependencies.
Workspace members
In a workspace, each member's direct dependencies appear as roots in the output, so a transitive dep introduced by one package is clearly attributable to that package.
Exit codes
| Exit code | Meaning |
|---|---|
0 |
The package was found in the resolved tree — at least one dependency path was printed. |
| Non-zero | The package is not in the resolved tree, or the argument is malformed. |
The non-zero exit is the easy way to gate CI on a package not being pulled in.
For example, to assert that @acme/legacy never enters your tree:
# fails the build if @acme/legacy is reachable
! ende why @acme/legacy
Common pitfalls
- "Package not found" but you know it's used at runtime.
ende whyreports what's in the lockfile, not what's imported by your code. If you've added ajsr:specifier but haven't runende install(or any subcommand that resolves), the package won't appear yet. - Resolution depends on workspace mode. A package only consumed by one
workspace member may not show up when run from a different member's directory
if your workspace setup uses per-member lockfiles. Run
ende whyfrom the workspace root for the complete picture.
Command line usage:
whyShow why a package is installed
Options
--env-file
Load environment variables from local file Only the first environment variable with a given key is used. Existing process environment variables are not overwritten, so if variables with the same names already exist in the environment, their values will be preserved. Where multiple declarations for the same environment variable exist in your .env file, the first one encountered is applied. This is determined by the order of the files you pass as arguments.
--frozen-lockfile
Error out if lockfile is out of date.
--lock
Check the specified lock file. (If value is not provided, defaults to "./ende.lock").
--no-lock
Disable auto discovery of the lock file.