mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-02 11:39:06 +02:00
[client] Add netbird agent-network ls and env commands
Surface the caller-scoped Agent Network setup on the CLI. Both commands dial management directly with the active profile's WireGuard key — the same path foreground login uses — so no daemon proto or engine wiring is needed for the proof of concept. netbird agent-network ls prints the proxy endpoint, the authorized providers, and the allowed models (--json for the raw response). netbird agent-network env prints POSIX export lines for Anthropic-compatible tools such as Claude Code, applied with eval "$(netbird agent-network env)": ANTHROPIC_BASE_URL points at the account's proxy endpoint and ANTHROPIC_AUTH_TOKEN carries a placeholder (the proxy authenticates by tunnel peer and injects the real upstream credentials). A model is never guessed: ANTHROPIC_MODEL is exported only when exactly one model is allowed or --model pins one; anything ambiguous is printed as comment lines instead. "Not available for this peer" is an answer, not an error: both commands exit 0 with a plain message (on stderr for env, keeping the eval a harmless no-op). Linear: NET-1399
This commit is contained in:
@@ -171,6 +171,9 @@ func init() {
|
||||
rootCmd.AddCommand(debugCmd)
|
||||
rootCmd.AddCommand(profileCmd)
|
||||
rootCmd.AddCommand(exposeCmd)
|
||||
rootCmd.AddCommand(agentNetworkCmd)
|
||||
agentNetworkCmd.AddCommand(agentNetworkLsCmd)
|
||||
agentNetworkCmd.AddCommand(agentNetworkEnvCmd)
|
||||
|
||||
networksCMD.AddCommand(routesListCmd)
|
||||
networksCMD.AddCommand(routesSelectCmd, routesDeselectCmd)
|
||||
|
||||
Reference in New Issue
Block a user