CLI Cheat Sheet
Quick-reference one-pager for the most common Megaport CLI commands
Copy any command below. For full details, see the Command Reference.
Authentication
Set credentials via environment variables (simplest approach)
Create a named config profile for reuse
Switch to a saved profile
Ports
List all ports in your account
Show details of a specific port
Buy a port with guided prompts
Soft-delete a port (can be restored within cancellation window)
VXCs (Virtual Cross Connects)
List all VXCs
Buy a VXC with guided prompts
MCRs (Megaport Cloud Routers)
List all MCRs
Buy an MCR with guided prompts
MVEs (Megaport Virtual Edges)
List all MVEs
Locations
List all 800+ data centre locations
Filter locations by metro area
Show only locations where MCR is available
Partners
List all cloud partner ports
Filter to a specific cloud provider
Service Keys
List all service keys
Output Formats
JSON output for scripting
CSV output for spreadsheets
Pipe JSON to jq for filtering
Command Aliases
Most subcommands have short aliases for faster typing:
| Full command | Alias | Example |
|---|---|---|
list | ls | megaport-cli ports ls |
get | show | megaport-cli ports show PORT_UID |
status | st | megaport-cli ports st PORT_UID |
delete | rm | megaport-cli ports rm PORT_UID |
Status & Diagnostics
Full infrastructure dashboard — all resource types
Show CLI version