Client CLI Reference
Client CLI Reference
Section titled “Client CLI Reference”Complete command-line reference for bifrost-client. This guide covers all available commands, flags, environment variables, and shell completion setup.
Overview
Section titled “Overview”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.
Quick Reference
Section titled “Quick Reference”| Command | Description |
|---|---|
bifrost-client | Start the client with configuration |
bifrost-client config init | Generate sample configuration |
bifrost-client validate | Validate configuration file |
bifrost-client ctl status | Show client status |
bifrost-client ctl debug tail | View recent traffic |
bifrost-client ctl routes list | List routing rules |
bifrost-client ctl vpn enable | Enable VPN mode |
bifrost-client service install | Install as system service |
bifrost-client update | Check for and install updates |
bifrost-client version | Print version information |
Global Flags
Section titled “Global Flags”These flags apply to all commands:
| Flag | Short | Default | Description |
|---|---|---|---|
--config | -c | client-config.yaml | Configuration file path |
--help | -h | Show help for any command |
Examples:
# Start with custom config filebifrost-client -c /etc/bifrost/client.yaml
# Get help for any commandbifrost-client --helpbifrost-client ctl --helpbifrost-client ctl vpn --helpStarting the Client
Section titled “Starting the Client”bifrost-client
Section titled “bifrost-client”Start the Bifrost client proxy.
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:
# Start with default configbifrost-client
# Start with specific config filebifrost-client -c /etc/bifrost/client.yaml
# Start with config in current directorybifrost-client -c ./my-config.yamlWhat happens on startup:
- Loads and validates configuration
- Starts HTTP proxy listener (default:
127.0.0.1:7380) - Starts SOCKS5 proxy listener (default:
127.0.0.1:7381) - Starts Web UI dashboard (default:
127.0.0.1:7382) - Starts REST API server (default:
127.0.0.1:7383) - Connects to Bifrost server
- Begins routing traffic according to configured rules
Stopping the client:
- Press
Ctrl+Cto gracefully shutdown - Send
SIGTERMsignal for graceful shutdown - Send
SIGINTsignal for graceful shutdown
Configuration Commands
Section titled “Configuration Commands”bifrost-client config
Section titled “bifrost-client config”Configuration management commands.
bifrost-client config [command]bifrost-client config init
Section titled “bifrost-client config init”Generate a sample client configuration file with sensible defaults.
bifrost-client config init [flags]Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--server | -s | Server address (host:port) - required | |
--output | -o | client-config.yaml | Output file path |
--protocol | -p | http | Server protocol (http or socks5) |
--http-listen | 127.0.0.1:7380 | HTTP proxy listen address | |
--socks5-listen | 127.0.0.1:7381 | SOCKS5 proxy listen address | |
--force | -f | false | Overwrite existing file |
Examples:
# Generate basic config pointing to your serverbifrost-client config init -s proxy.example.com:7080
# Specify custom output filebifrost-client config init -s proxy.example.com:7080 -o ~/my-config.yaml
# Use SOCKS5 protocol to connect to serverbifrost-client config init -s proxy.example.com:7180 -p socks5
# Use custom local listener addressesbifrost-client config init -s proxy.example.com:7080 \ --http-listen 0.0.0.0:8080 \ --socks5-listen 0.0.0.0:1080
# Overwrite existing configurationbifrost-client config init -s proxy.example.com:7080 --forceGenerated 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
Validation Commands
Section titled “Validation Commands”bifrost-client validate
Section titled “bifrost-client validate”Validate a configuration file without starting the client.
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:
# Validate default configbifrost-client validate
# Validate specific config filebifrost-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:
| Code | Meaning |
|---|---|
| 0 | Configuration is valid |
| 1 | Configuration has errors |
Control Commands (ctl)
Section titled “Control Commands (ctl)”Control a running Bifrost client via its REST API.
bifrost-client ctl
Section titled “bifrost-client ctl”bifrost-client ctl [command] [flags]Global ctl Flags:
| Flag | Default | Description |
|---|---|---|
--api | http://localhost:7383 | API server URL |
--token | API authentication token |
Examples:
# Use custom API URLbifrost-client ctl status --api http://192.168.1.100:7383
# Use with authenticationbifrost-client ctl status --token my-secret-tokenStatus Commands
Section titled “Status Commands”bifrost-client ctl status
Section titled “bifrost-client ctl status”Show client status including server connection state.
bifrost-client ctl statusOutput:
Status: runningServer: connectedVersion: v1.2.0Time: 2025-02-05T10:30:00ZDebug Entries: 1523bifrost-client ctl health
Section titled “bifrost-client ctl health”Check client health.
bifrost-client ctl healthOutput:
Health: healthyDebug Commands
Section titled “Debug Commands”Traffic debugging commands for inspecting proxy activity.
bifrost-client ctl debug tail
Section titled “bifrost-client ctl debug tail”Show recent traffic entries.
bifrost-client ctl debug tail [flags]Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--count | -n | 20 | Number of entries to show |
Examples:
# Show last 20 entriesbifrost-client ctl debug tail
# Show last 100 entriesbifrost-client ctl debug tail -n 100Output:
TIME METHOD HOST STATUS DURATION ROUTE10:30:01 GET api.github.com 200 45ms server10:30:02 GET google.com 200 32ms server10:30:03 GET localhost:8080 200 2ms directbifrost-client ctl debug clear
Section titled “bifrost-client ctl debug clear”Clear all debug entries.
bifrost-client ctl debug clearOutput:
Debug entries clearedbifrost-client ctl debug errors
Section titled “bifrost-client ctl debug errors”Show error entries only.
bifrost-client ctl debug errorsOutput:
TIME HOST ERROR10:25:01 broken-site.com connection refused10:26:15 timeout.example context deadline exceededbifrost-client ctl debug export
Section titled “bifrost-client ctl debug export”Export debug entries to a file.
bifrost-client ctl debug export [flags]Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--output | -o | traffic.har | Output file path |
--format | -f | har | Export format: har or json |
Examples:
# Export as HAR (HTTP Archive) formatbifrost-client ctl debug export
# Export to specific filebifrost-client ctl debug export -o ~/traffic-capture.har
# Export as raw JSONbifrost-client ctl debug export -o traffic.json --format jsonHAR format can be imported into browser developer tools and tools like Charles Proxy for analysis.
Route Commands
Section titled “Route Commands”Manage traffic routing rules dynamically.
bifrost-client ctl routes list
Section titled “bifrost-client ctl routes list”List all configured routes.
bifrost-client ctl routes listOutput:
NAME PATTERNS ACTION PRIORITYlocal localhost,127.0.0.1,*.local direct 100streaming *.netflix.com,*.hulu.com server 50default * server 1bifrost-client ctl routes test
Section titled “bifrost-client ctl routes test”Test which route matches a specific domain.
bifrost-client ctl routes test [domain]Examples:
# Test route matchingbifrost-client ctl routes test google.comOutput:
Domain: google.comAction: serverbifrost-client ctl routes add
Section titled “bifrost-client ctl routes add”Add a new routing rule.
bifrost-client ctl routes add [name] [flags]Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--domain | -d | Domain pattern(s), comma-separated - required | |
--action | -a | server | Action: server (use proxy) or direct (bypass) |
--priority | -p | 0 | Rule priority (higher = matched first) |
Examples:
# Route work domains through proxybifrost-client ctl routes add work --domain "*.company.com" --action server
# Bypass local development serversbifrost-client ctl routes add devservers \ --domain "*.local,*.localhost,*.test" \ --action direct \ --priority 100
# Route streaming services with high prioritybifrost-client ctl routes add streaming \ --domain "*.netflix.com,*.hulu.com,*.disneyplus.com" \ --action server \ --priority 50Domain pattern syntax:
*- Matches any subdomain level (e.g.,*.example.commatchesapi.example.com)**- Matches any number of subdomain levels- Exact match -
example.commatches onlyexample.com
bifrost-client ctl routes remove
Section titled “bifrost-client ctl routes remove”Remove a routing rule.
bifrost-client ctl routes remove [name]Example:
bifrost-client ctl routes remove streamingOutput:
Route 'streaming' removed successfullyVPN Commands
Section titled “VPN Commands”Manage VPN mode and split tunneling.
bifrost-client ctl vpn status
Section titled “bifrost-client ctl vpn status”Show VPN status and statistics.
bifrost-client ctl vpn statusOutput:
Status: enabledUptime: 2h30m15sBytes Sent: 1.2 GBBytes Received: 3.4 GBActive Connections: 42Tunneled Connections: 38Bypassed Connections: 4DNS Queries: 1523DNS Cache Hits: 1102bifrost-client ctl vpn enable
Section titled “bifrost-client ctl vpn enable”Enable VPN mode (creates TUN device and routes all traffic).
bifrost-client ctl vpn enableOutput:
VPN enabledNote: VPN mode requires elevated privileges (root/Administrator).
bifrost-client ctl vpn disable
Section titled “bifrost-client ctl vpn disable”Disable VPN mode.
bifrost-client ctl vpn disableOutput:
VPN disabledbifrost-client ctl vpn connections
Section titled “bifrost-client ctl vpn connections”Show active VPN connections.
bifrost-client ctl vpn connectionsOutput:
PROTO LOCAL REMOTE ACTION DURATION BYTESTCP 192.168.1.10:52341 142.250.80.46:443 tunnel 5m32s ↑1.2MB ↓3.4MBTCP 192.168.1.10:52342 151.101.1.69:443 tunnel 2m15s ↑256KB ↓1.1MBUDP 192.168.1.10:53 8.8.8.8:53 bypass 12m05s ↑4KB ↓12KBbifrost-client ctl vpn dns-cache
Section titled “bifrost-client ctl vpn dns-cache”Show VPN DNS cache entries.
bifrost-client ctl vpn dns-cacheOutput:
DOMAIN ADDRESSES TTLgoogle.com 142.250.80.46 4m32sgithub.com 140.82.112.3 2m15sapi.example.com expired expiredSplit Tunnel Commands
Section titled “Split Tunnel Commands”Configure which applications and destinations bypass the VPN.
bifrost-client ctl vpn split list
Section titled “bifrost-client ctl vpn split list”List current split tunnel rules.
bifrost-client ctl vpn split listOutput:
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.1bifrost-client ctl vpn split add-app
Section titled “bifrost-client ctl vpn split add-app”Add an application to split tunnel (bypasses VPN).
bifrost-client ctl vpn split add-app [name]Examples:
# Exclude Slack from VPNbifrost-client ctl vpn split add-app Slack
# Exclude video conferencingbifrost-client ctl vpn split add-app Zoombifrost-client ctl vpn split add-app "Microsoft Teams"bifrost-client ctl vpn split remove-app
Section titled “bifrost-client ctl vpn split remove-app”Remove an application from split tunnel.
bifrost-client ctl vpn split remove-app [name]Example:
bifrost-client ctl vpn split remove-app Zoombifrost-client ctl vpn split add-domain
Section titled “bifrost-client ctl vpn split add-domain”Add a domain pattern to split tunnel.
bifrost-client ctl vpn split add-domain [pattern]Examples:
# Bypass internal company sitesbifrost-client ctl vpn split add-domain "*.internal.company.com"
# Bypass local developmentbifrost-client ctl vpn split add-domain "*.local"bifrost-client ctl vpn split add-ip
Section titled “bifrost-client ctl vpn split add-ip”Add an IP or CIDR range to split tunnel.
bifrost-client ctl vpn split add-ip [cidr]Examples:
# Bypass private networksbifrost-client ctl vpn split add-ip 192.168.0.0/16bifrost-client ctl vpn split add-ip 10.0.0.0/8
# Bypass specific serverbifrost-client ctl vpn split add-ip 203.0.113.50/32Service Commands
Section titled “Service Commands”Manage system service installation.
bifrost-client service install
Section titled “bifrost-client service install”Install bifrost-client as a system service.
bifrost-client service install [flags]Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--config | -c | Path to config file - required | |
--name | bifrost-client | Service name |
Platform-specific behavior:
| Platform | Service Type | Location |
|---|---|---|
| Linux | systemd unit | /etc/systemd/system/bifrost-client.service |
| macOS | launchd plist | ~/Library/LaunchAgents/bifrost-client.plist |
| Windows | Windows Service | Service Control Manager |
Examples:
# Install with absolute config path (recommended)bifrost-client service install -c /etc/bifrost/client.yaml
# Install with custom service namebifrost-client service install -c /etc/bifrost/client.yaml --name my-proxyLinux systemd:
After installation:
# Start the servicesudo systemctl start bifrost-client
# Enable on bootsudo systemctl enable bifrost-client
# Check statussudo systemctl status bifrost-clientmacOS launchd:
After installation:
# Load the servicelaunchctl load ~/Library/LaunchAgents/bifrost-client.plist
# Check if runninglaunchctl list | grep bifrostbifrost-client service uninstall
Section titled “bifrost-client service uninstall”Remove the system service.
bifrost-client service uninstall [flags]Flags:
| Flag | Default | Description |
|---|---|---|
--name | bifrost-client | Service name |
Example:
bifrost-client service uninstallbifrost-client service status
Section titled “bifrost-client service status”Show service installation status.
bifrost-client service status [flags]Flags:
| Flag | Default | Description |
|---|---|---|
--name | bifrost-client | Service name |
Output:
Service: bifrost-clientPlatform: linux (systemd)Status: installedUpdate Commands
Section titled “Update Commands”Check for and install updates.
bifrost-client update
Section titled “bifrost-client update”Check for updates and optionally install (interactive).
bifrost-client update [flags]Flags:
| Flag | Short | Default | Description |
|---|---|---|---|
--channel | stable | Release channel (stable or prerelease) | |
--force | -f | false | Force update even if on same version |
Example:
bifrost-client updateOutput:
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]:bifrost-client update check
Section titled “bifrost-client update check”Check if updates are available without installing.
bifrost-client update check [flags]Examples:
# Check stable channelbifrost-client update check
# Check prerelease channelbifrost-client update check --channel prereleaseOutput (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).bifrost-client update install
Section titled “bifrost-client update install”Download and install the latest update.
bifrost-client update install [flags]Examples:
# Install latest stable updatebifrost-client update install
# Install prerelease updatebifrost-client update install --channel prerelease
# Force reinstall current versionbifrost-client update install --forceOutput:
Downloading v1.2.0 (5 MB)...Downloading: 100% (5/5 MB)
Update installed successfully!Please restart bifrost-client to use version v1.2.0.Version Command
Section titled “Version Command”bifrost-client version
Section titled “bifrost-client version”Print version information.
bifrost-client versionOutput:
Bifrost Client v1.2.0 Commit: abc1234 Built: 2025-02-05T10:00:00Z Go: go1.24.0 OS/Arch: darwin/arm64Environment Variables
Section titled “Environment Variables”Configuration values can be set via environment variables using the ${VAR_NAME} syntax in YAML config files.
Common Variables
Section titled “Common Variables”| Variable | Description | Example |
|---|---|---|
BIFROST_CONFIG | Default config file path | /etc/bifrost/client.yaml |
BIFROST_LOG_LEVEL | Logging level | debug, info, warn, error |
BIFROST_API_TOKEN | API authentication token | your-secret-token |
Server Connection Variables
Section titled “Server Connection Variables”| Variable | Description |
|---|---|
BIFROST_SERVER_ADDRESS | Server address |
BIFROST_SERVER_USERNAME | Authentication username |
BIFROST_SERVER_PASSWORD | Authentication password |
Example Usage
Section titled “Example Usage”# client-config.yamlserver: address: "${BIFROST_SERVER_ADDRESS}" username: "${BIFROST_SERVER_USERNAME}" password: "${BIFROST_SERVER_PASSWORD}"
api: token: "${BIFROST_API_TOKEN}"
logging: level: "${BIFROST_LOG_LEVEL:-info}"# Set variables and startexport 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.yamlShell Completion
Section titled “Shell Completion”Generate shell autocompletion scripts using Cobra’s built-in completion support.
# Generate completion scriptbifrost-client completion bash > /etc/bash_completion.d/bifrost-client
# Or add to your .bashrcecho 'source <(bifrost-client completion bash)' >> ~/.bashrcsource ~/.bashrc# Generate completion scriptbifrost-client completion zsh > "${fpath[1]}/_bifrost-client"
# Or add to your .zshrcecho 'source <(bifrost-client completion zsh)' >> ~/.zshrccompinit# Generate completion scriptbifrost-client completion fish > ~/.config/fish/completions/bifrost-client.fishPowerShell
Section titled “PowerShell”# Generate completion scriptbifrost-client completion powershell > bifrost-client.ps1
# Add to your profileAdd-Content $PROFILE ". bifrost-client.ps1"Features
Section titled “Features”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
Exit Codes
Section titled “Exit Codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Configuration error |
| 3 | Connection error |
Common Workflows
Section titled “Common Workflows”Initial Setup
Section titled “Initial Setup”# 1. Generate configurationbifrost-client config init -s proxy.company.com:7080 -o ~/bifrost-client.yaml
# 2. Edit configuration as needednano ~/bifrost-client.yaml
# 3. Validate configurationbifrost-client validate -c ~/bifrost-client.yaml
# 4. Start the clientbifrost-client -c ~/bifrost-client.yaml
# 5. Test connectivitybifrost-client ctl healthbifrost-client ctl statusSetting Up as a Service
Section titled “Setting Up as a Service”# 1. Install as service (requires sudo on Linux)sudo bifrost-client service install -c /etc/bifrost/client.yaml
# 2. Linux: Start and enablesudo systemctl start bifrost-clientsudo systemctl enable bifrost-client
# 3. Verifybifrost-client service statusbifrost-client ctl healthConfiguring Split Tunneling
Section titled “Configuring Split Tunneling”# 1. Enable VPN modebifrost-client ctl vpn enable
# 2. Bypass internal company networkbifrost-client ctl vpn split add-ip 10.0.0.0/8bifrost-client ctl vpn split add-domain "*.internal.company.com"
# 3. Bypass video conferencing (bandwidth-sensitive)bifrost-client ctl vpn split add-app Zoombifrost-client ctl vpn split add-app "Microsoft Teams"
# 4. Verify configurationbifrost-client ctl vpn split listbifrost-client ctl vpn statusDebugging Traffic Issues
Section titled “Debugging Traffic Issues”# 1. Check client healthbifrost-client ctl health
# 2. Check server connectionbifrost-client ctl status
# 3. View recent trafficbifrost-client ctl debug tail -n 50
# 4. View only errorsbifrost-client ctl debug errors
# 5. Test specific routebifrost-client ctl routes test problematic-domain.com
# 6. Export for analysisbifrost-client ctl debug export -o traffic.har# Open traffic.har in Chrome DevTools or Charles ProxyUpdating the Client
Section titled “Updating the Client”# 1. Check for updatesbifrost-client update check
# 2. Install updatebifrost-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 restartbifrost-client -c ~/bifrost-client.yamlDefault Ports
Section titled “Default Ports”| Service | Default Address | Description |
|---|---|---|
| HTTP Proxy | 127.0.0.1:7380 | HTTP/HTTPS proxy endpoint |
| SOCKS5 Proxy | 127.0.0.1:7381 | SOCKS5 proxy endpoint |
| Web UI | 127.0.0.1:7382 | Web dashboard |
| REST API | 127.0.0.1:7383 | Control 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.
See Also
Section titled “See Also”- Configuration Reference - Full configuration file documentation
- VPN Mode - Detailed VPN mode documentation
- Traffic Debugging - Traffic inspection features
- Desktop Client - GUI application documentation
- API Reference - REST API documentation