Skip to main content
Version: 1.3.0

CLI

The generate-license-file CLI will resolve all of the licenses of your third-party dependencies and write them to a file on the disk.

--input​

Type: stringIs required: trueAlias: -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

--output​

Type: stringIs required: trueAlias: -o

The output parameter is required and needs be a path to 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: booleanIs 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: stringIs 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

--no-spinner​

Type: booleanIs 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.

npx generate-license-file --no-spinner