Automation
All NDCLI commands support multiple output formats via the -f flag, making it straightforward to integrate NetDefense into scripts, pipelines, and automation workflows.
Output Formats
| Format | Flag | Use Case |
|---|---|---|
| Table | -f table (default) | Human-readable aligned columns, ideal for terminal use. |
| Simple | -f simple | Compact key-value output, useful for quick inspection. |
| Detailed | -f detailed | Expanded view with all fields and relationships. |
| JSON | -f json | Machine-readable output for scripting and automation. |
JSON Output Example
ndcli device list -f json{ "devices": [ { "uuid": "e2eb98b8-0ed3-11f1-8792-66a021937fa2", "name": "fw-hq-primary", "status": "ENABLED", "organization": "example-org", "organizational_units": ["production"], "version": "2.4.1", "heartbeat": "2026-02-21T03:17:31Z", "auto_sync": true, "synced_at": "2026-02-21T03:16:43Z" } ], "total": 8}Scripting with jq
# Get names of all devices not syncedndcli sync status -f json | jq -r '.items[] | select(.in_sync == false) | .device_name'
# Count devices per OUndcli device list -f json | jq -r '.devices[].organizational_units[]' | sort | uniq -c
# Get overlay IPs for all VPN membersndcli network member list corporate-vpn -f json | jq -r '.members[] | "\(.device): \(.overlay_ip)"'