This topic introduces Megaport services and the Megaport command-line interface (CLI), which is currently in beta. It is intended for users getting started with the Megaport CLI.
What is Megaport?
Megaport is a global Network as a Service (NaaS) provider that makes it easy to connect your network to cloud services such as AWS, Microsoft Azure, and Google Cloud without needing complex physical infrastructure.
It uses a software-defined network (SDN) to let you create scalable, secure, and on-demand virtual connections called Virtual Cross Connects (VXCs), between data centers, cloud providers, and enterprise networks. If you are new to Megaport, see Introducing Megaport.
What is a CLI?
A CLI is a text-based interface used to interact with a computer’s operating system or software by typing specific commands into a terminal or console.
Unlike a graphical user interface (GUI), which relies on icons, menus, and mouse clicks, a CLI processes lines of text to execute tasks, manage files, and run scripts.
It is favored by developers and system administrators for its speed, precision, and ability to automate complex workflows through scripting. While it requires an understanding of specific command syntax, it offers direct control over a system’s underlying architecture that visual interfaces often lack.
What is the Megaport CLI?
The Megaport CLI gives you direct, programmable access to the Megaport software-defined networking platform from your terminal. Whether you are provisioning a single Port or automating a multicloud network across three continents, you can do it from the command line.
Detailed guidance on installation, authentication, first commands, core concepts, tutorials, live demos, and reference material is available at Master the Megaport CLI.
What are the key benefits of Megaport CLI?
The Megaport CLI enhances speed and efficiency by replacing multi-step web wizards with single-command executions, allowing you to manage network resources in seconds without navigating the Portal.
Built with an automation-first approach, the Megaport CLI integrates into Continuous Integration (CI) and Continuous Deployment (CD) pipelines and Infrastructure as Code (IaC) workflows.
The Megaport CLI is suitable for network engineers, cloud and platform engineers, DevOps and site reliability engineers, solution architects, and other technical roles.
What can you do with the Megaport CLI?
The Megaport CLI provides access to Megaport services and account configuration.
For example:
-
Provision and manage infrastructure — Create and manage Ports, VXCs, MCRs, MVEs, Internet Exchange connections, NAT Gateways and other services.
-
Connect to any CSP — Enable multicloud connections such as AWS Direct Connect, Azure ExpressRoute, Google Cloud Interconnect, and so on.
-
Troubleshoot MCR routing — Use the MCR Looking Glass commands to view IP and BGP routes, check the routes advertised to or received from a BGP neighbor, and run ping and traceroute tests from an MCR.
In addition, the Megaport CLI offers several features that are not available in the Portal:
-
Explore the network — Browse more than 1,100 locations across 30 countries and list CSPs and their port configurations.
-
Automate operations — Use script-friendly input and output for managing CI and CD pipelines. The CLI supports three input modes: interactive prompts, CLI flags, and JSON input through
--json (inline) or --json-file (file-based). You can format the output as a table, JSON, CSV, or XML, or use a custom Go template.
-
Provision from a configuration file — Define multiple Ports, MCRs, MVEs, and VXCs in a single YAML or JSON file, then provision them all with the
apply command. The CLI creates the resources in dependency order. You can also validate the file before provisioning and choose to have the CLI delete the created resources automatically if provisioning fails.
-
Run it anywhere — Run the CLI natively on all major operating systems, in Docker containers, or in a web browser through WebAssembly. The browser version does not support the
apply command or file-based input such as --json-file.
Helpful references
Last modified on October 1, 2026