Skip to content
WebAssembly-powered

Master the Megaport CLI

Learn real Megaport CLI workflows: provision services, troubleshoot connectivity, and automate repeatable network operations from your terminal or browser.

$megaport-cli ports list --table
megaport-cli ports list --table

Run CLI commands in your terminal or try the live browser demo.

What Is the Megaport CLI?

A single command-line tool for provisioning and managing your entire Megaport network — ports, virtual cross connects, cloud routers, and more.

Provision Infrastructure

Create ports, VXCs, MCRs, MVEs, and cloud on-ramps directly from your terminal — no portal clicks required.

Multiple Input Modes

Interactive prompts for exploration, CLI flags for scripting, and JSON file input for full automation and CI/CD pipelines.

Try It in the Browser

A live WASM-powered terminal lets you explore commands without installing anything — great for learning and quick demos.

This tutorial walks you through installation, core concepts, and hands-on workflows — from your first command to multi-cloud automation.

Get started →

Everything You Need

Built for power users, accessible to everyone.

Up and Running in Minutes

Three steps from zero to managing your first resource.

1
Install CLI
2
Authenticate
3
Create Resources

Step 1 of 3

1 Install CLI
$brew install megaport/tap/megaport-cli

Mac & Linux via Homebrew

Then verify:

megaport-cli version

  • The easiest way to install on macOS or Linux.
  • Run "brew upgrade megaport-cli" to update.
  • Tap is auto-updated with each new release.
2Authenticate
$megaport-cli config create-profile default

Enter your API key and secret

Profile "default" created Environment: production Active profile: default
  • Use production for live resources and real changes.
  • Use staging while learning and testing safely.
  • Switch profiles quickly with config use-profile.
3Create Resources
$megaport-cli ports list --table

List all your ports

UID NAME SPEED STATUS abc-123 Sydney Port 10G LIVE def-456 Melbourne 1G LIVE
  • Run get/status/update commands on any returned UID.
  • Use --output json for script-friendly automation.
  • Add --profile to target another environment quickly.

How It Works

The CLI talks directly to the Megaport API — in your terminal or your browser.

You

Developer

CLI

Terminal

WASM

Browser

Megaport API

Ports
VXCs
MCR
MVE
IX
Locations

9 Resource Types

Complete CLI coverage across the entire Megaport platform.

Why Use the CLI?

Move faster, reduce errors, and scale your network operations.

Minutes

vs. days with manual processes

Provision a port, connect to AWS, and route traffic — all from one terminal session.

Repeatable

Script once, deploy everywhere

JSON templates and CI/CD pipelines replace portal clicks with auditable, version-controlled infrastructure.

800+

Data centres in 26 countries

Query live availability, filter by metro, and connect to any cloud provider — all via API.