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.
1 The package is not in the resolved tree.
2 A usage error: no package was given, or it has an npm: prefix (Ende 2026.12.01+).

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

Output for scripts

--plain prints one dependency path per line, with no color: the package (jsr:<name>@<version>), a tab, then the path to it from a direct dependency (Ende 2026.12.01+):

$ ende why --plain @std/encoding
jsr:@std/[email protected]	jsr:@oak/[email protected] > jsr:@oak/[email protected] > jsr:@std/[email protected]
jsr:@std/[email protected]	jsr:@oak/[email protected] > jsr:@std/[email protected] > jsr:@std/[email protected]
jsr:@std/[email protected]	jsr:@oak/[email protected] > jsr:@oak/[email protected] > jsr:@std/[email protected] > jsr:@std/[email protected]

--json prints the same paths as one JSON document with a version field (Ende 2026.12.01+). Each entry of packages is a version of the package you asked about, with its kind, name and resolved version, and:

  • specifiers: when it's a direct dependency, the specifiers that resolve to it, as the lockfile records them (jsr:@oak/oak@17); otherwise empty;
  • paths: each path to it, with the specifier of the direct dependency it starts from and the packages along it, each with kind, name and resolved;
  • truncated: true when Ende stopped looking after 15 paths for that version.

Common pitfalls

  • "Package not found" but you know it's used at runtime. ende why reports what's in the lockfile, not what's imported by your code. If you've added a jsr: specifier but haven't run ende 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 why from the workspace root for the complete picture.

Command line usage:

why

Show 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.

--json

Print the dependency paths as versioned JSON on stdout.

--lock

Check the specified lock file. (If value is not provided, defaults to "./ende.lock").

--no-lock

Disable auto discovery of the lock file.

--plain

Print one dependency path per line, with no colour: the package (jsr:<name>@<version>), a tab, then the path to it from a direct dependency.