-
Notifications
You must be signed in to change notification settings - Fork 1
Commands Overview
Vercel Doorman provides a comprehensive set of CLI commands for managing firewall rules across providers.
List current active rules or a specific version.
# List current active rules
npx vercel-doorman list
# List rules from a specific version
npx vercel-doorman list 1
# List specific version in JSON format
npx vercel-doorman list 2 --format json
# Provider-specific
npx vercel-doorman list --provider cloudflare --verboseSynchronize your local configuration with the remote provider.
# Auto-detect provider
npx vercel-doorman sync
# With explicit token
npx vercel-doorman sync --token YOUR_TOKEN
# Provider-specific
npx vercel-doorman sync --provider cloudflare
npx vercel-doorman sync --provider vercel --config production.config.jsonOptions:
-
--config, -c— Path to config file -
--projectId, -p— Vercel Project ID -
--teamId, -t— Vercel Team ID -
--token— Vercel API token -
--provider— Target provider (vercelorcloudflare)
Download firewall rules from your provider to a local config file.
# Preview changes without modifying config
npx vercel-doorman download --dry-run
# Download and update config
npx vercel-doorman download
# Download specific version
npx vercel-doorman download 1
# Provider-specific
npx vercel-doorman download --provider cloudflareOptions:
-
configVersion— Optional version number -
--dry-run, -d— Preview changes -
--config, -c— Path to config file -
--token— API token -
--provider— Target provider
Check your configuration file for errors.
npx vercel-doorman validate
# Show detailed validation results
npx vercel-doorman validate --verbose
# Provider-specific validation
npx vercel-doorman validate --provider cloudflare --strictOptions:
-
--config, -c— Path to config file -
--verbose, -v— Show detailed results
Add predefined rule templates to your configuration.
# List available templates
npx vercel-doorman template
# Add specific template
npx vercel-doorman template wordpress
npx vercel-doorman template ai-bots
npx vercel-doorman template bad-bots
npx vercel-doorman template block-ofac-sanctioned-countriesAvailable Templates:
-
bad-bots— Block common malicious bot traffic -
ai-bots— Block AI crawlers and scrapers -
wordpress— Block WordPress-related URLs -
block-ofac-sanctioned-countries— OFAC compliance
# Interactive setup
npx vercel-doorman init --interactive
# With template
npx vercel-doorman init security-focused
# Cloudflare project
npx vercel-doorman init --provider cloudflare --interactiveTemplates: empty, basic, security-focused
npx vercel-doorman status
npx vercel-doorman status --provider cloudflareShows sync status, connection health, configuration health score, and pending changes.
# Show differences between local and remote
npx vercel-doorman diff
# JSON output for CI/CD
npx vercel-doorman diff --format json
# Cross-provider comparison
npx vercel-doorman diff --source vercel --target cloudflarenpx vercel-doorman watch
npx vercel-doorman watch --interval 2000
npx vercel-doorman watch --provider cloudflareWatches your config file for changes and automatically syncs.
# Create backup
npx vercel-doorman backup
# List backups
npx vercel-doorman backup --list
# Restore from backup
npx vercel-doorman backup --restore backup-file.jsonnpx vercel-doorman export --format json
npx vercel-doorman export --format yaml
npx vercel-doorman export --format terraform
npx vercel-doorman export --format markdownnpx vercel-doorman setupDisplays an interactive setup guide for new users.
These options are available on most commands:
-
--config, -c— Path to configuration file -
--provider— Target provider (vercelorcloudflare) -
--token— API token -
--verbose, -v— Verbose output -
--help— Show help
Instead of passing command-line arguments, set these environment variables:
| Variable | Description |
|---|---|
VERCEL_TOKEN |
Vercel API token |
VERCEL_PROJECT_ID |
Vercel project ID |
VERCEL_TEAM_ID |
Vercel team ID |
CLOUDFLARE_API_TOKEN |
Cloudflare API token |
CLOUDFLARE_ZONE_ID |
Cloudflare zone ID |
CLOUDFLARE_ACCOUNT_ID |
Cloudflare account ID |
DOORMAN_PROVIDER |
Default provider |
# 1. Initialize project
npx vercel-doorman init security-focused
# 2. Watch for changes during development
npx vercel-doorman watch
# 3. Check status periodically
npx vercel-doorman status# 1. Create backup before changes
npx vercel-doorman backup
# 2. Check what will change
npx vercel-doorman diff
# 3. Validate configuration
npx vercel-doorman validate
# 4. Apply changes
npx vercel-doorman sync
# 5. Verify sync completed
npx vercel-doorman status# Validate in CI
npx vercel-doorman validate --config production.config.json
# Check for changes (JSON output for parsing)
npx vercel-doorman diff --format json
# Deploy changes
npx vercel-doorman sync --config production.config.json- Getting Started — Quick setup guide
- Configuration — Configuration file reference
- Examples — Real-world configuration examples
- Templates — Pre-built rule templates
Getting Started
Configuration
Commands
Guides