Access Microsoft Graph through a new preview CLI

Microsoft Graph team

We’re excited to bring an alternative to PowerShell  and JMESPath capabilities to you with the preview new command line interface (CLI) for Microsoft Graph.  

If you’re looking for an alternative command line experience to access Microsoft Graph in a way that doesn’t take a dependency on installation of the PowerShell core, Microsoft Graph CLI is your answer. With the CLI, you can use your favorite command linebased JSON tool to handle the table and JSON outputs as an alternative to the object output provided in PowerShell.  

If you’ve been using JMESPath, the CLI supports the use of JMESPath to customize your output without needing to set up the JMESPath. 

 $ mgc users user list --query "[?userType=='Member'].{name: displayName, email: mail}" --output table

And if you’re just getting started with Microsoft Graph and are looking for a language agnostic, cross-platform command line solution with simplified commands to access Microsoft Graph, the CLI is for you. 

Be one of the first to try it! 

The Microsoft Graph CLI uses the tool chain used in some of your favorite command line tools (Azure CLI and Microsoft Graph PowerShell) to provide access to the Microsoft Graph API. In this preview version 0.1.4 of the Microsoft Graph CLI, we cover the most common Microsoft Graph scenarios, such as mail, users, and identity management; we aim to add support for all features in the future. For a comprehensive list of supported and unsupported features in this version, see Microsoft Graph CLI Preview Release Support.  

The preview version of the CLI is on Windows. Installation support on  MacOS, Linux, and Docker is coming soon 

Whether you’re new to Microsoft Graph or are looking to include the Microsoft Graph CLI into your tooling, we’re working to make sure you have an awesome experience.  

For getting started information and installation instructions, see the Microsoft Graph CLI readme. 

To try out code samples, see the samples folder. 

Contribute to the future of the Microsoft Graph CLI 

As we continue to work on improving the CLI experience, your feedback is important to us. Try the CLI and tell us what you think! You can provide feedback by submitting an issue in our GitHub repository. 

Feedback usabilla icon