netbirdio / netbird

Connect your devices into a secure WireGuard®-based overlay network with SSO, MFA and granular access controls.
https://netbird.io
BSD 3-Clause "New" or "Revised" License
11.25k stars 517 forks source link

"netbird status --json" should return json at NeedsLogin stage #2780

Open Silex opened 4 weeks ago

Silex commented 4 weeks ago

I'm trying to detect wether netbird was already configured or not.

Right now I'm doing "netbird status | grep NeedsLogin" but it'd be more logical if I could parse the json whatever stage netbird is (needslogin, disconnected, connected).

mgarces commented 4 weeks ago

so your suggestion is that --json is always available, even when client is not configured?

Silex commented 4 weeks ago

Yes, with data like { "status": "NeedLogin" } (and additional available info)

Silex commented 3 weeks ago

That said I'm open for a better way of reporting "Client is not configured".

netbird status | grep NeedsLogin works but it does not feel very robust.

My use case is that I'm doing an OpenWRT netbird package with automatic client configuration.