On this page

Qt License Server command-line interface

Qt License Server provides a command-line interface for various operations. For example, export usage logs, manage access control lists, and register licenses.

General usage

To use qt-license-server, enter the following command:

./qt-license-server <command> [options]
.\qt-license-server.exe <command> [options]

Help

To view an up-to-date list of commands, enter:

./qt-license-server --help
.\qt-license-server.exe --help

To view the options of a command, enter:

./qt-license-server help <command>
.\qt-license-server.exe help <command>

For example, to see the options you have for exporting reports, enter:

./qt-license-server help export
.\qt-license-server.exe help export

Version

To view the version number of the Qt License Server running at the specified URL, enter:

./qt-license-server version --url <URL>
.\qt-license-server.exe version --url <URL>

Omit --url to view the version of the qt-license-server executable itself.

Status

To check the status of the Qt License Server running at the specified URL, enter:

./qt-license-server status --url <URL>
.\qt-license-server.exe status --url <URL>

To check the license usage of a specific user, add --userId:

./qt-license-server status --url <URL> --userId <userId>
.\qt-license-server.exe status --url <URL> --userId <userId>

Generate server hardware fingerprint

Generate a hardware fingerprint for the current machine. An offline license generated with the hardware fingerprint works only on that machine.

Note: This command is only relevant for Offline Qt License Server. On-Prem Qt License Server and Cloud Qt License Server don't use hardware fingerprints. For more information, see Manage license node-locking.

./qt-license-server generate-server-fingerprint
.\qt-license-server.exe generate-server-fingerprint

Add --verbose to also print additional hardware information logs.

Set ACL

Set the Access Control List (ACL) to use, from a JSON file.

./qt-license-server set-acl --url <URL> --from-json <filePath>
.\qt-license-server.exe set-acl --url <URL> --from-json <filePath>

Omit --from-json to use acl.json in the current directory. For more information, see Manage ACLs for On-Prem Qt License Server or Offline Qt License Server.

List ACL

List the current ACL contents.

./qt-license-server list-acl --url <URL> --license <licenseNumber>
.\qt-license-server.exe list-acl --url <URL> --license <licenseNumber>

Omit --license to list the ACLs of all licenses. For more information, see Manage ACLs for On-Prem Qt License Server or Offline Qt License Server.

Check ACL type

Check whether the ACL of a license is of type allowed or denied.

./qt-license-server check-acl-type --url <URL> --license <licenseNumber>
.\qt-license-server.exe check-acl-type --url <URL> --license <licenseNumber>

For more information, see Manage ACLs for On-Prem Qt License Server or Offline Qt License Server.

List long-term users in ACL

List the users who have long-term access to a license.

./qt-license-server list-long-term-users --url <URL> --license <licenseNumber>
.\qt-license-server.exe list-long-term-users --url <URL> --license <licenseNumber>

Omit --license to list the long-term users of all licenses. For more information, see Manage long-term records in ACLs for On-Prem Qt License Server or Offline Qt License Server.

Release a long-term reservation early

Release or shorten a long-term reservation before it expires. Identify the reservation by its reservation ID or by the user ID it's reserved for.

./qt-license-server release-long-term-reservation --url <URL> --reservationId <id>
.\qt-license-server.exe release-long-term-reservation --url <URL> --reservationId <id>

Alternatively, use --userId <userId> instead of --reservationId to release the reservation by the user it belongs to. Active reservations reports contain reservation IDs.

Export license report

Export reports on license usage in comma-separated values (CSV) (.csv) or spreadsheet (.xlsx) format, to see how users are using licenses during the time you specify.

Note: This command is only relevant for Offline Qt License Server.

Export a report for a specific license

./qt-license-server export --url <URL> --fileName <fileName> --filePath <filePath> --licenseNumber <licenseNumber>
.\qt-license-server.exe export --url <URL> --fileName <fileName> --filePath <filePath> --licenseNumber <licenseNumber>

Export a report for a specific time frame

./qt-license-server export --url <URL> --fileName <fileName> --filePath <filePath> --startDate <YYYY-MM-DD> --endDate <YYYY-MM-DD>
.\qt-license-server.exe export --url <URL> --fileName <fileName> --filePath <filePath> --startDate <YYYY-MM-DD> --endDate <YYYY-MM-DD>

Export a report in a specific file format

./qt-license-server export --url <URL> --fileName <fileName> --filePath <filePath> --extension csv
.\qt-license-server.exe export --url <URL> --fileName <fileName> --filePath <filePath> --extension csv

Options for the export command

The following table describes the available options for the export command in more detail. --fileName and --url are always required.

OptionPossible valuesDescription
--url, -uURLURL of the running Qt License Server instance. Required.
--fileName, -fFile nameFile name of the report. Required.
--filePath, -pFile pathPath to the directory where the report is exported. Optional; defaults to the directory that contains the qt-license-server executable.
--extension, -e
  • csv
  • xlsx
File format to export the report as. Optional; default: xlsx.
--recordType, -r
  • reservations
  • logs
  • statistics
  • usage
Record type to export. Optional; omit to export all record types.
--licenseNumber, -lLicense number from QtExport data for this license number only. Optional; omit to export data for all licenses.
--startDate, -sdYYYY-MM-DDStart date for the report. Optional; the exact meaning depends on --recordType. Omit to export from the earliest record.
--endDate, -edYYYY-MM-DDEnd date for the report. Optional; the exact meaning depends on --recordType. Omit to export up to today.

Offload license usage data

Offload logs, usage data, and statistics from the database to the data_offload directory, freeing up database space. The offloaded data is stored in CSV format and removed from the database.

Note: This command is only relevant for Offline Qt License Server. With On-Prem Qt License Server, see Save reports locally.

./qt-license-server data-offload --url <URL> --filePath <filePath>
.\qt-license-server.exe data-offload --url <URL> --filePath <filePath>

Omit --filePath to use the configured or default data_offload directory. For more information, see Offload logs, usage data, and statistics.

Register licenses

Register the specified licenses for the instance, using your Qt Account credentials.

Note: This command is only relevant for On-Prem Qt License Server.

./qt-license-server register --url <URL> --email <email> --password <password> --licenses <licenseNumber1> <licenseNumber2>
.\qt-license-server.exe register --url <URL> --email <email> --password <password> --licenses <licenseNumber1> <licenseNumber2>

Omit --licenses to register all applicable licenses in the given Qt Account. Instead of --email and --password, you can set the QLS_QT_ACCOUNT_LOGIN_EMAIL and QLS_QT_ACCOUNT_LOGIN_PASSWORD environment variables. Add --force to skip confirmation prompts. For more information, see Register licenses.

Deregister licenses

Deregister all licenses from the instance, using your Qt Account credentials.

Note: This command is only relevant for On-Prem Qt License Server.

./qt-license-server deregister --url <URL> --email <email> --password <password>
.\qt-license-server.exe deregister --url <URL> --email <email> --password <password>

Instead of --email and --password, you can set the QLS_QT_ACCOUNT_LOGIN_EMAIL and QLS_QT_ACCOUNT_LOGIN_PASSWORD environment variables. Add --force to skip confirmation prompts. For more information, see Deregister licenses.

Enable email notifications

Enable email notifications about expiring licenses and connection issues, sent over an SMTP server.

Note: This command is only relevant for On-Prem Qt License Server.

./qt-license-server enable-email-notification --url <URL> --password <password>
.\qt-license-server.exe enable-email-notification --url <URL> --password <password>

--password is the password of the SMTP server admin account. Instead of providing it directly, you can set the QLS_SMTP_ACCOUNT_PASSWORD environment variable. For more information, see Enable email notifications.

See also Offline Qt License Server: Export reports, On-Prem Qt License Server: Save reports locally, Register licenses, Deregister licenses, and Qt License Server configuration.

© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.