| Crates.io | licenses |
| lib.rs | licenses |
| version | 0.2.0 |
| created_at | 2025-07-25 13:46:08.893766+00 |
| updated_at | 2025-09-06 18:08:14.516155+00 |
| description | Cargo subcommand for collecting licenses. |
| homepage | |
| repository | https://github.com/lhalf/licenses |
| max_upload_size | |
| id | 1767627 |
| size | 65,732 |
Cargo subcommand for collecting, summarising and checking licenses.
$ cargo install licenses
$ cargo licenses --help
Usage: cargo licenses [OPTIONS] <COMMAND>
Commands:
collect Collects all licenses into a folder
summary Provides a summary of all licenses
Options:
-d, --dev Include dev dependencies [default: excluded]
-b, --build Include build dependencies [default: excluded]
-D, --depth <DEPTH> The depth of dependencies to include [default: all sub dependencies]
-e, --exclude <WORKSPACE> Exclude specified workspace [default: all included]
-i, --ignore <CRATE> Ignore specified crate [default: all included]
-h, --help Print help
Collects all licenses for the specified dependencies. Will alert the following license discrepancies:
$ cargo licenses collect --depth 1
licenses
├── anyhow-LICENSE-APACHE
├── anyhow-LICENSE-MIT
├── cargo_metadata-LICENSE-MIT
├── clap-LICENSE-APACHE
├── clap-LICENSE-MIT
├── colored-LICENSE
├── itertools-LICENSE-APACHE
├── itertools-LICENSE-MIT
├── once_cell-LICENSE-APACHE
├── once_cell-LICENSE-MIT
├── serde-LICENSE-APACHE
├── serde-LICENSE-MIT
├── serde_json-LICENSE-APACHE
├── serde_json-LICENSE-MIT
├── spdx-LICENSE-APACHE
├── spdx-LICENSE-MIT
└── strsim-LICENSE
Summarises the declared licenses for the specified dependencies.
$ cargo licenses summary --depth 1 MIT: cargo_metadata,strsim MIT OR Apache-2.0: anyhow,clap,itertools,once_cell,serde,serde_json,spdx MPL-2.0: colored
$ cargo licenses summary --depth 1 --json
{
"MIT OR Apache-2.0": [
"anyhow",
"clap",
"itertools",
"once_cell",
"serde",
"serde_json",
"spdx"
],
"MIT": [
"cargo_metadata",
"strsim"
],
"MPL-2.0": [
"colored"
]
}