A tool to help you verify that your dependencies comply with your license policies.
Check the docs for more information.
Licensebat
is a CLI that you can use for free to verify that the dependencies of your project follow your license policies.
Let's say, for instance, that you are building a commercial application. In that case, you may consider avoiding the use of some software with a restrictive license like GPL
.
By using Licensebat
, you can check you don't have any dependency with such a restrictive license. Normally, it will look in all the the dependency tree of your project, so transient dependencies will also be considered.
Feel free to use the CLI
in your CI/CD pipeline, or in your continuous integration server.
Important:
licensebat-cli
is still in development so you may use it at your own risk.
Aside from the CLI
, Licensebat
can be used directly in your GitHub repositories by installing this GitHub App.
Just run this:
bash
licensebat --dependency-file ./Cargo.lock
That will set all in motion. Take into account that you'll need to have access to the internet for the cli to work properly.
You can have more information about the CLI
by running licensebat --help
.
txt
USAGE:
licensebat [OPTIONS] --dependency-file <dependency-file>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-d, --dependency-file <dependency-file> Path to the file containing the dependencies of the project. i.e.
package-lock.json for npm projects, yarn.lock for yarn projects, etc
-l, --licrc-file <licrc-file> Path to the .licrc file [default: .licrc]
But before running, you have to be sure you have a .licrc
file available in your project.
You can get a copy from this gist. It's a TOML
file with configuration about which are the accepted or denied licenses, ignored dependencies or whether to block or not the PR (exit code == 1) in case it finds invalid dependencies.
```toml [licenses]
accepted = ["MIT", "MSC", "BSD"]
[dependencies]
ignored=["ignoreddep1", "ignoreddep2"]
[behavior]
donotblock_pr = false ```
Licensebat
uses tracing
. You can get logs while running the CLI
by setting the RUST_LOG
environment variable.
bash
RUST_LOG=licensebat=info cargo run --dependency-file ./Cargo.lock