[PR #4516] feat: prefer CLI flags over environment variables #20593

Open
opened 2026-08-05 05:07:28 -04:00 by saavagebueno · 0 comments
Owner

Original Pull Request: https://github.com/netbirdio/netbird/pull/4516

State: closed
Merged: No


DO-NOT-MERGE (see the description)

Describe your changes

Makes NetBird CLI behave with the usual precedence of the command line tooling, where directly passed command line flags take precedence over environment variables.

The general consensus is that we should not change this behavior right now, because it was working like this since forever and we might have users & customers depending on this behavior.

There are at least 2 examples of flags where envvar taking precedence over CLI flag makes sense (centrally-managed devices that user should not be able to reconfigure):

  1. --disable-profiles / NB_DISABLE_PROFILES
  2. --disable-update-settings / NB_DISABLE_UPDATE_SETTINGS

https://github.com/netbirdio/netbird/issues/4515

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Documentation update will be needed if/when we decide to merge this.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

**Original Pull Request:** https://github.com/netbirdio/netbird/pull/4516 **State:** closed **Merged:** No --- DO-NOT-MERGE (see the description) ## Describe your changes Makes NetBird CLI behave with the usual precedence of the command line tooling, where directly passed command line flags take precedence over environment variables. The general consensus is that we should not change this behavior right now, because it was working like this since forever and we might have users & customers depending on this behavior. There are at least 2 examples of flags where envvar taking precedence over CLI flag makes sense (centrally-managed devices that user should not be able to reconfigure): 1. `--disable-profiles` / `NB_DISABLE_PROFILES` 2. `--disable-update-settings` / `NB_DISABLE_UPDATE_SETTINGS` ## Issue ticket number and link https://github.com/netbirdio/netbird/issues/4515 ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) > By submitting this pull request, you confirm that you have read and agree to the terms of the [Contributor License Agreement](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Documentation update will be needed if/when we decide to merge this. ### Docs PR URL (required if "docs added" is checked) Paste the PR link from https://github.com/netbirdio/docs here: https://github.com/netbirdio/docs/pull/__
saavagebueno added the pull-request label 2026-08-05 05:07:28 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#20593