On this page

Configuration files

License Wizard can remember your license choice so later runs start from a known default and verification has something to check against. Configuration is read from one of two places, in order of precedence:

  • .licensewizardrc.json in the project root.
  • The license-wizard field of package.json — the fallback when no rc file is present.

The saved config holds the license id, any copyright field values, and — when you opted into source-file headers — the header style, which is what tells --verify to check that surface:

{
  "licenseId": "Apache-2.0",
  "tokens": {
    "[yyyy]": "2026",
    "[name of copyright owner]": "Erdem Bircan"
  },
  "headers": { "style": "full" }
}

Saving is opt-in. In the wizard, choose to remember your selection; in a script, pass exactly one --save-* flag — --save-rc, --save-npm, or --save-composer. Saving writes to one location and clears the configuration from the others, so there's only ever one source of truth.

Tokens must match the license

The keys under tokens are the license's own copyright fields, written as bracket tokens: [yyyy] for Apache-2.0, <yyyy> for GPL-2.0-or-later, <year> for MIT. --get-tokens lists the same fields by label — yyyy and name of author for GPL-2.0-or-later — but labels are only for --set; the saved config always uses the bracket form. A field that only a full header uses is still a valid key.

Those fields belong to one license, and SPDX can rename them between releases: SPDX License List 3.29.0 replaced ISC's <copyright notice> with <YEAR> and <OWNER>. A saved token that isn't one of the license's fields can't be filled in anywhere, so License Wizard treats it as a configuration error rather than writing placeholders like <YEAR> into your files. --verify (with or without --strict), --apply-config (even under --dry-run), and --force-header (when headers are enabled) name the unrecognized tokens, list the fields the license accepts, and exit non-zero without checking or writing anything.

The usual cause is changing licenseId by hand and keeping the old tokens. To fix it, edit tokens to use the fields the error lists, or run the wizard again and save your choice.