synth-ai scan discovers and performs health checks on running task applications deployed locally or via Cloudflare tunnels. It provides structured output in both human-readable table format and machine-readable JSON format, making it suitable for terminal use and programmatic consumption by CLI agents and automation tools.
Quick Start
Discovery Methods
The scan command uses multiple discovery methods to find active task apps:- Port Scanning: Scans specified port ranges for local HTTP servers
- Service Records: Reads deployed local services from persistent records (
~/.synth-ai/services.json) - Tunnel Records: Reads deployed Cloudflare tunnels from persistent records
- Process Scanning: Inspects running
cloudflaredprocesses for tunnel URLs - Backend API: Queries backend for managed tunnel information
- Registry: Checks task app registry for registered apps
Health Checks
For each discovered app, the command performs health checks by:- Making HTTP GET requests to
/healthendpoints - Extracting metadata from
/infoendpoints (app_id, version, task_name, etc.) - Supporting API key authentication via
X-API-Keyheader
- healthy: HTTP 200 with valid JSON response containing
"status": "healthy"or"healthy": true - unhealthy: HTTP error status (4xx, 5xx), Cloudflare tunnel errors (530, 502), or HTML responses
- unknown: Request timeout, connection errors, or other exceptions
Output Formats
Table Format (Default)
The table format provides a human-readable view with columns for:- Name: App identifier (from
/infoendpoint or fallback) - Port: Local port number
- Status: Health status with icon (✅ healthy, ⚠️ unhealthy, ❓ unknown)
- Type: Deployment type (
localorcloudflare) - App ID: Task app identifier
- Version: App version
- Discovered Via: Discovery method used
JSON Format (--json)
The JSON format provides machine-readable output with:
- apps: Array of app objects with full metadata
- scan_summary: Aggregated statistics (total_found, healthy, unhealthy, local_count, cloudflare_count)
- Basic info:
name,url,type,health_status,port - Tunnel info:
tunnel_mode,tunnel_hostname(for Cloudflare apps) - App metadata:
app_id,task_name,dataset_id,version - Discovery:
discovered_via - Full metadata:
metadatadictionary with complete/inforesponse and deployment details
Options
--port-range START:END— Port range to scan (default:8000:8100)--timeout SECONDS— Health check timeout in seconds (default:2.0)--api-key KEY— API key for health checks (default: fromENVIRONMENT_API_KEYenv var)--json— Output results as JSON instead of table--verbose— Show detailed scanning progress
Integration with Deploy Command
The scan command works seamlessly with thedeploy command:
-
Deploy a local service:
-
Scan discovers it:
-
Deploy a tunnel:
-
Scan discovers it:
Use Cases
For Developers
- Quickly see what task apps are running locally
- Verify deployments are healthy
- Debug connectivity issues
- Monitor multiple services
For CI/CD and Automation
- Programmatically discover deployed services
- Health check endpoints for monitoring
- Integration with deployment pipelines
- Service discovery for testing
For AI Agents
- Structured JSON output for programmatic consumption
- Reliable discovery of available services
- Health status for service selection
- Metadata for service configuration
Troubleshooting
No apps found
- Check that services are actually running
- Verify port range includes the ports your apps use
- Check that apps have
/healthendpoints - Ensure API key is set if apps require authentication
Apps showing as “unknown”
- Check network connectivity
- Verify apps are responding on expected ports
- Increase timeout with
--timeoutoption - Check firewall settings
Tunnel apps not discovered
- Verify
cloudflaredprocesses are running - Check tunnel records file exists (
~/.synth-ai/services.json) - Ensure tunnels were deployed via
synth-ai deploy - Try
--verboseto see discovery progress