Complete technical documentation for the Cloudflare WARP CLI tool.
launchd daemon
↓
/Library/LaunchDaemons/com.cloudflare.1dot1dot1dot1.macos.warp.daemon.plist
↓
/Applications/Cloudflare WARP.app/Contents/Resources/CloudflareWARP (root daemon)
↓
IPC: /var/run/warp_service (Unix socket, gRPC protocol)
↓
/usr/local/bin/warp-cli (existing 20MB Rust binary)
↓
/usr/local/bin/warp (our CLI wrapper) ← YOU ARE HERE
The CLI tool wraps the existing warp-cli binary, which already speaks the gRPC protocol to the daemon.
src/
main.rs - clap CLI definition, command dispatch
warp_cli.rs - thin wrapper around warp-cli binary
format.rs - colored output & JSON formatting
commands/
mod.rs - command module exports
connect.rs - up/down/toggle operations
status.rs - display connection status
logs.rs - tail daemon logs
mode.rs - switch WARP mode (doh, gateway, warp, warp+warp)
stats.rs - show connection stats
settings.rs - manage preferences
exclude.rs - split tunnel management
daemon.rs - launchctl wrappers (start/stop/restart)
update.rs - check for app updates
diagnose.rs - run warp-cli diagnostics
scripts/
detect-installation.sh - check system state and readiness
extract-warp.sh - extract binaries from WARP app
setup-daemon.sh - configure daemon via launchd
install-complete.sh - orchestrates entire installation process
cargo build --releaseOutput: target/release/warp (1.1 MB static binary, no runtime dependencies)
curl -fsSL https://raw.githubusercontent.com/zero8dotdev/warp-cli/main/install-from-github.sh | bashgit clone https://github.com/zero8dotdev/warp-cli.git
cd warp-cli
./install-complete.sh# Clone repo
git clone https://github.com/zero8dotdev/warp-cli.git
cd warp-cli
# Build
cargo build --release
# Install
sudo install -m 755 target/release/warp /usr/local/bin/warp# Check connection status
warp status # Human-readable output
warp status --json # JSON format
warp status --quiet # Only exit code
# Connect to WARP
warp up
# Disconnect from WARP
warp down
# Toggle connection state
warp toggle# Switch protocol mode
warp mode warp # Standard WARP
warp mode gateway # Gateway mode
warp mode doh # DNS over HTTPS only
warp mode warp+warp # WARP + additional layer
# Get current mode
warp status --json | jq .protocol# View recent logs
warp logs
# Follow logs in real-time
warp logs --follow
# Follow logs with other options
warp logs --follow --verbose# List excluded domains/IPs
warp exclude list
# Add domain to split tunnel
warp exclude add example.com
# Add IP range to split tunnel
warp exclude add 192.168.1.0/24
# Remove from split tunnel
warp exclude remove example.com# Check daemon status
warp daemon status
# Start daemon
warp daemon start
# Stop daemon
warp daemon stop
# Restart daemon
warp daemon restart# Check for app updates
warp update check
# Run diagnostics
warp diagnose
# Show help for any command
warp --help
warp up --help
warp exclude --helpAll commands support these flags:
# JSON output (for scripting)
warp status --json
# Quiet mode (no output)
warp up --quiet
# Verbose mode (debugging)
warp status --verbose
# Combine flags
warp status --json --quietAll pure Rust, no C FFI or system libraries:
- clap 4 — CLI argument parsing with derive macros
- colored 2 — Terminal colors
- tokio 1 — Async runtime
- reqwest 0.12 — HTTP client
- roxmltree 0.20 — XML parsing
- serde/serde_json — JSON serialization
- anyhow — Error handling
- Subcommand hierarchy — logical grouping via clap
- Global flags —
--json,--quiet,--verboseeverywhere - Stderr for progress — long operations stream to stderr
- Stdout for data — actual results to stdout for piping
- Exit codes — non-zero on error, zero on success
- Descriptive errors — clear error messages
- Zero overhead — single static binary, no JIT/GC
scripts/detect-installation.sh checks:
- ✓ Cloudflare WARP app installed
- ✓ warp-cli binary available
- ✓ Daemon configured and running
- ✓ IPC socket available
- ✓ Installation readiness
Returns exit codes:
0= System fully ready1= Can extract binaries and proceed2= WARP app needed
scripts/extract-warp.sh:
- Verifies WARP app exists
- Extracts warp-cli binary
- Sets proper permissions
- Handles sudo elevation
scripts/setup-daemon.sh:
- Configures launchd daemon
- Starts daemon if needed
- Verifies IPC socket
- Provides troubleshooting help
install-complete.sh:
- Detects system state
- Extracts binaries
- Sets up daemon
- Builds CLI from source
- Installs to /usr/local/bin
- Verifies everything works
Check if binary is in PATH:
which warp
echo $PATH | grep /usr/local/binThe installation script uses sudo automatically. If you get permission errors:
sudo bash ./install-complete.shRestart the daemon:
warp daemon restartOr manually:
sudo launchctl restart com.cloudflare.1dot1dot1dot1.macos.warp.daemonThe daemon may need time to initialize:
sleep 3
warp status# Get connection status as JSON
$ warp status --json
{
"connected": true,
"protocol": "warp",
"ips": ["104.16.0.0"],
"country": "US"
}
# Parse with jq
$ warp status --json | jq .connected
true
# Check in scripts
if warp status --json | jq -e '.connected' > /dev/null; then
echo "Connected to WARP"
else
echo "Not connected"
fiInternal project, follows Cloudflare WARP license terms.