Skip to content

CLI Reference

Complete command-line reference for Bifrost server and client.

Main server executable.

Terminal window
bifrost-server [flags]
bifrost-server [command]
FlagShortDefaultDescription
--config-cserver-config.yamlConfiguration file path
--help-hShow help
CommandDescription
completionGenerate shell autocompletion scripts
ctlControl a running server
helpHelp about any command
updateCheck for and install updates
validateValidate configuration file
versionPrint version information

Validate a configuration file without starting the server.

Terminal window
bifrost-server validate -c config.yaml

Exit codes:

  • 0 - Configuration is valid
  • 1 - Configuration has errors

Print version information.

Terminal window
bifrost-server version

Output:

Bifrost Server v1.0.0
Commit: abc1234
Built: 2024-01-15T10:00:00Z
Go: go1.22.0
OS/Arch: linux/amd64

Check for and install updates.

Terminal window
bifrost-server update [command] [flags]
FlagShortDefaultDescription
--channelstableRelease channel (stable, prerelease)
--force-ffalseForce update even if same version

Check if updates are available without installing.

Terminal window
bifrost-server update check

Output:

Update available!
Current version: v1.0.0
New version: v1.1.0
Published: Mon, 15 Jan 2024 10:00:00 UTC
Release URL: https://github.com/rennerdo30/bifrost-proxy/releases/tag/v1.1.0
Run 'bifrost-server update install' to install.

Download and install the latest update.

Terminal window
bifrost-server update install

Features:

  • Downloads from GitHub Releases
  • Verifies SHA256 checksum
  • Creates backup before replacing
  • Shows download progress

Note: The server must be restarted after updating.


Control a running Bifrost server via the API.

Terminal window
bifrost-server ctl [command] [flags]
FlagDefaultDescription
--apihttp://localhost:7082API server URL
--tokenAPI authentication token

Check server health.

Terminal window
bifrost-server ctl health

Show server status.

Terminal window
bifrost-server ctl status

Show server statistics.

Terminal window
bifrost-server ctl stats

Manage backends.

Terminal window
# List all backends
bifrost-server ctl backend list
# Show specific backend
bifrost-server ctl backend show <name>
# Show backend stats
bifrost-server ctl backend stats <name>

Manage configuration.

Terminal window
# Show current config
bifrost-server ctl config show
# Reload configuration
bifrost-server ctl config reload
# Validate configuration
bifrost-server ctl config validate

Main client executable.

Terminal window
bifrost-client [flags]
bifrost-client [command]
FlagShortDefaultDescription
--config-cclient-config.yamlConfiguration file path
--help-hShow help
CommandDescription
completionGenerate shell autocompletion scripts
configConfiguration management
ctlControl a running client
helpHelp about any command
updateCheck for and install updates
validateValidate configuration file
versionPrint version information

Configuration management commands.

Terminal window
bifrost-client config [command]

Generate a sample client configuration file.

Terminal window
bifrost-client config init [flags]
FlagShortDefaultDescription
--server-sServer address (host:port)
--output-oclient-config.yamlOutput file path
--protocol-phttpProtocol (http, socks5)

Examples:

Terminal window
# Generate basic config
bifrost-client config init -s proxy.example.com:7080
# Specify output file
bifrost-client config init -s proxy.example.com:7080 -o my-config.yaml
# Use SOCKS5 protocol
bifrost-client config init -s proxy.example.com:7180 -p socks5

Validate a configuration file.

Terminal window
bifrost-client validate -c config.yaml

Print version information.

Terminal window
bifrost-client version

Check for and install updates.

Terminal window
bifrost-client update [command] [flags]
FlagShortDefaultDescription
--channelstableRelease channel (stable, prerelease)
--force-ffalseForce update even if same version

Check if updates are available without installing.

Terminal window
bifrost-client update check

Download and install the latest update.

Terminal window
bifrost-client update install

Note: The client must be restarted after updating.

Control a running Bifrost client via the API.

Terminal window
bifrost-client ctl [command] [flags]
FlagDefaultDescription
--apihttp://localhost:7383API server URL

Check client health.

Terminal window
bifrost-client ctl health

Show client status including server connection.

Terminal window
bifrost-client ctl status

List routing rules.

Terminal window
bifrost-client ctl routes

Test routing for a domain.

Terminal window
bifrost-client ctl test example.com

Generate autocompletion scripts for your shell.

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

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

VariableDescriptionExample
BIFROST_CONFIGConfig file path/etc/bifrost/config.yaml
BIFROST_LOG_LEVELLog leveldebug, info, warn, error
BIFROST_API_TOKENAPI authentication tokenyour-secret-token
VariableDescription
LDAP_BIND_PASSWORDLDAP bind password
OAUTH_CLIENT_SECRETOAuth client secret
# config.yaml
api:
token: "${BIFROST_API_TOKEN}"
auth:
ldap:
bind_password: "${LDAP_BIND_PASSWORD}"
Terminal window
export BIFROST_API_TOKEN="my-secret-token"
export LDAP_BIND_PASSWORD="ldap-password"
bifrost-server -c config.yaml

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

Terminal window
bifrost-server -c /etc/bifrost/production.yaml
Terminal window
bifrost-server validate -c config.yaml && echo "Config OK"
Terminal window
bifrost-server ctl health --api http://localhost:7082 --token mytoken
Terminal window
bifrost-client config init -s proxy.example.com:7080 -o config.yaml
bifrost-client -c config.yaml
Terminal window
bifrost-client ctl test google.com
# Output: google.com -> server (matched rule: default)