CLI Reference
The tcp-warden binary provides built-in subcommands for starting the proxy, validating YAML configuration, installing modular protocol plugins, and managing active IP bans.
Unified CLI Available
All commands documented below can be executed directly using either the standalone tcp-warden binary or via the unified Routewarden CLI as rwarden tcp <subcommand> (e.g. rwarden tcp up, rwarden tcp reload, rwarden tcp plugins list).
Global Syntax
rwarden tcp [command] [flags]rwarden status tcprwarden stop tcpCommands
run (Default)
Starts the TCP proxy daemon and binds configured service listeners.
# Run in foreground (auto-resolves tcp-warden.yaml)rwarden tcp up# Run in background daemon mode (detached)rwarden tcp up -d# Run with custom config file and verbose loggingrwarden tcp up -c /etc/routewarden/custom.yaml -v -d# Reload configuration on running daemon without dropping connections (zero-downtime)rwarden tcp reload# Stop running background proxy daemonrwarden tcp stop| Flag | Shorthand | Description | Default |
|---|---|---|---|
--config | -c | Path to YAML configuration file | tcp-warden.yaml |
validate
Validates YAML syntax, port collisions, CIDR format, and protocol dependencies without starting listeners.
# Validate TCP Warden configuration YAMLrwarden tcp validate -c tcp-warden.yaml# or universal validaterwarden validate tcp-warden.yamlExit Codes:
0: Configuration is valid.1: Syntax or rule validation error (details printed tostderr).
plugins
Subcommands for discovering, installing, testing, and managing modular protocol inspectors.
plugins list
Displays all installed modular plugins, versions, protocols, and current activation status:
rwarden tcp plugins listplugins install
Pulls a plugin from a Git repository or local folder, runs pre-flight tests, and registers the plugin:
# Install official plugin by short name or repositoryrwarden tcp plugins install httprwarden tcp plugins install redisrwarden tcp plugins install postgresrwarden tcp plugins install https://github.com/routewarden/plugins/postgres| Flag | Description | Default |
|---|---|---|
--force | Overwrite existing installation and purge cache | false |
--no-build | Skip rebuilding the tcp-warden binary | false |
--cache-dir | Path to plugin cache directory | $ROUTEWARDEN_PLUGINS_CACHE |
plugins enable
Tests the plugin using synthetic net.Pipe self-tests and enables it in tcp-warden.yaml:
tcp-warden plugins enable postgresplugins disable
Disables an active plugin and sets enabled: false in tcp-warden.yaml:
tcp-warden plugins disable postgresplugins test
Executes in-memory self-tests across all registered plugins:
rwarden tcp plugins testplugins create
Scaffolds a new custom protocol inspector plugin with manifest (plugin.yaml), lifecycle code (plugin.go), unit tests, and automatic registration in plugins/all/all.go:
# Scaffold a new custom protocol plugin with manifest, tests, and auto-registrationtcp-warden plugins create custom_guard --protocol custom --listen :9500 --upstream 127.0.0.1:9000| Flag | Description | Default |
|---|---|---|
--protocol | Target protocol name | <plugin-name> |
--listen | Default ingress port | "" |
--upstream | Default upstream target | "" |
--dir | Destination directory | plugins/<plugin-name> |
--no-service | Skip adding default service to tcp-warden.yaml | false |
plugins uninstall
Removes plugin source, unregisters import, and rebuilds the binary:
tcp-warden plugins uninstall postgresstatus
Queries metrics from a running daemon via the management API:
# Check running proxy daemon statusrwarden tcp status# orrwarden status tcpbanlist
Displays active IP bans, offending services, and remaining expiration times:
tcp-warden banlist --api http://127.0.0.1:9091ban
Manually ban an IP address across all services:
tcp-warden ban 198.51.100.55 --duration 24h --reason "manual audit block"| Flag | Description | Default |
|---|---|---|
--duration | Ban expiration duration (e.g. 1h, 24h, 7d) | 1h |
--reason | Human-readable reason for the ban | manual ban |
--api | Management API base URL | http://127.0.0.1:9091 |
unban
Removes an active ban for a specific IP address:
tcp-warden unban 198.51.100.55version
Displays the compiled version, Git commit hash, and build timestamp:
rwarden tcp version