[PR #860] Configure CLI flags properly #2906

Open
opened 2025-11-20 08:04:21 -05:00 by saavagebueno · 0 comments
Owner

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

State: closed
Merged: Yes


Describe your changes

The flags in the cli do not match the functionality of the different commands. We have flags set as global flags even tho they are disregarded completly e.g.

service run -h
runs Netbird as service

Usage:
  netbird service run [flags]

Flags:
  -h, --help   help for run

Global Flags:
      --admin-url string        Admin Panel URL [http|https]://[host]:[port] (default "https://app.netbird.io:443")
  -c, --config string           Netbird config file location (default "/etc/netbird/config.json")
      --daemon-addr string      Daemon service address to serve CLI requests [unix|tcp]://[path|host:port] (default "unix:///var/run/netbird.sock")
  -n, --hostname string         Sets a custom hostname for the device
      --log-file string         sets Netbird log path. If console is specified the the log will be output to stdout (default "/var/log/netbird/client.log")
  -l, --log-level string        sets Netbird log level (default "info")
  -m, --management-url string   Management Service URL [http|https]://[host]:[port] (default "https://api.wiretrustee.com:443")
      --preshared-key string    Sets Wireguard PreSharedKey property. If set, then only peers that have the same key can communicate.
  -k, --setup-key string        Setup key obtained from the Management Service Dashboard (used to register peer)

netbird service run only allows logfile and loglevel so proper response would be:

service run -h
runs Netbird as service

Usage:
  netbird service run [flags]

Flags:
  -h, --help               help for run
      --log-file string    sets Netbird log path. If console is specified the the log will be output to stdout (default "/var/log/netbird/client.log")
  -l, --log-level string   sets Netbird log level (default "info")

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)
  • Extended the README / documentation, if necessary
**Original Pull Request:** https://github.com/netbirdio/netbird/pull/860 **State:** closed **Merged:** Yes --- ## Describe your changes The flags in the cli do not match the functionality of the different commands. We have flags set as global flags even tho they are disregarded completly e.g. ``` service run -h runs Netbird as service Usage: netbird service run [flags] Flags: -h, --help help for run Global Flags: --admin-url string Admin Panel URL [http|https]://[host]:[port] (default "https://app.netbird.io:443") -c, --config string Netbird config file location (default "/etc/netbird/config.json") --daemon-addr string Daemon service address to serve CLI requests [unix|tcp]://[path|host:port] (default "unix:///var/run/netbird.sock") -n, --hostname string Sets a custom hostname for the device --log-file string sets Netbird log path. If console is specified the the log will be output to stdout (default "/var/log/netbird/client.log") -l, --log-level string sets Netbird log level (default "info") -m, --management-url string Management Service URL [http|https]://[host]:[port] (default "https://api.wiretrustee.com:443") --preshared-key string Sets Wireguard PreSharedKey property. If set, then only peers that have the same key can communicate. -k, --setup-key string Setup key obtained from the Management Service Dashboard (used to register peer) ``` netbird service run only allows logfile and loglevel so proper response would be: ``` service run -h runs Netbird as service Usage: netbird service run [flags] Flags: -h, --help help for run --log-file string sets Netbird log path. If console is specified the the log will be output to stdout (default "/var/log/netbird/client.log") -l, --log-level string sets Netbird log level (default "info") ``` ## Issue ticket number and link ### Checklist - [x] 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) - [ ] Extended the README / documentation, if necessary
saavagebueno added the pull-request label 2025-11-20 08:04:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2906