Skip to content

CLI Reference

Quick reference for the awf command-line interface.

Terminal window
awf [options] -- <command>
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
--block-domains <domains>stringComma-separated list of blocked domains (takes precedence over allowed)
--block-domains-file <path>stringPath to file containing blocked domains
--ssl-bumpflagfalseEnable SSL Bump for HTTPS content inspection
--allow-urls <urls>stringComma-separated list of allowed URL patterns (requires --ssl-bump)
--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

Comma-separated list of allowed domains. Domains automatically match all subdomains. Supports wildcard patterns and protocol-specific filtering.

Terminal window
--allow-domains github.com,npmjs.org
--allow-domains '*.github.com,api-*.example.com'

Restrict domains to HTTP-only or HTTPS-only traffic by prefixing with the protocol:

Terminal window
# HTTPS only - blocks HTTP traffic to this domain
--allow-domains 'https://secure.example.com'
# HTTP only - blocks HTTPS traffic to this domain
--allow-domains 'http://legacy-api.example.com'
# Both protocols (default behavior, backward compatible)
--allow-domains 'example.com'
# Mixed configuration
--allow-domains 'example.com,https://secure.example.com,http://legacy.example.com'
# Works with wildcards
--allow-domains 'https://*.secure.example.com'

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

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

Comma-separated list of blocked domains. Blocked domains take precedence over allowed domains, enabling fine-grained control. Supports the same wildcard patterns as --allow-domains.

Terminal window
# Block specific subdomain while allowing parent domain
--allow-domains example.com --block-domains internal.example.com
# Block with wildcards
--allow-domains '*.example.com' --block-domains '*.secret.example.com'

Path to file with blocked domains. Supports the same format as --allow-domains-file.

Terminal window
--block-domains-file ./blocked-domains.txt

Enable SSL Bump for HTTPS content inspection. When enabled, the firewall generates a per-session CA certificate and intercepts HTTPS connections, allowing URL path filtering.

Terminal window
--ssl-bump --allow-urls "https://github.com/githubnext/*"

How it works:

  1. A unique CA certificate is generated (valid for 1 day)
  2. The CA is injected into the agent container’s trust store
  3. Squid intercepts HTTPS using SSL Bump (peek, stare, bump)
  4. Full URLs become visible for filtering via --allow-urls

See also: SSL Bump Reference for complete documentation.

Comma-separated list of allowed URL patterns for HTTPS traffic. Requires --ssl-bump.

Terminal window
# Single pattern
--allow-urls "https://github.com/githubnext/*"
# Multiple patterns
--allow-urls "https://github.com/org1/*,https://api.github.com/repos/*"

Pattern syntax:

  • Must include scheme (https://)
  • * matches any characters in a path segment
  • Patterns are matched against the full request URL

Set logging verbosity.

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

Keep containers and configuration files after command exits for debugging.

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

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

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

Custom container image registry URL.

Container image tag to use.

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

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

Pass all host environment variables to container.

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

Section titled “-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)

Working directory inside the container.

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
CodeDescription
0Command succeeded
1-255Command exit code or firewall error
130Interrupted by SIGINT (Ctrl+C)
143Terminated by SIGTERM

View Squid proxy logs from current or previous runs.

Terminal window
awf logs [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
--with-pidflagfalseEnrich logs with PID/process info (requires -f)
FormatDescription
prettyColorized, human-readable output (default)
rawLogs as-is without parsing
jsonStructured JSON for scripting
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
# Follow logs with PID/process tracking
awf logs -f --with-pid

The --with-pid flag enriches log entries with process information, correlating each network request to the specific process that made it.

Pretty format with PID:

[2024-01-01 12:00:00.123] CONNECT api.github.com → 200 (ALLOWED) [curl/7.88.1] <PID:12345 curl>

JSON output includes additional fields:

{
"timestamp": 1703001234.567,
"domain": "github.com",
"pid": 12345,
"cmdline": "curl https://github.com",
"comm": "curl",
"inode": "123456"
}

Show aggregated statistics from firewall logs.

Terminal window
awf logs stats [options]
OptionTypeDefaultDescription
--format <format>stringprettyOutput format: json, markdown, pretty
--source <path>stringautoPath to log directory or running for live container
FormatDescription
prettyColorized terminal output with summary and domain breakdown (default)
markdownMarkdown table format suitable for documentation
jsonStructured JSON for programmatic consumption
Terminal window
# Show stats with colorized terminal output
awf logs stats
# Get stats in JSON format for scripting
awf logs stats --format json
# Get stats in markdown format
awf logs stats --format markdown
# Use a specific log directory
awf logs stats --source /tmp/squid-logs-1234567890
Firewall Statistics
────────────────────────────────────────
Total Requests: 150
Allowed: 145 (96.7%)
Denied: 5 (3.3%)
Unique Domains: 12
Domains:
api.github.com 50 allowed, 0 denied
registry.npmjs.org 95 allowed, 0 denied
evil.com 0 allowed, 5 denied

Generate summary report optimized for GitHub Actions step summaries.

Terminal window
awf logs summary [options]
OptionTypeDefaultDescription
--format <format>stringmarkdownOutput format: json, markdown, pretty
--source <path>stringautoPath to log directory or running for live container
Terminal window
# Generate markdown summary (default)
awf logs summary
# Add to GitHub Actions step summary
awf logs summary >> $GITHUB_STEP_SUMMARY
# Get summary in JSON format
awf logs summary --format json
# Get summary with colorized terminal output
awf logs summary --format pretty
<details>
<summary>Firewall Activity</summary>
▼ 150 requests | 145 allowed | 5 blocked | 12 unique domains
| Domain | Allowed | Denied |
|--------|---------|--------|
| api.github.com | 50 | 0 |
| registry.npmjs.org | 95 | 0 |
| evil.com | 0 | 5 |
</details>