Skip to content

Client CLI Reference

Complete command-line reference for bifrost-client. This guide covers all available commands, flags, environment variables, and shell completion setup.

The Bifrost client provides a local proxy that routes traffic through the Bifrost server or directly to destinations. It supports multiple protocols, traffic debugging, VPN mode with split tunneling, and can be managed via CLI or REST API.

CommandDescription
bifrost-clientStart the client with configuration
bifrost-client config initGenerate sample configuration
bifrost-client validateValidate configuration file
bifrost-client ctl statusShow client status
bifrost-client ctl debug tailView recent traffic
bifrost-client ctl routes listList routing rules
bifrost-client ctl vpn enableEnable VPN mode
bifrost-client service installInstall as system service
bifrost-client updateCheck for and install updates
bifrost-client versionPrint version information

These flags apply to all commands:

FlagShortDefaultDescription
--config-cclient-config.yamlConfiguration file path
--help-hShow help for any command

Examples:

Terminal window
# Start with custom config file
bifrost-client -c /etc/bifrost/client.yaml
# Get help for any command
bifrost-client --help
bifrost-client ctl --help
bifrost-client ctl vpn --help

Start the Bifrost client proxy.

Terminal window
bifrost-client [flags]

Description:

Starts the local proxy listeners (HTTP and SOCKS5) and connects to the configured Bifrost server. The client runs in the foreground until interrupted.

Examples:

Terminal window
# Start with default config
bifrost-client
# Start with specific config file
bifrost-client -c /etc/bifrost/client.yaml
# Start with config in current directory
bifrost-client -c ./my-config.yaml

What happens on startup:

  1. Loads and validates configuration
  2. Starts HTTP proxy listener (default: 127.0.0.1:7380)
  3. Starts SOCKS5 proxy listener (default: 127.0.0.1:7381)
  4. Starts Web UI dashboard (default: 127.0.0.1:7382)
  5. Starts REST API server (default: 127.0.0.1:7383)
  6. Connects to Bifrost server
  7. Begins routing traffic according to configured rules

Stopping the client:

  • Press Ctrl+C to gracefully shutdown
  • Send SIGTERM signal for graceful shutdown
  • Send SIGINT signal for graceful shutdown

Configuration management commands.

Terminal window
bifrost-client config [command]

Generate a sample client configuration file with sensible defaults.

Terminal window
bifrost-client config init [flags]

Flags:

FlagShortDefaultDescription
--server-sServer address (host:port) - required
--output-oclient-config.yamlOutput file path
--protocol-phttpServer protocol (http or socks5)
--http-listen127.0.0.1:7380HTTP proxy listen address
--socks5-listen127.0.0.1:7381SOCKS5 proxy listen address
--force-ffalseOverwrite existing file

Examples:

Terminal window
# Generate basic config pointing to your server
bifrost-client config init -s proxy.example.com:7080
# Specify custom output file
bifrost-client config init -s proxy.example.com:7080 -o ~/my-config.yaml
# Use SOCKS5 protocol to connect to server
bifrost-client config init -s proxy.example.com:7180 -p socks5
# Use custom local listener addresses
bifrost-client config init -s proxy.example.com:7080 \
--http-listen 0.0.0.0:8080 \
--socks5-listen 0.0.0.0:1080
# Overwrite existing configuration
bifrost-client config init -s proxy.example.com:7080 --force

Generated configuration includes:

  • Local HTTP and SOCKS5 proxy listeners
  • Connection to the specified Bifrost server
  • Default routing rules (localhost direct, everything else through server)
  • Debug, logging, and Web UI settings

Validate a configuration file without starting the client.

Terminal window
bifrost-client validate [flags]

Description:

Checks the configuration file for syntax errors, missing required fields, and invalid values. Useful for CI/CD pipelines and pre-deployment verification.

Examples:

Terminal window
# Validate default config
bifrost-client validate
# Validate specific config file
bifrost-client validate -c /etc/bifrost/client.yaml
# Use in scripts (exit code 0 = valid, 1 = invalid)
bifrost-client validate -c config.yaml && echo "Config OK"

Exit codes:

CodeMeaning
0Configuration is valid
1Configuration has errors

Control a running Bifrost client via its REST API.

Terminal window
bifrost-client ctl [command] [flags]

Global ctl Flags:

FlagDefaultDescription
--apihttp://localhost:7383API server URL
--tokenAPI authentication token

Examples:

Terminal window
# Use custom API URL
bifrost-client ctl status --api http://192.168.1.100:7383
# Use with authentication
bifrost-client ctl status --token my-secret-token

Show client status including server connection state.

Terminal window
bifrost-client ctl status

Output:

Status: running
Server: connected
Version: v1.2.0
Time: 2025-02-05T10:30:00Z
Debug Entries: 1523

Check client health.

Terminal window
bifrost-client ctl health

Output:

Health: healthy

Traffic debugging commands for inspecting proxy activity.

Show recent traffic entries.

Terminal window
bifrost-client ctl debug tail [flags]

Flags:

FlagShortDefaultDescription
--count-n20Number of entries to show

Examples:

Terminal window
# Show last 20 entries
bifrost-client ctl debug tail
# Show last 100 entries
bifrost-client ctl debug tail -n 100

Output:

TIME METHOD HOST STATUS DURATION ROUTE
10:30:01 GET api.github.com 200 45ms server
10:30:02 GET google.com 200 32ms server
10:30:03 GET localhost:8080 200 2ms direct

Clear all debug entries.

Terminal window
bifrost-client ctl debug clear

Output:

Debug entries cleared

Show error entries only.

Terminal window
bifrost-client ctl debug errors

Output:

TIME HOST ERROR
10:25:01 broken-site.com connection refused
10:26:15 timeout.example context deadline exceeded

Export debug entries to a file.

Terminal window
bifrost-client ctl debug export [flags]

Flags:

FlagShortDefaultDescription
--output-otraffic.harOutput file path
--format-fharExport format: har or json

Examples:

Terminal window
# Export as HAR (HTTP Archive) format
bifrost-client ctl debug export
# Export to specific file
bifrost-client ctl debug export -o ~/traffic-capture.har
# Export as raw JSON
bifrost-client ctl debug export -o traffic.json --format json

HAR format can be imported into browser developer tools and tools like Charles Proxy for analysis.


Manage traffic routing rules dynamically.

List all configured routes.

Terminal window
bifrost-client ctl routes list

Output:

NAME PATTERNS ACTION PRIORITY
local localhost,127.0.0.1,*.local direct 100
streaming *.netflix.com,*.hulu.com server 50
default * server 1

Test which route matches a specific domain.

Terminal window
bifrost-client ctl routes test [domain]

Examples:

Terminal window
# Test route matching
bifrost-client ctl routes test google.com

Output:

Domain: google.com
Action: server

Add a new routing rule.

Terminal window
bifrost-client ctl routes add [name] [flags]

Flags:

FlagShortDefaultDescription
--domain-dDomain pattern(s), comma-separated - required
--action-aserverAction: server (use proxy) or direct (bypass)
--priority-p0Rule priority (higher = matched first)

Examples:

Terminal window
# Route work domains through proxy
bifrost-client ctl routes add work --domain "*.company.com" --action server
# Bypass local development servers
bifrost-client ctl routes add devservers \
--domain "*.local,*.localhost,*.test" \
--action direct \
--priority 100
# Route streaming services with high priority
bifrost-client ctl routes add streaming \
--domain "*.netflix.com,*.hulu.com,*.disneyplus.com" \
--action server \
--priority 50

Domain pattern syntax:

  • * - Matches any subdomain level (e.g., *.example.com matches api.example.com)
  • ** - Matches any number of subdomain levels
  • Exact match - example.com matches only example.com

Remove a routing rule.

Terminal window
bifrost-client ctl routes remove [name]

Example:

Terminal window
bifrost-client ctl routes remove streaming

Output:

Route 'streaming' removed successfully

Manage VPN mode and split tunneling.

Show VPN status and statistics.

Terminal window
bifrost-client ctl vpn status

Output:

Status: enabled
Uptime: 2h30m15s
Bytes Sent: 1.2 GB
Bytes Received: 3.4 GB
Active Connections: 42
Tunneled Connections: 38
Bypassed Connections: 4
DNS Queries: 1523
DNS Cache Hits: 1102

Enable VPN mode (creates TUN device and routes all traffic).

Terminal window
bifrost-client ctl vpn enable

Output:

VPN enabled

Note: VPN mode requires elevated privileges (root/Administrator).

Disable VPN mode.

Terminal window
bifrost-client ctl vpn disable

Output:

VPN disabled

Show active VPN connections.

Terminal window
bifrost-client ctl vpn connections

Output:

PROTO LOCAL REMOTE ACTION DURATION BYTES
TCP 192.168.1.10:52341 142.250.80.46:443 tunnel 5m32s ↑1.2MB ↓3.4MB
TCP 192.168.1.10:52342 151.101.1.69:443 tunnel 2m15s ↑256KB ↓1.1MB
UDP 192.168.1.10:53 8.8.8.8:53 bypass 12m05s ↑4KB ↓12KB

Show VPN DNS cache entries.

Terminal window
bifrost-client ctl vpn dns-cache

Output:

DOMAIN ADDRESSES TTL
google.com 142.250.80.46 4m32s
github.com 140.82.112.3 2m15s
api.example.com expired expired

Configure which applications and destinations bypass the VPN.

List current split tunnel rules.

Terminal window
bifrost-client ctl vpn split list

Output:

Mode: exclude
Apps:
- Slack
- Zoom
Domains:
- *.local
- *.internal.company.com
IPs:
- 192.168.0.0/16
- 10.0.0.0/8
Always Bypass:
- localhost
- 127.0.0.1

Add an application to split tunnel (bypasses VPN).

Terminal window
bifrost-client ctl vpn split add-app [name]

Examples:

Terminal window
# Exclude Slack from VPN
bifrost-client ctl vpn split add-app Slack
# Exclude video conferencing
bifrost-client ctl vpn split add-app Zoom
bifrost-client ctl vpn split add-app "Microsoft Teams"

Remove an application from split tunnel.

Terminal window
bifrost-client ctl vpn split remove-app [name]

Example:

Terminal window
bifrost-client ctl vpn split remove-app Zoom

Add a domain pattern to split tunnel.

Terminal window
bifrost-client ctl vpn split add-domain [pattern]

Examples:

Terminal window
# Bypass internal company sites
bifrost-client ctl vpn split add-domain "*.internal.company.com"
# Bypass local development
bifrost-client ctl vpn split add-domain "*.local"

Add an IP or CIDR range to split tunnel.

Terminal window
bifrost-client ctl vpn split add-ip [cidr]

Examples:

Terminal window
# Bypass private networks
bifrost-client ctl vpn split add-ip 192.168.0.0/16
bifrost-client ctl vpn split add-ip 10.0.0.0/8
# Bypass specific server
bifrost-client ctl vpn split add-ip 203.0.113.50/32

Manage system service installation.

Install bifrost-client as a system service.

Terminal window
bifrost-client service install [flags]

Flags:

FlagShortDefaultDescription
--config-cPath to config file - required
--namebifrost-clientService name

Platform-specific behavior:

PlatformService TypeLocation
Linuxsystemd unit/etc/systemd/system/bifrost-client.service
macOSlaunchd plist~/Library/LaunchAgents/bifrost-client.plist
WindowsWindows ServiceService Control Manager

Examples:

Terminal window
# Install with absolute config path (recommended)
bifrost-client service install -c /etc/bifrost/client.yaml
# Install with custom service name
bifrost-client service install -c /etc/bifrost/client.yaml --name my-proxy

Linux systemd:

After installation:

Terminal window
# Start the service
sudo systemctl start bifrost-client
# Enable on boot
sudo systemctl enable bifrost-client
# Check status
sudo systemctl status bifrost-client

macOS launchd:

After installation:

Terminal window
# Load the service
launchctl load ~/Library/LaunchAgents/bifrost-client.plist
# Check if running
launchctl list | grep bifrost

Remove the system service.

Terminal window
bifrost-client service uninstall [flags]

Flags:

FlagDefaultDescription
--namebifrost-clientService name

Example:

Terminal window
bifrost-client service uninstall

Show service installation status.

Terminal window
bifrost-client service status [flags]

Flags:

FlagDefaultDescription
--namebifrost-clientService name

Output:

Service: bifrost-client
Platform: linux (systemd)
Status: installed

Check for and install updates.

Check for updates and optionally install (interactive).

Terminal window
bifrost-client update [flags]

Flags:

FlagShortDefaultDescription
--channelstableRelease channel (stable or prerelease)
--force-ffalseForce update even if on same version

Example:

Terminal window
bifrost-client update

Output:

Update available!
Channel: stable
Current version: v1.1.0
New version: v1.2.0
Published: Mon, 05 Feb 2025 10:00:00 UTC
Would you like to install this update? [y/N]:

Check if updates are available without installing.

Terminal window
bifrost-client update check [flags]

Examples:

Terminal window
# Check stable channel
bifrost-client update check
# Check prerelease channel
bifrost-client update check --channel prerelease

Output (update available):

Update available!
Channel: stable
Current version: v1.1.0
New version: v1.2.0
Published: Mon, 05 Feb 2025 10:00:00 UTC
Release URL: https://github.com/rennerdo30/bifrost-proxy/releases/tag/v1.2.0
Run 'bifrost-client update install' to install.

Output (up to date):

Current version v1.2.0 is up to date (Channel: stable).

Download and install the latest update.

Terminal window
bifrost-client update install [flags]

Examples:

Terminal window
# Install latest stable update
bifrost-client update install
# Install prerelease update
bifrost-client update install --channel prerelease
# Force reinstall current version
bifrost-client update install --force

Output:

Downloading v1.2.0 (5 MB)...
Downloading: 100% (5/5 MB)
Update installed successfully!
Please restart bifrost-client to use version v1.2.0.

Print version information.

Terminal window
bifrost-client version

Output:

Bifrost Client v1.2.0
Commit: abc1234
Built: 2025-02-05T10:00:00Z
Go: go1.24.0
OS/Arch: darwin/arm64

Configuration values can be set via environment variables using the ${VAR_NAME} syntax in YAML config files.

VariableDescriptionExample
BIFROST_CONFIGDefault config file path/etc/bifrost/client.yaml
BIFROST_LOG_LEVELLogging leveldebug, info, warn, error
BIFROST_API_TOKENAPI authentication tokenyour-secret-token
VariableDescription
BIFROST_SERVER_ADDRESSServer address
BIFROST_SERVER_USERNAMEAuthentication username
BIFROST_SERVER_PASSWORDAuthentication password
# client-config.yaml
server:
address: "${BIFROST_SERVER_ADDRESS}"
username: "${BIFROST_SERVER_USERNAME}"
password: "${BIFROST_SERVER_PASSWORD}"
api:
token: "${BIFROST_API_TOKEN}"
logging:
level: "${BIFROST_LOG_LEVEL:-info}"
Terminal window
# Set variables and start
export BIFROST_SERVER_ADDRESS="proxy.example.com:7080"
export BIFROST_SERVER_USERNAME="myuser"
export BIFROST_SERVER_PASSWORD="mypassword"
export BIFROST_API_TOKEN="api-secret"
bifrost-client -c client-config.yaml

Generate shell autocompletion scripts using Cobra’s built-in completion support.

Terminal window
# Generate completion script
bifrost-client completion bash > /etc/bash_completion.d/bifrost-client
# Or add to your .bashrc
echo 'source <(bifrost-client completion bash)' >> ~/.bashrc
source ~/.bashrc
Terminal window
# Generate completion script
bifrost-client completion zsh > "${fpath[1]}/_bifrost-client"
# Or add to your .zshrc
echo 'source <(bifrost-client completion zsh)' >> ~/.zshrc
compinit
Terminal window
# Generate completion script
bifrost-client completion fish > ~/.config/fish/completions/bifrost-client.fish
Terminal window
# Generate completion script
bifrost-client completion powershell > bifrost-client.ps1
# Add to your profile
Add-Content $PROFILE ". bifrost-client.ps1"

Once completion is set up, you can:

  • Tab-complete command names
  • Tab-complete flag names
  • Tab-complete flag values where applicable
  • Get inline help for commands

CodeMeaning
0Success
1General error
2Configuration error
3Connection error

Terminal window
# 1. Generate configuration
bifrost-client config init -s proxy.company.com:7080 -o ~/bifrost-client.yaml
# 2. Edit configuration as needed
nano ~/bifrost-client.yaml
# 3. Validate configuration
bifrost-client validate -c ~/bifrost-client.yaml
# 4. Start the client
bifrost-client -c ~/bifrost-client.yaml
# 5. Test connectivity
bifrost-client ctl health
bifrost-client ctl status
Terminal window
# 1. Install as service (requires sudo on Linux)
sudo bifrost-client service install -c /etc/bifrost/client.yaml
# 2. Linux: Start and enable
sudo systemctl start bifrost-client
sudo systemctl enable bifrost-client
# 3. Verify
bifrost-client service status
bifrost-client ctl health
Terminal window
# 1. Enable VPN mode
bifrost-client ctl vpn enable
# 2. Bypass internal company network
bifrost-client ctl vpn split add-ip 10.0.0.0/8
bifrost-client ctl vpn split add-domain "*.internal.company.com"
# 3. Bypass video conferencing (bandwidth-sensitive)
bifrost-client ctl vpn split add-app Zoom
bifrost-client ctl vpn split add-app "Microsoft Teams"
# 4. Verify configuration
bifrost-client ctl vpn split list
bifrost-client ctl vpn status
Terminal window
# 1. Check client health
bifrost-client ctl health
# 2. Check server connection
bifrost-client ctl status
# 3. View recent traffic
bifrost-client ctl debug tail -n 50
# 4. View only errors
bifrost-client ctl debug errors
# 5. Test specific route
bifrost-client ctl routes test problematic-domain.com
# 6. Export for analysis
bifrost-client ctl debug export -o traffic.har
# Open traffic.har in Chrome DevTools or Charles Proxy
Terminal window
# 1. Check for updates
bifrost-client update check
# 2. Install update
bifrost-client update install
# 3. Restart the client (or service)
# If running as service:
sudo systemctl restart bifrost-client
# If running manually:
# Ctrl+C the current process, then restart
bifrost-client -c ~/bifrost-client.yaml

ServiceDefault AddressDescription
HTTP Proxy127.0.0.1:7380HTTP/HTTPS proxy endpoint
SOCKS5 Proxy127.0.0.1:7381SOCKS5 proxy endpoint
Web UI127.0.0.1:7382Web dashboard
REST API127.0.0.1:7383Control API (ctl commands)

Configure your applications to use 127.0.0.1:7380 for HTTP proxy or 127.0.0.1:7381 for SOCKS5 proxy.