ByCloud Docs
GuidesCLIAPISDK

Output Formats

The ByCloud CLI supports multiple output formats for different use cases. Use the --output flag or set a default in your config.

Text Format (Default)

Human-readable text format, best for interactive use and quick viewing.

bycloud compute instances list --output textID NAME STATUS FLAVOR CREATED_AT i-550e8400 web-server-1 active c1.medium 2024-01-15T10:30:00Z i-662f9511 db-server-1 active c1.large 2024-01-16T14:20:00Z

JSON Format

Structured format for scripting and automation. Outputs JSON that can be parsed with tools like jq.

bycloud compute instances list --output json{ "instances": [ { "id": "i-550e8400", "name": "web-server-1", "status": "active", "flavor": "c1.medium", "created_at": "2024-01-15T10:30:00Z" }, { "id": "i-662f9511", "name": "db-server-1", "status": "active", "flavor": "c1.large", "created_at": "2024-01-16T14:20:00Z" } ] }

Tip: Pipe to jq for filtering: bycloud compute instances list --output json | jq '.instances[].id'

YAML Format

Human-readable structured format, useful for configuration files and GitOps workflows.

bycloud compute instances list --output yamlinstances: - id: i-550e8400 name: web-server-1 status: active flavor: c1.medium created_at: "2024-01-15T10:30:00Z" - id: i-662f9511 name: db-server-1 status: active flavor: c1.large created_at: "2024-01-16T14:20:00Z"

Setting Default Format

The default format is text. You can change it:

Using config:

bycloud config set output json

Using environment variable:

export BYCLOUD_OUTPUT=json

Scripting Tips

Extract a specific field with jq:

bycloud compute instances get --id i-123 --output json | jq -r '.instance.status'

Loop through items:

for id in $(bycloud compute instances list --output json | jq -r '.instances[].id'); do echo "Processing $id" bycloud compute instances stop --id "$id" done

Suppress progress output in scripts:

bycloud compute instances create --name my-vm --quiet