bx
العربية — اللغة

لم تُترجم هذه الصفحة إلى العربية بعد؛ تُعرض أدناه بلغة أخرى.

Commands

Command Purpose
sudo bx server up --open-ufw Sets up the VPS in one command: reality + hysteria2, opens ufw, and finally prints a complete sudo bx setup … line ready to paste
sudo bx server install --host <host> First-time install of bx server on the VPS (the underlying step of server up)
sudo bx server start Start bx server and enable it at boot
sudo bx server stop Stop bx server and disable it at boot
sudo bx server link --host <host> Generate a client link
sudo bx user show <name> Show one user
sudo bx user invite <name> Create a link for one person, or show an existing one again; --qr draws a QR code for a phone, --format link prints the bare link (for third-party clients)
sudo bx user list [--json] List the links you have handed out (no credentials)
sudo bx server harden Prevent link holders from reaching this server's own local services, internal network and cloud metadata addresses through the tunnel (new installs have it built in; older installs with no routing rules at all get it added by bx server itself on start; only if you wrote routing rules yourself do you need to run it manually, and it replaces them with bx's set)
sudo bx server enable-sync Let your Mac and iPhone sync rules through this server (stored encrypted, listens only on the loopback address, opens no new port to the public internet)
sudo bx user revoke <name> Revoke one person's link
sudo bx server rotate --host <host> Rotate the server password and generate a new client link
sudo bx server logs View server logs
sudo bx server ui --host <host> Start a minimal Web UI listening only on localhost
sudo bx server uninstall Uninstall the bx server service
sudo bx setup <client-link> First-time client configuration
bx setup --router [--lan <network>] <client-link> Configure router mode on an OpenWrt router (the whole LAN goes through bx; without --lan, the LAN is detected from the br-* private bridges)
sudo bx server deploy <user@host> Install bx server from this machine onto a bare VPS (via the system ssh); add --name <name> to add it to the local list automatically once installed (does not switch the current exit). --ssh-port sets the SSH port. The "Set Up a New Server" window in the menu uses the same command: the password is entered in the window, used once in memory only, and not saved
bx server list List configured servers: exit host, UDP exit, and observed peak throughput (with age)
bx server list --test Also test latency and reachability for each server. It sends packets outside the tunnel, so it is an explicit action, not the default
bx server use <name> Switch to another server in the list: arm → wait for the new tunnel to become healthy → confirm; roll back in place if it fails to come up
bx server rm <name> Remove a server from the list (the one currently in use cannot be removed)
bx up Turn protection on (it stays on across reboots)
bx down Turn protection off (it stays off across reboots)
bx reconnect Safely reconnect the transport: switch once the replacement transport is healthy, without interrupting TUN, routes or DNS
bx update --check --json Read-only check for a signed release, for the menu bar app or automation to read
sudo bx update Verify the signature and update to the new version; on macOS the App and the command line are updated together. With protection on, the kill switch stays in force throughout, and if the new version fails to start it goes back to the old one automatically
bx server add '<link>' Add a server to the server list; a new link for the same server (same key) with a changed address replaces the old address, and if it is the server in use, it switches over on the spot (see Server IP blocked)
bx server auto-switch on|off|status When the current server has been unreachable from this network for more than a minute, switch to another server in the list (off by default; changes the exit IP, so confirm before turning it on; does not switch back by itself)
sudo bx update --auto on|off|status Automatic update switch on Linux / Windows (on by default): bx checks once a day, installs a new version only after it has been "latest" for a day, and if it fails to start after installing, reverts to the old version on its own and does not try that version again
bx direct add <domain> Add a domain to the direct allowlist (applies to both TCP and UDP); a proxy rule with the same name is removed along with it. When a broader proxy rule covers it, it refuses to write it (it would never match) and names the line to delete; matching the public cloud/CDN risk list is also refused, and you can add --force once you are sure
bx direct rm <domain> Remove a domain from the direct allowlist
bx proxy add <domain> Force a domain through the tunnel; mutually exclusive with direct rules, which are cleaned up
bx proxy rm <domain> Remove a domain from the forced-tunnel list
bx reports View problem reports kept on this machine: which have been sent and which are still queued (sent through the tunnel only while protection is on; contents are redacted)
sudo bx app-install --app-source /Applications/Bx.app macOS: reinstall the CLI and the protection service from Bx.app (the repair command when an upgrade only got halfway)
bx mcp MCP server for AI agents (stdio), see agent-tools.md
bx preset ls List built-in app availability presets
bx preset show <name> Show the direct domains a preset will add
bx preset apply <name> Explicitly apply a preset and hot-load it at runtime
bx egress add <name> <socks5> Add a named egress (the fallback when a mesh is not an option; the address must be loopback)
bx egress route <name> <cidr> Hand a subnet to that egress (allowlist: only what is listed goes through it)
bx egress ls / bx egress rm <name> List / remove (rm also removes its subnets)

Commands that change rules, servers, egresses and UDP mode are written for you by bx's protection service, so the person who installed bx does not need sudo; changes take effect immediately (egress and UDP mode require restarting the tunnel — a second or two without network, while the kill switch keeps blocking so nothing goes out outside the tunnel), and if protection is off they take effect the next time it is turned on.

Command Purpose
bx dns status Show the macOS DNS takeover status
sudo bx dns off When bx is no longer running but DNS still points at it, restore the original DNS bx saved (cleans up leftovers; refused while bx is running — use bx down to turn protection off)
bx status Show the client status panel
bx capabilities Output a machine-readable capability list
bx doctor Diagnose client configuration, service status and link connectivity
bx doctor --json Output machine-readable client diagnostics
bx leakcheck Leak check (recommended): opens a local page and matches the browser half (WebRTC/exit/fingerprint) against the local half (routes/DNS). Works even with bx off and another VPN running. It also probes a few AI sites from this machine (Anthropic / Claude / OpenAI / Google AI), answering "can this path reach them" — that is not a security question, so it is a separate section with a separate count, and --no-reach turns it off
bx leak-check --json Non-interactive machine-readable check (no page; for MCP and scripts)
bx leak-check --network --json --expected-ip <ip> Actively probe the IPv4/IPv6/DNS exits and judge whether they match expectations
bx explain <domain-or-IP> "How will this target go on my machine" — first answers from the local perspective (what it resolves to, whether it enters the TUN, which way a program bound to an interface goes), then gives bx's verdict (which rule matches, how many failures this time and in total). Works even when bx is not running
bx apps Per-app view of the split: which apps' traffic goes through the tunnel, goes direct, or is blocked (samples a window, 6 seconds by default)
bx observe --json --duration 30s --scenario video Observe connections, routing decisions, UDP blocking and traffic changes over a short window
bx logs View client logs
bx logs --json Output client log text, errors and hints readable by agents
sudo bx run Run in the foreground, for debugging
sudo bx uninstall Uninstall the client service
sudo bx server doctor Diagnose server configuration, listening ports and service status
sudo bx server doctor --json Output machine-readable server diagnostics