I am wondering if there is any tool/script available which gives me the license of all my project dependencies. I know the license of the crates I directly use, but I need all licenses of the whole tree. So, the licenses of the dependencies of the dependencies of the dependencies ...
Is there anything like that available?
If you would like to list the licenses with only cargo itself, then you can approximate that with this command, which will have lots of duplicates but it will list out the package.license field of every package.
cargo tree --all-features --prefix=none --format='{l}'
If your end goal is to present license information for distribution, I use cargo-about for that. It includes the license text rather than just the metadata.