Share feedback
Answers are generated based on the documentation.

sbx ports

DescriptionManage sandbox port publishing
Usagesbx ports SANDBOX [flags]

Description

Manage sandbox port publishing.

List, publish, or unpublish ports for a running sandbox. Without --publish or --unpublish flags, lists all published ports.

Port spec format: [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL] If HOST_PORT is omitted, an ephemeral port is allocated automatically. HOST_IP defaults to 127.0.0.1, PROTOCOL defaults to tcp. Supported protocols: tcp, tcp4, tcp6, udp, udp4, udp6.

Options

OptionDefaultDescription
--jsonOutput in JSON format (for port listing)
--publishPublish a port (can be repeated): [[HOST_IP:]HOST_PORT:]SANDBOX_PORT[/PROTOCOL]
--unpublishUnpublish a port (can be repeated): [HOST_IP:]HOST_PORT:SANDBOX_PORT[/PROTOCOL]

Global options

OptionDefaultDescription
-D, --debugEnable debug logging

Examples

# List published ports
sbx ports my-sandbox

# Publish sandbox port 8080 to an ephemeral host port
sbx ports my-sandbox --publish 8080

# Publish with a specific host port
sbx ports my-sandbox --publish 3000:8080

# Unpublish a port
sbx ports my-sandbox --unpublish 3000:8080