Skip to content

dep-license

Show the license for a dependency bundled with Ritual.

Without a package name, opens an interactive list showing all bundled dependencies. Primary dependencies (direct entries in package.json) are listed first, followed by transitive dependencies. Type to search and filter across both sections.

Terminal window
./ritual dep-license [package] [options]
ArgumentDescription
[package]Name of the package to display the license for
OptionDescriptionDefault
--listList every bundled dependency with its version and licensefalse
--plainOutput license text directly to stdoutfalse
--output <format>Output format for --list: text, json, or ndjsontext

The listing (or a package’s license text) is the command’s entire output, so there is no --quiet (shared convention).

--list cannot be combined with a package name argument. It never prompts, so it also works outside a TTY — without either a package name or --list, an invocation that cannot open the picker is a usage error (exit 2). That covers a non-TTY stdout and every case where prompts are unavailable, including --no-input.

A license printed for a named package is paged the same way license is: less only when both ends are a terminal and prompts are available, plain stdout otherwise.

Open the interactive dependency picker:

Terminal window
./ritual dep-license

View a specific package license directly:

Terminal window
./ritual dep-license commander

View a scoped package license:

Terminal window
./ritual dep-license prompts

Print a license to stdout:

Terminal window
./ritual dep-license prompts --plain

List every dependency (primary first, then transitive) as name version license lines:

Terminal window
./ritual dep-license --list
Primary:
commander 15.0.0 MIT
prompts 2.4.2 MIT
Transitive:
kleur 3.0.3 MIT

--list --output json emits one { name, version, license, isPrimary } object per dependency (ndjson emits the same rows one object per line). The payload deliberately excludes the full license text — it is large; run ./ritual dep-license <package> to see a package’s complete license text.

Terminal window
./ritual dep-license --list --output json
[
{ "name": "commander", "version": "15.0.0", "license": "MIT", "isPrimary": true },
{ "name": "kleur", "version": "3.0.3", "license": "MIT", "isPrimary": false }
]
CodeMeaning
0Success
2Usage error (no package name and no --list when prompts are unavailable or stdout is not a TTY, or both given)
3Package not found