Skip to content

CLI Reference

Quick reference for the awf command-line interface.

Synopsis

Terminal window
awf [options] -- <command>

Options Summary

OptionTypeDefaultDescription
--allow-domains <domains>stringComma-separated list of allowed domains (required unless --allow-domains-file used)
--allow-domains-file <path>stringPath to file containing allowed domains
--log-level <level>stringinfoLogging verbosity: debug, info, warn, error
--keep-containersflagfalseKeep containers running after command exits
--ttyflagfalseAllocate pseudo-TTY for interactive tools
--work-dir <dir>string/tmp/awf-<timestamp>Working directory for temporary files
--build-localflagfalseBuild containers locally instead of pulling from registry
--image-registry <url>stringghcr.io/githubnext/gh-aw-firewallContainer image registry
--image-tag <tag>stringlatestContainer image tag
-e, --env <KEY=VALUE>string[]Environment variable (repeatable)
--env-allflagfalsePass all host environment variables
-v, --mount <host:container[:mode]>string[]Volume mount (repeatable)
--container-workdir <dir>stringUser homeWorking directory inside container
--dns-servers <servers>string8.8.8.8,8.8.4.4Trusted DNS servers (comma-separated)
-V, --versionflagDisplay version
-h, --helpflagDisplay help

Options Details

--allow-domains <domains>

Comma-separated list of allowed domains. Domains automatically match all subdomains.

Terminal window
--allow-domains github.com,npmjs.org

--allow-domains-file <path>

Path to file with allowed domains. Supports comments (#) and one domain per line.

Terminal window
--allow-domains-file ./allowed-domains.txt

--log-level <level>

Set logging verbosity.

LevelDescription
debugDetailed information including config, container startup, iptables rules
infoNormal operational messages (default)
warnWarning messages
errorError messages only

--keep-containers

Keep containers and configuration files after command exits for debugging.

--tty

Allocate a pseudo-TTY for interactive tools (e.g., Claude Code, interactive shells).

--work-dir <dir>

Custom working directory for temporary files. Contains squid.conf, docker-compose.yml, and log directories.

--build-local

Build containers from local Dockerfiles instead of pulling pre-built images.

--image-registry <url>

Custom container image registry URL.

--image-tag <tag>

Container image tag to use.

-e, --env <KEY=VALUE>

Pass environment variable to container. Can be specified multiple times.

Terminal window
-e API_KEY=secret -e DEBUG=true

--env-all

Pass all host environment variables to container.

-v, --mount <host_path:container_path[:mode]>

Mount host directories into container. Format: host_path:container_path[:ro|rw]

Terminal window
-v /data:/data:ro -v /tmp/output:/output:rw

Requirements:

  • Both paths must be absolute
  • Host path must exist
  • Mode: ro (read-only) or rw (read-write)

Default mounts:

  • Host filesystem at /host (read-only)
  • User home directory (read-write)
  • Docker socket at /var/run/docker.sock

--container-workdir <dir>

Working directory inside the container.

--dns-servers <servers>

Comma-separated list of trusted DNS servers. DNS traffic is only allowed to these servers, preventing DNS-based data exfiltration. Both IPv4 and IPv6 addresses are supported.

Terminal window
# Use Cloudflare DNS
--dns-servers 1.1.1.1,1.0.0.1
# Use Google DNS with IPv6
--dns-servers 8.8.8.8,2001:4860:4860::8888

Exit Codes

CodeDescription
0Command succeeded
1-255Command exit code or firewall error
130Interrupted by SIGINT (Ctrl+C)
143Terminated by SIGTERM

Subcommands

awf logs

View Squid proxy logs from current or previous runs.

Terminal window
awf logs [options]

Options

OptionTypeDefaultDescription
-f, --followflagfalseFollow log output in real-time
--format <format>stringprettyOutput format: raw, pretty, json
--source <path>stringautoPath to log directory or running for live container
--listflagfalseList available log sources

Output Formats

FormatDescription
prettyColorized, human-readable output (default)
rawLogs as-is without parsing
jsonStructured JSON for scripting

Examples

Terminal window
# View recent logs with pretty formatting
awf logs
# Follow logs in real-time
awf logs -f
# View logs in JSON format
awf logs --format json
# List available log sources
awf logs --list
# Use a specific log directory
awf logs --source /tmp/squid-logs-1234567890
# Stream from running container
awf logs --source running -f

See Also