CLI options

Command-line arguments and options

Reference for Korall Engineering™ command-line arguments and options: the options every application accepts, the options of Agent, Remote and HUB, and the options of the other applications.

Tip

For a test run, give the application its own data directory with --base-dir <path>. The run then has its own settings, keys and logs, and your own nodes stay as they are.


Overview

Agent, Remote, HUB, Zoo and the windowed applications share one list of options. Each application acts on the options that apply to it, and accepts the others. An option that takes a value accepts --name value and --name=value.

The applications do not all treat an option that they do not know in the same way:

  • Agent, Remote and HUB print Command line error: and the reason on standard error, and then start as usual.
  • Zoo, Paint, Auda, Bahn, Singularity and the Construct editor print the same line and Try --help for the list of options., and stop with exit code 1.

Common options

Options available for all Korall Engineering™ applications:

Help and version

Option Short Description
--help -h Print the list of options and exit with code 0
--version -v Print the program name and its version, such as agent 1.2.3, and exit with code 0. A development build prints the short commit hash in place of a version

Data and identity options

Option Short Argument Description
--base-dir -d PATH Use this data directory in place of the default. The application makes the directory if it does not exist. See Where your data lives
--user-data Use your own settings and data, as a release build does, not the folder of a debug build beside its program. --base-dir wins over it
--node-id NODE-IDENTITY-ID Activate this node identity at startup. Without it, the node uses the identity that was active last
--hive HIVE-ID Mount this hive at startup for SID authentication
--hive-passphrase PASSPHRASE The hive passphrase. Other users can read it in the process list, so prefer one of the next two options
--hive-passphrase-file PATH Read the hive passphrase from the first line of this file, with whitespace trimmed
--hive-passphrase-stdin Read the hive passphrase from the first line of standard input

When you give more than one passphrase option, --hive-passphrase-stdin wins, then --hive-passphrase-file, then --hive-passphrase.

Window and startup options

Option Short Argument Description
--head-less -e Run with no window, in an environment with no GUI
--fullscreen Show the main window full screen, for a kiosk or a dedicated display with no window manager
--activity -a ACTIVITY-NAME Start in the named activity. Agent, Remote and HUB
--open -f FILE-PATH Open a file in the current activity. Agent, Remote and HUB
--project -j PROJECT-NAME Name of the test project, for result tracking. Agent, Remote and HUB
--opal -x TASK Run an OPAL task at startup. The value is a task string, inline JSON or an @file reference. You can give the option more than once
--close-on-completion -c Quit when the activity or the --opal tasks report that the work is complete

Network options

Option Short Argument Description
--zoo-url URL The API address of the Zoo server. Overrides the setting zoo/url. Agent, Remote and HUB
--door Serve the Trove door of this user on this computer. With --head-less, the node is the standalone door host, which hands the door to a HUB that starts
--door-folder PATH Keep the Trove door in this folder, not in the folder of this user. A test uses it, so that its door never answers for yours
--local-port -p LOCAL-PORT The port that the Zoo listens on. The default is 8123. The other applications accept the option and do not use it
--local-host -l LOCAL-HOST Accepted. No application reads it
--remote-host -r REMOTE-HOST Accepted. No application reads it
--remote-port -o REMOTE-PORT Accepted. No application reads it

Logging options

Option Short Argument Description
--log-detail LEVEL Log detail for this run: normal or verbose. verbose logs every category, Qt's own too. Without the option, the setting Log detail chooses, for every run. Another value prints a warning and uses normal. See Collect useful logs
--log CATEGORIES Log verbosity per category, comma separated: category[:off|summary|full], such as session:full,scheduling:summary. Agent, Remote and HUB. See The categories
--log-color WHEN Color of the log on the terminal for this run: never, always or auto. auto, the default, colors a terminal that shows 24-bit color and nothing else. The option wins over NO_COLOR and CLICOLOR_FORCE. The log file never holds color. See Color on the terminal

System options

Option Argument Description
--opengl MODE The OpenGL implementation to ask Qt for: software, desktop or auto. The default is software on Windows and auto elsewhere. On Windows, any value other than software asks for the desktop driver
--audio-backend NAME Qt's audio backend on Linux: pulseaudio or pipewire. The default is pulseaudio, because the PipeWire device monitor of Qt 6.10 can crash at start

HUB-specific options

Options that only the HUB (fleet management) application acts on:

Option Argument Description
--join-file PATH Join the fleet that this bootstrap file names, with its one-time token. The HUB deletes the file when the join succeeds
--no-peer-demote Do not renice build-pipeline peers to SCHED_IDLE when the HUB cannot raise its own priority
--no-codec-probe Do not probe the video codecs at startup. Construct acts on it too

Other applications

Zoo

The Zoo has no window. It acts on --local-port, --base-dir, --head-less, --log-detail, --log-color and the help and version options.

Construct and the windowed applications

The Construct editor, Paint, Auda, Bahn and Singularity act on --base-dir, --user-data, --head-less, --fullscreen, --opal, --close-on-completion, the system options and the graphics and diagnostics options. Construct also has subcommands and export options of its own. See Construct CLI.


MockNode options

MockNode is the test application for node behaviour. It has two modes.

Node mode

With --personality, MockNode runs one test node. The node keeps its data in the directory of that personality, and MockNode makes the personality when it does not exist.

Option Argument Description
--personality NAME Run the node of this test personality
--type TYPE The node type of a new personality: agent, remote or hub. The default is agent

The node also accepts the common options.

Manager mode

Without --personality, MockNode opens the manager of test personalities and constellations.

Option Argument Description
--clean Remove all personalities and constellations
--create-node NAME Make a new personality
--type TYPE The node type for --create-node: agent, remote or hub. The default is agent
--create-constellation NAME Make a new constellation
--members NAMES Comma-separated personality names for --create-constellation
--launch NAME Launch the named constellation
--run-script SCRIPT Run a manager script, by path or by name from the scripts folder
--no-gui Do not show the manager window. Exit when the commands are done

Manager mode also accepts the global graphics and logging options, such as --rhi-backend and --log-color. Any other option stops it with an error and exit code 1.


Usage examples

Basic usage

# Start Agent with its own data directory
agent --base-dir /tmp/agent-test

# Start Agent with the identity of one node
agent --node-id <node-identity-id>

# Start Agent with verbose logging
agent --log-detail verbose

Network configuration

# Use another Zoo server
agent --zoo-url https://zoo.example.com/api

# Start the Zoo on another port
zoo --local-port 9000

Development and testing

# Run without a window
hub --head-less

# Start in one activity and quit when its task is complete
remote --activity <activity-name> --close-on-completion

# More log detail for two categories
agent --log session:full,scheduling:summary

MockNode testing

# Create a test Agent
mocknode --personality TestAgent --type agent

# Create a test Remote
mocknode --personality TestRemote --type remote

# Run a manager script and exit
mocknode --run-script test_scenario --no-gui

Graphics and diagnostics options

Every application accepts these before or after its own options. They are flags, not environment variables. The graphics ones are explained in Graphics backend. The diagnostic ones are explained in Collect useful logs.

Option Description
--rhi-backend=<name> Use one graphics backend and no other (vulkan, opengl, d3d12, d3d11, metal, null). With this flag there is no fallback
--rhi-software Prefer the software rasterizer over a hardware GPU
--rhi-debug Enable the graphics layer's own debug log
--rhi-validate Attach the Khronos validation layer to every Vulkan instance the process creates. On by default in a debug build
--no-rhi-validate Turn the validation layer off, overriding the debug-build default. The later of the two flags wins
--gpu-preference=<name> The GPU that a render view uses: window (the GPU of the window, with no copy), high-performance (the discrete GPU, with a copy for each frame when the window is on another GPU) or copy (always the copy, to measure it). The default is the application's own choice
--d3d-max-frame-latency=<n> The number of frames, 0 to 16, that a Direct3D swap chain can queue before it waits. The default is 1. 0 uses no waitable object
--gpu-markers Name each GPU pass for PIX, Radeon GPU Profiler and RenderDoc
--gui-heartbeat Report every pause of the user interface longer than 250 ms
--tick-trace Log the latency and the queue depth of each worker queue item and each viewport render tick, with a millisecond stamp on every line. This is the supported way to capture interaction diagnostics

Developer options

Option Argument Description
--pantry-layers LAYERS The asset-pantry layers to use, comma separated: live, cache, resource. The default is all three
--pantry-source PATH For one run, get the bundled assets from this source checkout (the live layer of the asset pantry)
--dump-frames DIR Save each worker viewport frame of Construct as a PNG file in this directory
--debug-control ON|OFF Debug builds only. on lets an agent act as the device owner on this node, off stops it. The node saves the value

Qt platform options

Standard Qt options are also available:

Display options

Option Description
-platform <platform> Set Qt platform plugin
-style <style> Set application style
-stylesheet <file> Apply Qt stylesheet
-widgetcount Print widget count on exit

Agent, Remote and HUB read their own options before Qt does, so a Qt option can print a Command line error: line. The application still starts, and Qt still applies the option.

Common platforms

Platform Description
xcb X11 (Linux default)
wayland Wayland (Linux)
windows Windows
cocoa macOS
offscreen Headless rendering

Examples

# Force Wayland
agent -platform wayland

# Use custom style
agent -style fusion

# Headless mode
agent -platform offscreen

Precedence

Apart from NO_COLOR and CLICOLOR_FORCE, which --log-color overrides, the applications read no environment variables. An option comes from the command line, the settings file or the default:

1. Command-line options (highest)
2. Settings file
3. Default values (lowest)

Exit codes

Korall Engineering™ applications return these exit codes:

Code Meaning
0 Success, and the exit after --help or --version
1 Failure, and a command line error in an application that stops on one

Construct's subcommands have exit codes of their own. See Construct CLI.

Checking exit code

zoo --local-port 9000
EXIT_CODE=$?

if [ $EXIT_CODE -eq 0 ]; then
    echo "Exited normally"
else
    echo "Error: $EXIT_CODE"
fi

Configuration file integration

Persisting options

A command-line option applies to one run, and the application does not save it. To keep a value, set it in the settings. --debug-control is the one exception: the node saves its value.

# One run with verbose logging
agent --log-detail verbose

# For every run, set Log detail to verbose in the settings

Script integration

Bash script

#!/bin/bash
# start_agent.sh - Start Agent with custom configuration

BASE_DIR="${1:-/tmp/agent-test}"
LOG_DETAIL="${2:-normal}"

exec agent \
    --base-dir "$BASE_DIR" \
    --log-detail "$LOG_DETAIL"

Systemd service

# /etc/systemd/system/hub.service
[Unit]
Description=HUB
After=network.target

[Service]
Type=simple
User=hub
ExecStart=/usr/bin/hub \
    --head-less \
    --base-dir /var/lib/hub \
    --log-color never
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

Docker

FROM ubuntu:22.04

COPY hub /usr/bin/

ENTRYPOINT ["hub"]
CMD ["--head-less", "--base-dir", "/data"]
# Run with custom options
docker run hub --head-less --base-dir /data --log-detail verbose

Debugging options

Verbose output

# Every log category, Qt's own too
agent --log-detail verbose

# Full detail for one category only
agent --log session:full

Version information

agent --version
# agent 1.2.3

Option reference table

Complete option reference for the options that every application shares. The graphics and diagnostics options, the HUB-specific options and the MockNode options are in their own sections.

Option Short Argument Default Description
--help -h - - Show help
--version -v - - Show version
--base-dir -d PATH platform Data directory
--user-data - - false Your own data in a debug build
--node-id - NODE-IDENTITY-ID last active Node identity
--hive - HIVE-ID - Hive to mount
--hive-passphrase - PASSPHRASE - Hive passphrase
--hive-passphrase-file - PATH - Hive passphrase from a file
--hive-passphrase-stdin - - false Hive passphrase from standard input
--head-less -e - false No window
--fullscreen - - false Full screen
--activity -a ACTIVITY-NAME - Start activity
--open -f FILE-PATH - File to open
--project -j PROJECT-NAME - Test project name
--opal -x TASK - OPAL task at startup
--close-on-completion -c - false Quit when done
--zoo-url - URL setting zoo/url Zoo server address
--door - - false Serve the Trove door
--door-folder - PATH this user's Trove door folder
--local-port -p LOCAL-PORT 8123 Zoo port
--local-host -l LOCAL-HOST - Not read
--remote-host -r REMOTE-HOST - Not read
--remote-port -o REMOTE-PORT - Not read
--log-detail - LEVEL setting Log detail Log detail
--log - CATEGORIES - Log verbosity per category
--log-color - WHEN auto Log color on the terminal
--opengl - MODE software on Windows, auto elsewhere OpenGL implementation
--audio-backend - NAME pulseaudio Audio backend on Linux
--pantry-layers - LAYERS live,cache,resource Asset-pantry layers
--pantry-source - PATH - Asset source checkout
--dump-frames - DIR - Save viewport frames
--debug-control - ON|OFF - Debug control of the node

In this section
Topics
reference CLI options arguments
See also