From 3fe8703991c1ace447b6cfc0d2998e1b5641dd16 Mon Sep 17 00:00:00 2001 From: Krzysztof Nazarewski Date: Thu, 18 Sep 2025 14:11:50 +0200 Subject: [PATCH] document configuration precedence for the CLI --- src/pages/how-to/cli.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pages/how-to/cli.mdx b/src/pages/how-to/cli.mdx index bfc65c15..64266907 100644 --- a/src/pages/how-to/cli.mdx +++ b/src/pages/how-to/cli.mdx @@ -18,6 +18,16 @@ netbird [command] [subcommand] [flags] To see detailed command information, use the flag `--help` after each command +## Configuration precedence + +This is the CLI configuration precedence (highest to lowest priority): + +1. environment variables (eg: `NB_WIREGUARD_PORT`) +2. command line flags (eg: `--wireguard-port`) +3. configuration file entries `.json` (formerly: `config.json`), eg: `WgPort` key + +We are preserving the unusual priority of environment variables for backwards compatibility with existing deployments. + ## Global flags `netbird` has a set of global flags that are available in every command. They specify settings that are core or shared between two or more commands, e.g. `--setup-key` is used by `login` and `up` to authenticate the client against a management service.