headless

The headless parameter is a Boolean value that allows you to force Liquibase to run without access to the console for input and output. By default, the value is false.

Uses

You can use the headless parameter when you run Liquibase in automation or with CI/CD tools. For example, you may need to skip the prompt for running the init project command in interactive mode. In this case, you can set the headless parameter to true to run commands without interaction.

If you run Liquibase in containers, the headless parameter will prevent Liquibase from trying to access the display, keyboard, or mouse.

Syntax

You can set this parameter in the following ways:

Option Syntax
Liquibase properties file
liquibase.headless: <true|false>
Global flow file argument (example)
stages:
  Default:
    actions:
      - type: liquibase
        command: update
        globalArgs: { headless: "<true|false>" }
Global CLI parameter
liquibase
 --headless=<true|false> update
 --changelog-file=example-changelog.xml

JVM system property (JAVA_OPTS Environment Variable)

JAVA_OPTS=-Dliquibase.headless=<true|false>
Liquibase Environment Variables
LIQUIBASE_HEADLESS=<true|false>

For more information, see Working with Command Parameters.