AdGuardian accepts four command-line flags for passing AdGuard Home connection details at launch time. Flags are an alternative to environment variables — when both are provided for the same field, the CLI flag takes precedence becauseDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/lissy93/adguardian-term/llms.txt
Use this file to discover all available pages before exploring further.
welcome.rs calls env::set_var with the flag’s value, overwriting whatever was previously in the environment.
Supported flags
The IP address or hostname of your AdGuard Home instance. Equivalent to the
ADGUARD_IP environment variable.The port that AdGuard Home’s HTTP API is listening on. Equivalent to the
ADGUARD_PORT environment variable. Must be parseable as a valid u16 port number.Your AdGuard Home username, used for HTTP Basic authentication. Equivalent to the
ADGUARD_USERNAME environment variable.Your AdGuard Home password. Equivalent to the
ADGUARD_PASSWORD environment variable.These are the only four CLI flags AdGuardian supports. The optional settings —
ADGUARD_PROTOCOL, ADGUARD_UPDATE_INTERVAL, ADGUARD_TIMEOUT, and ADGUARD_QUERYLOG_LIMIT — have no corresponding flags and can only be configured via environment variables.Usage example
-- separator in the example above is a shell convention that signals the end of options for the invoking process. It is necessary when running through a wrapper such as cargo run (e.g. cargo run -- --adguard-ip 192.168.180.1) so that Cargo does not consume the flags itself. When invoking the compiled binary directly, -- is not required — AdGuardian’s argument parser simply scans all arguments for recognized flag names.
Precedence over environment variables
Internally, flag parsing inwelcome.rs iterates over std::env::args() and, for each recognized flag, immediately calls env::set_var with the corresponding variable name. This means a flag value overwrites any same-named environment variable that was already set in the process environment. The effective precedence is:
ADGUARD_IP is already exported as 10.0.0.1 in your shell and you also pass --adguard-ip 192.168.180.1, AdGuardian will connect to 192.168.180.1.
Any missing required values not supplied by flags or environment variables are collected through an interactive prompt at startup. AdGuardian will never silently skip a required field.