Command Line Reference Server
Every option of the lic command line, grouped as in the output of lic —help.
lic <assembly|licensefile> [<other assemblies>...] [options]The first argument is either the assembly the license is for, from which lic records the assembly name, version, culture and public key token in the license, or an existing license file, XML or string, to update or verify. Further assemblies add their identity to the license as well. Mandatory arguments are shown between angle brackets, optional ones between square brackets; a --[no] prefix marks a switch that can be negated.
Options can be abbreviated to their shortest unambiguous prefix, so --comp selects --component, and several have an alias, shown in parentheses in the headings below. Key-value options such as --licensee and --trial are repeated once per pair. Dates accept any date-time string the current culture parses, and ISO 8601 (2027-09-01) always works.
Run lic --help <option> for the extended description of one option, or lic --help --format json for the whole option set as a machine-readable document; see AI-Friendly Mode.
Miscellaneous
—help [option] (-h, -?)
Displays the usage message with every option and a short description. With an option name, displays the extended description of that option. Combined with --format json or ndjson, emits the option schema as JSON.
lic --help
lic --help sign
lic --help --format json—[no]logo
Displays or suppresses the copyright banner at startup. The banner is on by default and is always suppressed in json and ndjson output mode.
—license [path]
With no argument, displays the license lic is running with and exits. With an argument, tells the tool where its own license is: the path of a license file, a folder to search for babel.licenses, or env:VARIABLE to read a license key from an environment variable. The option can be repeated. Without it, the tool looks for babel.licenses next to its executable and then in the path named by BABEL_LICENSE_PATH.
lic --license
lic MyApp.dll --license /opt/babel/babel.licenses ...
lic MyApp.dll --license env:BABEL_LICENSE ...—verbose <n> (-v)
Sets the console verbosity. 0 prints nothing, 1 (default) prints the normal messages, and a value above 10 adds debug output, including a dump of every input variable.
—version
Displays the assembly, product and file version and exits. With --format json, emits the version, runtime and platform as JSON.
—noconfig
Skips the default option values stored in the tool’s configuration file (lic.exe.config).
—format <name> (—fmt)
CLI output formats available since 11.8.
Selects either the license output format or the command line output format. The two value sets are disjoint, so one option covers both, and the two can appear in the same command line.
| Value | Meaning |
|---|---|
xml | Default. An XML license file (.licenses), the format the Babel.Licensing client validates from a file. |
serial | A string license in the default string encoding, suitable for a serial number the user types. |
base32 | A string license encoded in Base32 (uppercase letters and digits). |
ascii | A string license encoded in readable ASCII, the most compact of the string formats. |
text | Command line output: the default human-readable console output. |
json | Command line output: one JSON document on standard output, conforming to lic.cli.v1. |
ndjson | Command line output: newline-delimited JSON, one event per line, streamed as produced. |
String licenses are written to the --output file as a single line of text. They carry the same content as the XML form and validate the same way, through StringLicense in the client library.
lic MyApp.dll --keyfile ecdsa.pem --sign --format serial --output MyApp.serial
lic MyApp.dll --keyfile keys.pem --sign --format json --quiet --strict-exit
lic MyApp.dll --keyfile ecdsa.pem --sign --format base32 --format ndjson—keygen [type] (—kg)
Generates a new key pair and writes it in PEM format to the file named by --keyfile. The type is rsa (default) or ecdsa. Use --keysize to choose the strength; the private key in the file signs licenses and must be kept secret, while --publickey extracts the public half for the application.
lic --keygen rsa --keysize 2048 --keyfile keys.pem
lic --keygen ecdsa --keysize 256 --keyfile ecdsa.pemRSA keys sign XML licenses with the rsa or dsig algorithm; ECDSA keys produce the shortest string licenses and are the usual choice for serials.
—keysize <size> (—ks)
Sets the key size for --keygen. RSA accepts sizes from 384 to 4096 bits; ECDSA accepts 112, 192, 256, 384 or 521 bits. A larger ECDSA key produces a longer serial.
—[no]keyinfo
Whether to include the public key information in the RSA signature element of an XML license. It can be omitted when the licensed assembly has a strong name, because the client extracts the RSA public key from the strong name to validate the license.
—publickey (—pk)
Prints the public key of the key pair given with --keyfile, for RSA, ECDSA and XML digital signature keys. Embed this value in the application, which uses it to validate licenses.
lic --publickey --keyfile keys.pem—[no]xmldeclaration
Whether to write the XML declaration at the top of an XML license file. On by default.
—encoding <name>
Sets the character encoding of the XML license file, by encoding name (utf-8, utf-16, us-ascii, and any other encoding registered on the machine). By default the file is written in UTF-16 with a byte-order mark; pass utf-8 for a file that is easier to inspect and to embed.
—showhardwareinfo (—show-hardware-info)
Prints the information the hardware key is computed from on the current machine: system name, UUID, manufacturer, product name, BIOS and motherboard serial numbers, operating system, memory, whether a virtual machine is detected, and the CPU identity. Useful for support cases where a hardware-locked license does not validate.
—hardwareid <component> (—hardware-id, —hwid)
Computes the hardware key of the current machine and prints it as HardwareKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX. The optional list of components selects what the key is derived from: cpu, ethernet (MAC address), disk (serial number), motherboard, bios, computername (default) or all. The key is what you pass to --hardware key= when issuing a hardware-locked license, and what the application computes with the same components at validation time.
lic --hardwareid cpu,disk,computername—salt [hex string|size] (-s)
Adds random data to the hardware key computation, so that two products locked to the same machine do not share the same key. Pass a hexadecimal string to use a fixed salt, or a size to generate one; the generated salt is printed as Salt= and must be used again at validation time.
—register <assembly>
Loads an extension assembly before processing. An extension can provide custom restriction types for --restriction, custom signature providers for --sign, and services such as an alternative hardware identification. The option can be repeated.
—[no]quiet (-q)
Available since 11.8.
Suppresses the copyright banner and every interactive prompt, so the command never blocks waiting for input: a missing --keypwd fails with an explicit error instead of asking for the password. Intended for CI pipelines and unattended runs. See AI-Friendly Mode.
—[no]strict-exit
Available since 11.8.
Returns a semantic exit code instead of the default 0 for success and 1 for any failure: 10 invalid arguments, 20 input file not found, 30 license processing failure, 40 licensing failure, 50 key or signing failure. The codes match the obfuscator’s. See AI-Friendly Mode.
License
—id [licid]
Sets the license identifier. Without an argument a new identifier is generated. The identifier is what --update and --verify use to address one license inside a file that holds several.
—type <type>
Sets the license type, a free text such as Standard, Professional or Trial that the application can read to select an edition.
—sites <number>
Sets the number of sites, or seats, the license covers.
—issuedate [date]
Sets the issue date. Without an argument, the current date and time is used.
—expiredate <date>
Sets the expiration date, either as a date-time string or as a number of days from today.
lic MyApp.dll --expiredate 2027-09-01 ...
lic MyApp.dll --expiredate 365 ...—supportexpiredate <date>
Sets the date on which product support expires, independently from the license itself.
—[no]assembly <file|name> (—asm, —no-asm)
Adds the identity of another assembly to the license, from a file or from an assembly name; the option can be repeated and accepts wildcards. --noassembly removes all assembly information, which produces a license that is not tied to a specific assembly.
lic MyApp.dll --assembly "MyApp.Core, Version=2.1.0.0" ...
lic MyApp.dll --assembly "*, Version=" ...
lic MyApp.dll --noassembly ...—licensee <key=value>
Sets the licensee information, one pair per option: id, name, company and email.
lic MyApp.dll --licensee id=C-1001 --licensee name="Contoso" --licensee company="Contoso Ltd" --licensee email=info@contoso.com ...—product <key=value>
Sets the product information, one pair per option: id, name, version, copy (copyright notice), descr (description) and url.
lic MyApp.dll --product id=MYAPP --product name="MyApp" --product version=2.1 --product url=https://contoso.example ...—component <name>
Adds a licensed component, for products that license individual components or modules of an assembly. The option can be repeated.
—feature <file|key=value>
Adds or updates a license feature, the switches the application checks to enable parts of the product. With key=value, the feature takes the key as its name and the value as its data. With a file path or wildcard, each file becomes a feature named after the file, with the file content as data. With def=file, an external XML file supplies the complete feature definition, including expiration dates and description.
lic MyApp.dll --feature Pro=1 --feature Export=csv,xlsx ...
lic MyApp.dll --feature "features/*.txt" ...
lic MyApp.dll --feature def=features.xml ...—field <file|key=value>
Adds or updates a license field, a named value the application reads: seat counts, configuration, a code encryption password, and so on. The same three forms as --feature apply: key=value, a file whose name and content become the field, or def=file for an XML definition.
lic MyApp.dll --field Seats=25 --field Region=EU ...—sign [type]
Signs the license with the key pair given by --keyfile or --keyname. The optional type selects the algorithm: rsa (default with an RSA key), ecdsa (with an ECDSA key) or dsig, the XML digital signature standard, with an RSA key. The algorithm must match the key: an RSA key cannot produce an ECDSA signature and vice versa.
lic MyApp.dll --keyfile keys.pem --sign ...
lic MyApp.dll --keyfile keys.pem --sign dsig ...
lic MyApp.dll --keyfile ecdsa.pem --sign ecdsa --format serial ...Without --sign the license is written without a signature, and the client library rejects it. --keyfile alone only makes the key available; it does not sign.
—[no]verify (—validate)
Verifies the signature of the input license file with the key given by --keyfile or --keyname; only the public key is needed. The tool reports verified successfully or is not valid, and with --strict-exit a failed verification exits with code 30.
lic MyApp.licenses --verify --keyfile keys.pem—update [licid|all]
Updates a license inside the input license file instead of creating a new one: every license switch on the command line replaces the corresponding value, and the file is written back. Without an argument the first license in the file is updated; pass a license identifier to address one license, or all to update every license in the file. Pass --sign again to re-sign the modified license.
lic MyApp.licenses --update --keyfile keys.pem --sign --licensee company="Contoso Ltd" --field Seats=50License Restrictions
Each restriction option takes key=value pairs, one per option, and can be repeated. Every restriction accepts id=<id> to set its identifier and expire=<date> to give it an expiration date of its own. See License Restrictions for how the client library evaluates each one.
—trial <key=value>
Adds or updates a trial restriction:
| Key | Meaning |
|---|---|
days=<n> | Number of days the software can be used after the first run. |
time=<timespan> | Total usage time allowed. |
instances=<n> | Number of instances that can run at the same time. |
terms=<text> | Terms and conditions text shown for the trial. |
lic MyApp.dll --trial days=30 --trial instances=2 ...—hardware <key=value>
Adds or updates a hardware restriction, locking the license to a machine: key=<key> is the hardware key computed with --hardwareid on the target machine, and data=<data> embeds additional hardware data.
lic MyApp.dll --hardware key=GPHI6-128DI-6196C-KN5LV-BCDRE ...—domain <key=value>
Adds or updates a domain restriction: name=<name> is the network domain the machine must belong to, and role=<role> the network role.
—usage <key=value>
Adds or updates a usage restriction: type=<context> limits the license to the Runtime or Designtime context, vm=<true|false> allows or forbids running in a virtual machine, and processlist=<list> names the processes allowed to use the license.
lic MyApp.dll --usage processlist=proc1,proc2,proc3 --usage vm=false ...—beta <key=value>
Adds or updates a beta restriction, for pre-release builds: build=<text> sets the beta build type and changes=<text> describes the recent changes.
—restriction <name:key=value>
Adds or updates a custom restriction, identified by its name, with the given key-value pairs. The restriction type must be provided by an extension assembly registered with --register; without one the tool reports that no license factory is set.
lic MyApp.dll --register Contoso.Licensing.dll --restriction "Region:name=EU" ...Output Files
—output <file> (—out)
Sets the output file. By default the license is saved next to the input file as <assembly file>.licenses.
—logfile [file] (—log)
Redirects the console output to a log file. Without an argument the log is named after the output file with a .log extension.
—makeproject [file] (—mp)
Saves the whole command line as an MSBuild project file that runs the Lic task with the same settings. Without an argument the project is named after the output file with an .lcproj extension. The license is generated as well. See MSBuild Task.
Input Files
—keyfile <file> (—kf)
The key file used to sign or verify the license. Supported formats are PEM (as written by --keygen), SNK strong-name key files and PFX certificates; a PFX file usually needs --keypwd.
—keyname <container> (—kn)
Signs or verifies with a key pair stored in a key container of the operating system, given by container name, instead of a file.
—keypwd <password> (—kp)
The password of a PFX key file. Without it the tool prompts for the password; with --quiet it fails instead of prompting. On a build server, keep the password in an environment variable and expand it on the command line.
—project <file> (—prj)
Runs lic with the settings stored in an .lcproj project file, as produced by --makeproject or written by hand. Switches on the command line are applied on top of the project settings.
Long and Short Options
Long options are introduced by two hyphens, short options and single-letter aliases by one: --verbose 2 and -v 2 are equivalent, as are --keyfile and --kf. A long option can be abbreviated to any prefix that is not ambiguous. Switches marked --[no] are turned off with the no or no- prefix, so --nologo, --no-logo and --noassembly are all valid.
Exit Codes
By default the process returns 0 on success and 1 on any failure. With --strict-exit the failure class is returned instead; the same class is always reported as exitReason in the JSON output, with or without --strict-exit.
| Exit code | exitReason | Meaning |
|---|---|---|
0 | success | The command completed without errors. |
10 | invalidArguments | The command line could not be parsed or contained an invalid value. |
20 | inputNotFound | The assembly, license file or another required input was not found. |
30 | processingFailure | License processing failed, including a signature that did not verify. |
40 | licensingFailure | The tool’s own license is missing, invalid or expired. |
50 | keyOrSigningFailure | A key could not be loaded or a cryptographic operation failed. |