Skip to content

Commit 0c3f576

Browse files
authored
document configuration precedence for the CLI (#428)
1 parent 5cd895a commit 0c3f576

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/pages/how-to/cli.mdx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ netbird [command] [subcommand] [flags]
1818
To see detailed command information, use the flag `--help` after each command
1919
</Note>
2020

21+
## Configuration precedence
22+
23+
This is the CLI configuration precedence (highest to lowest priority):
24+
25+
1. environment variables (eg: `NB_WIREGUARD_PORT`)
26+
2. command line flags (eg: `--wireguard-port`)
27+
3. configuration file entries `<profile>.json` (formerly: `config.json`), eg: `WgPort` key
28+
29+
We are preserving the unusual priority of environment variables for backwards compatibility with existing deployments.
30+
2131
## Global flags
2232
`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.
2333

0 commit comments

Comments
 (0)