Skip to content

Output Formats

bnerd supports three output formats for all list and get commands. Set the format with the -o or --output flag.

Table (Default)

Human-readable table format with colored status indicators:

bnerd dns zones list
ID                                     NAME              KIND     SERIAL
a1b2c3d4-...                          example.com.      Master   2024010101
e5f6g7h8-...                          test.org.         Master   2024010102

Table output includes:

  • Column headers
  • Aligned columns
  • Colored status indicators (green for active, red for error, yellow for pending)
  • Truncated values for long fields

JSON

Machine-readable JSON, indented for readability:

bnerd dns zones list -o json
[
  {
    "id": "a1b2c3d4-...",
    "name": "example.com.",
    "kind": "Master",
    "serial": 2024010101
  }
]

JSON output is ideal for:

  • Piping to jq for data extraction
  • Storing results in files
  • Processing in scripts

Using with jq

# Get just the zone names
bnerd dns zones list -o json | jq -r '.[].name'

# Count zones
bnerd dns zones list -o json | jq 'length'

# Filter by kind
bnerd dns zones list -o json | jq '[.[] | select(.kind == "Master")]'

YAML

YAML format output:

bnerd dns zones list -o yaml
- id: a1b2c3d4-...
  name: example.com.
  kind: Master
  serial: 2024010101

Setting a Default Format

To always use JSON output, set it in your config:

bnerd config set output json

Or via environment variable:

export BNERD_OUTPUT=json

You can still override per command with the -o flag.

Debug Output

Enable debug mode to see HTTP request/response details alongside normal output:

bnerd --debug dns zones list

Debug output goes to stderr, so it won't interfere with JSON/YAML piping:

bnerd --debug dns zones list -o json 2>/dev/null | jq .