Skip to main content
Version: DAI 7.5

Running the Agent in Command Line Mode (DAI Run Agent)

You can configure and run the DAI Run Agent from the command line, without the user interface.

  1. From the command prompt, navigate to the agent directory. For example:

    • For Windows: C:\Program Files (x86)\eggplantDAIRunAgent\
    • For Mac: /Applications
    • For Linux: (The path in which your eggplantDAIRunAgent executable is extracted to)
  2. Run the agent executable, and add the appropriate arguments:

    • For Windows: eggplantDAIRunAgent.exe [arguments]
    • For Mac: ./eggplantDAIRunAgent [arguments]
    • For Linux: ./eggplantDAIRunAgent [arguments]

Simple example of Running the DAI Run Agent

If you provide the DAI Run Agent the path to the downloaded .ini file. (How to create a DAI Environment). In a bash shell terminal on a Mac Or Linux-based system, if EPF's GUI is not required, you can launch the DAI Run Agent with these arguments:

Mac/Linux:

./eggplantDAIRunAgent --ini-file "my envs/my_env.ini"

You must wrap the file path in quotes if it contains spaces.

Windows:

“C:\Program Files (x86)\eggplantDAIRunAgent\eggplantDAIRunAgent.exe” --ini-file "C:\Users\{user}\my_env.ini"

Using Command-Line Arguments

For a full list of command-line arguments, how to use them, and what they do, you can the launch the DAI Run Agent with the --help flag.

Windows:

"C:\Program Files (x86)\eggplantDAIRunAgent\eggplantDAIRunAgent.exe" --help

Mac/Linux:

./eggplantDAIRunAgent --help

Passing EPF Command Line Arguments with Run Agent Arguments

Note that along with your Run Agent command line options, you can specify run options for the EPF that your agent launches. To specify the EPF options, precede them with a double dash (--) in the Run Agent command line arguments. See Running from the Command Line and Runscript Command Line Options in the EPF documentation for more information.

note

You can pass EPF run options in the DAI Run Agent command with DAI versions 7.3 and later.

Examples of EPF arguments commonly passed with the Run Agent command are as follows:

ArgumentsEnvironment VariablesDescription
-licenser-host TEXTAn Eggplant Functional (EPF) argument to specify the Licenser Host.
-licenser-password TEXTAn EPF argument the Licenser password.

Simple Example of Running the DAI Run Agent with EPF Command Line Arguments

"C:\Program Files (x86)\eggplantDAIRunAgent\eggplantDAIRunAgent.exe"  --ini-file C:\my_ini.ini -- -LicenserHost

Where the example EPF argument is the -LicenserHost argument preceded by the two dashes.

Table of Run Agent Command Line Arguments

The following is a list of the supported command-line arguments and their corresponding environment variables.

ArgumentsEnvironment VariablesDescription
--ini-file FILEDAI_AGENT_INI_FILEThe location of the environment settings (.ini) file downloaded from the DAI server. The (.ini) file is only created during loading of the downloaded ini file.

Default:
Windows: C:\Users\{user}\.eggplantDAI.ini (It is marked as hidden.)
Mac: ~/.eggplantDAI.ini
Linux: ~/.eggplantDAI.ini
--host-url TEXTDAI_HOST_URLThe Eggplant DAI server that you connect to, e.g. https://server.company.com. This maps to host_url in your environment settings (.ini) file.
Use this parameter in conjunction with --env-id to select the appropriate section of the environment settings (.ini) file.
If not specified, uses the first section in the .ini file.
--env-id INTEGERDAI_EXEC_ENV_IDThe ID of the execution environment on the DAI server.
Use this parameter in conjunction with --host-url to select the appropriate section of the environment settings (.ini) file.
If not specified, uses the first section in the .ini file.
--suite-root DIRECTORYEGGDRIVE_SUITE_ROOTThe folder used to store downloaded suites.
Eggplant Functional (EPF) suites will be uploaded and downloaded as subfolders of the specified root folder.

Default:
Windows: C:\ProgramData\Eggplant\agent\Suites
Mac: ~/Library/Application Support/agent/suites
Linux: ~/.local/share/agent/suites
--gui [True|False]Specifies whether or not to display the Eggplant Functional UI.

Default: False
--drive-port INTEGEREGGDRIVE_PORTThe port Eggplant Functional will use to listen for eggDrive commands.
If not specified, it will use a randomly assigned free port.
--log-level [INFO|DEBUG|WARNING|ERROR|TRACE]The logging level.

INFO: logs basic messages indicating the Run Agent is operating as expected.
DEBUG: logs detailed messages typically used for diagnosing problems.
WARNING: logs unexpected events or potential problems. This level includes the messages logged at level ERROR.
ERROR: Logs errors that occurred preventing the Run Agent from functioning properly.
TRACE: logs all log-level messages.

Default: INFO
--log-folder DIRECTORYDAI_AGENT_LOG_FOLDERThe folder used to store log files.

Default:
Windows: C:\ProgramData\Eggplant\agent\logs
Mac: ~/Library/Logs/agent
Linux: ~/.cache/agent/log
--win-service [INSTALL|START|STOP|REMOVE|RESTART]For management of DAI Run Agents that you want to run, or already configured to run, as a Windows service. Specify the appropriate option to control the Windows service. Use this parameter with the --service-name parameter to specify the Run Agent Windows service's display name. See Running the Agent as a Windows Service for more information. [Default service name (when you install a service but do not specify a service name): DAI Run Agent]
--service-name TEXTThe display name of the installed DAI Run Agent Windows service. Use this parameter with the --win-service parameter to specify a Run Agent's Windows service display name. [Default: DAI Run Agent]
--service-desc TEXTThe description of a DAI Run Agent Windows service. Use this parameter with the --win-service parameter to set the service description. [Default: Eggplant DAI Agent]
--versionShow the version
--helpShow the help message and exit.

Other Examples for the DAI Run Agent

Following are examples of how to run the DAI Run Agent on different operating systems with more verbose, but optional, arguments. The previous table lists all available arguments for the DAI Run Agent. In case your .ini file contains more than one environment section you must provide --host-url and --env-id.

Windows:

“C:\Program Files (x86)\eggplantDAIRunAgent\eggplantDAIRunAgent.exe” --ini-file "C:\Users\{user}\my_env.ini" --log-level INFO --drive-port 5401
“C:\Program Files (x86)\eggplantDAIRunAgent\eggplantDAIRunAgent.exe” --ini-file "C:\Users\{user}\my_env.ini" --host-url https://server.company.com --env-id 1

Mac/Linux:

./eggplantDAIRunAgent --ini-file envs/my_env.ini --log-level INFO --drive-port 5401
./eggplantDAIRunAgent --ini-file envs/my_env.ini --host-url https://server.company.com --env-id 1

Eggplant Functional Stop and Restart Settings for Test Configuration Runs

When running a test configuration, you can configure the length of time to run Eggplant Functional (EPF) before restarting or the grace periods for poll-time stopping and restarting with the following environment variables. See Eggplant Functional Stop and Restart Settings for Test Configuration Runs for details.

Environment VariablesDefaultDescription
RESTART_EPF_AFTER_SECONDS1800When running a test configuration, you can configure the interval in seconds that EPF runs before restarting. This variable takes effect after the current step finishes and before moving to the next step if the defined time is exceeded. It only applies to test configurations run with the DAI Run Agent. During live runs, EPF runs continuously without restarting. If you do not want EPF to restart during your test runs, you can disable this option by setting it to 0 (zero).
EPF_QUIT_POLL_TIME_SECONDS20The grace period for EPF to quit during the restart process.
EPF_RESTART_POLL_TIME_SECONDS120The grace period for EPF to start up after having quit. EPF_RESTART_POLL_TIME_SECONDS does not include EPF_QUIT_POLL_TIME_SECONDS.