CLI
The generate-license-file
CLI will resolve all of the licenses of your third-party dependencies and write them to a file on disk.
Below outlines all of the CLI flags that you can give to change generate-license-file's behavior.
For more complex use cases, see the config file documentation for additional configuration options that can't be set using the CLI.
--input​
Type: string | Is required: true | Alias: -i |
The input parameter is required and needs be a path to the package.json
of the project. It can be a relative or absolute path.
npx generate-license-file --input ./myProject/package.json
npx generate-license-file --input C:/myProject/package.json
If the path contains a space, then wrap it in double-quotes.
npx generate-license-file --input "./my project/package.json"
You can also use the -i
alias.
npx generate-license-file -i ./myProject/package.json
This flag can be given multiple times to merge the licenses from multiple projects into a single output file.
npx generate-license-file --input ./package.json --input ../sibling-directory/package.json
--output​
Type: string | Is required: true | Alias: -o |
The output parameter is required and needs be a path to the desired output file. It can be a relative or absolute path.
npx generate-license-file --output ./third-party-licenses.txt
npx generate-license-file --output C:/third-party-licenses.txt
If the path contains a space, then wrap it in double-quotes.
npx generate-license-file --output "./my project/third-party-licenses.txt"
You can also use the -o
alias.
npx generate-license-file -o ./myProject/third-party-licenses.txt
--overwrite​
Type: boolean | Is required: false |
If a file already exists at the provided output path, then the CLI won't overwrite it by default.
If you'd like the CLI to overwrite existing files then provide the --overwrite
flag
npx generate-license-file --overwrite
--eol​
Type: string | Is required: false |
By default the CLI writes files to disk using the default line endings of the current machine.
If you want the output file to use a specific line ending then you can provide either lf
or crlf
with the --eol
flag.
npx generate-license-file --eol lf
npx generate-license-file --eol crlf
--ci​
Type: boolean | Is required: false |
When using the the CLI locally, it will prompt you for inputs if you forget to supply one that's required.
To stop the CLI from trying to show the prompts in a CI/CD environment (and instead error/fail-fast), you can provide the --ci
flag.
npx generate-license-file --ci
--no-spinner​
Type: boolean | Is required: false |
The CLI shows a spinner in the terminal while it's doing it's work.
If the spinner doesn't play nicely with your local or CI/CD environments then you can pass the --no-spinner
flag to make it only log standard text messages.
Using --ci
will implicitly set --no-spinner
.
npx generate-license-file --no-spinner
--version​
Type: boolean | Is required: false | Alias: -v |
Pass the --version
flag to the CLI to make it log out which version you have installed.
When this flag is given, the CLI will not do anything else, and no files will be generated.
You can also pass in the alias -v
.
npx generate-license-file --version
npx generate-license-file -v