{"id":15340,"date":"2023-09-25T08:17:01","date_gmt":"2023-09-25T15:17:01","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=15340"},"modified":"2023-09-25T08:20:02","modified_gmt":"2023-09-25T15:20:02","slug":"microsoft-graph-cli-v1-0-0-release-candidate-now-with-beta-support","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-cli-v1-0-0-release-candidate-now-with-beta-support\/","title":{"rendered":"Announcing Microsoft Graph CLI v1.0.0 release candidate, now with beta support"},"content":{"rendered":"<p>We&#8217;re excited to introduce the Microsoft Graph CLI v1.0.0 release candidate. Following the successful public preview phase, we&#8217;ve provided Graph Beta endpoints, and expanded distribution options, including publication on <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Graph.Cli\">NuGet<\/a>, introducing new features, and addressing various bugs.<\/p>\n<p>Microsoft Graph CLI v1.0.0 provides convenient methods to access Microsoft Graph API capabilities on any operating system and any shell. Microsoft Graph CLI can be used in a variety of scenarios, from quick one-off tasks to complex automation scripts. It supports a wide range of features, including authentication, data retrieval, and data manipulation.<\/p>\n<h2>What\u2019s new?<\/h2>\n<p>We are excited to share updates for Microsoft Graph CLI that will enhance your experience and streamline your workflow:<\/p>\n<p><strong>NuGet Availability:<\/strong> Microsoft Graph CLI is now conveniently available on <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Graph.Cli\">NuGet<\/a>. You can get started with just a few simple commands for easier installation.<\/p>\n<p><code>dotnet tool install --global Microsoft.Graph.Cli --prerelease<\/code><\/p>\n<p><strong>Microsoft Graph CLI beta support:<\/strong> For those who want to explore the Graph Beta experience, we have good news. The CLI Beta is now accessible through the <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-beta-cli\">msgraph-beta-cli GitHub repo<\/a>. This opens up new possibilities for testing and leveraging cutting-edge features and functionalities.<\/p>\n<p><strong>Header support:<\/strong> We understand the importance of fine-tuning your interactions with Microsoft Graph, and that&#8217;s why we&#8217;ve introduced comprehensive header support. With the new <code><strong><em>--headers<\/em><\/strong><\/code> option, you have more control over your CLI experience. Customize headers as needed to align perfectly with your specific requirements and use cases.<\/p>\n<h2>Cross platform support<\/h2>\n<p>Microsoft Graph CLI works on any terminal. We recommend:<\/p>\n<ul>\n<li><a href=\"https:\/\/apps.microsoft.com\/store\/detail\/windows-terminal\/9N0DX20HK701?hl=en-us&amp;gl=us\">Windows Terminal + version<\/a><\/li>\n<li>MacOS (Minimum version: 10.12 Sierra) terminal<\/li>\n<li>PowerShell version 7.3.2<\/li>\n<\/ul>\n<h3>Installation<\/h3>\n<p>Get the CLI from <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Graph.Cli\">NuGet<\/a> OR Download the CLI executable or Docker image from GitHub Repo releases <strong>assets<\/strong> link:\u00a0<a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/releases\">CLI Download<\/a>. Find platform specific installation details on the <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli#installation\">CLI Read Me<\/a> installation steps.<\/p>\n<p><strong>Optional: <\/strong><\/p>\n<p>Follow the instructions in\u00a0<a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/blob\/main\/register-app.md\">Register an application for Microsoft identity platform authentication<\/a>\u00a0to get an application ID (also known as a client ID).<\/p>\n<p>Replace\u00a0YOUR_CLIENT_ID\u00a0with the client ID from your app registration.<\/p>\n<h2>Multiple authentication options<\/h2>\n<p>The Microsoft Graph CLI supports multiple authentication options to suit different scenarios for both Delegated and App only experiences.<\/p>\n<p>To view supported authentication options, run the following command.<\/p>\n<p><code>mgc login \u2013help<\/code><\/p>\n<p>Delegated authentication options<\/p>\n<p>1. Interactive Browser Authentication<\/p>\n<p>Use this method to authenticate interactively by entering your Microsoft 365 credentials in a web browser.<\/p>\n<p><code>mgc login \u2013-strategy InteractiveBrowser<\/code><\/p>\n<p>2. Device Code Authentication (default auth option)<\/p>\n<p>Use this method if you&#8217;re unable to authenticate directly through a web browser and need to authenticate on a separate device.<\/p>\n<p><code>mgc login -\u2013strategy DeviceCode<\/code><\/p>\n<p>App-only authentication options<\/p>\n<p>1. Client Certificate authentication<\/p>\n<p><span class=\"TextRun Highlight SCXW40358202 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW40358202 BCX8\" data-ccp-charstyle=\"Strong\">Supports client certificate login and is used by client application to authenticate itself <\/span><\/span> <span class=\"TextRun Highlight SCXW40358202 BCX8\" lang=\"EN-US\" xml:lang=\"EN-US\" data-contrast=\"none\"><span class=\"NormalTextRun SCXW40358202 BCX8\" data-ccp-charstyle=\"Strong\">using a client ID.<\/span><\/span><span class=\"EOP SCXW40358202 BCX8\" data-ccp-props=\"{&quot;134233117&quot;:true,&quot;134233118&quot;:true,&quot;201341983&quot;:0,&quot;335559740&quot;:240}\">\u00a0<\/span><\/p>\n<p><code>mgc login --strategy ClientCertificate<\/code><\/p>\n<p>2. Environment login<\/p>\n<p>Supports both certificate files and client secret using environment variables and is used by client application to authenticate itself using a client ID.<\/p>\n<p><code>mgc login --strategy Environment<\/code><\/p>\n<p>Supported environment variables are:<\/p>\n<ul>\n<li>\n<ul>\n<li>AZURE_TENANT_ID<\/li>\n<li>AZURE_CLIENT_ID<\/li>\n<li>AZURE_CLIENT_SECRET<\/li>\n<li>AZURE_CLIENT_CERTIFICATE_PATH<\/li>\n<li>AZURE_CLIENT_CERTIFICATE_PASSWORD<\/li>\n<li>AZURE_CLIENT_SEND_CERTIFICATE_CHAIN<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>Support for multiple output formats<\/h3>\n<p>Several output formats are supported using the <code><strong><em>--output<\/em><\/strong><\/code> option which can display data as JSON (default), table or text.<\/p>\n<p>Output table format<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-15341\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1.png\" alt=\"Screenshot of code, Output table format\" width=\"2500\" height=\"681\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1.png 2500w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1-300x82.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1-1024x279.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1-768x209.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1-1536x418.png 1536w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-1-2048x558.png 2048w\" sizes=\"(max-width: 2500px) 100vw, 2500px\" \/><\/p>\n<p>Output JSON format<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-15342\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2.png\" alt=\"Screenshot of code, output JSON format\" width=\"2412\" height=\"1733\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2.png 2412w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2-300x216.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2-1024x736.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2-768x552.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2-1536x1104.png 1536w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-2-2048x1471.png 2048w\" sizes=\"(max-width: 2412px) 100vw, 2412px\" \/><\/p>\n<p>You can turn off Indent JSON responses using the\u00a0<code><strong><em>--json-no-indent\u00a0<\/em><\/strong><\/code>argument for the JSON output formatter.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-15343\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3.png\" alt=\"Screenshot with code showinghow one can turn off Indent JSON responses using the --json-no-indent argument for the JSON output formatter.\" width=\"2500\" height=\"327\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3.png 2500w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3-300x39.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3-1024x134.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3-768x101.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3-1536x201.png 1536w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-3-2048x268.png 2048w\" sizes=\"(max-width: 2500px) 100vw, 2500px\" \/><\/p>\n<h2>Navigate the CLI<\/h2>\n<p>Once installed, you can start using the Microsoft Graph CLI to interact with the Microsoft Graph API. Here are some examples of common commands:<\/p>\n<ul>\n<li>To check permissions for scopes, add <code><strong>-h<\/strong><\/code> to your command to view information that contains documentation links with permissions.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-15344\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4.png\" alt=\"Screenshot of code: Microsoft Graph CLI interacting with the Microsoft Graph API. An examples of common commands: add -h to your command to view information that contains documentation links with permissions.\" width=\"3179\" height=\"1573\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4.png 3179w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4-300x148.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4-1024x507.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4-768x380.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4-1536x760.png 1536w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/09\/word-image-15340-4-2048x1013.png 2048w\" sizes=\"(max-width: 3179px) 100vw, 3179px\" \/><\/p>\n<ul>\n<li>To check logged in user, access the logged in user&#8217;s details using:<\/li>\n<\/ul>\n<p><code>mgc me get<\/code><\/p>\n<ul>\n<li>To get information about a specific user, use the `user` command with the user&#8217;s ID or email address:<\/li>\n<\/ul>\n<p><code>mgc user get --id &lt;user_id&gt;<\/code><\/p>\n<ul>\n<li>To create a new group, use the `group` command with the desired group name:<\/li>\n<\/ul>\n<p><code>mgc group create --name &lt;group_name&gt;<\/code><\/p>\n<ul>\n<li>To upload a file to OneDrive, use the `drive item` command with the file path and destination drive:<\/li>\n<\/ul>\n<p><code>mgc drive item upload --path &lt;file_path&gt; --drive &lt;drive_id&gt;<\/code><\/p>\n<p>For a complete list of available commands and options, refer to the <a href=\"https:\/\/learn.microsoft.com\/en-us\/graph\/cli\/overview\">CLI documentation<\/a>. You can also add <code><strong>--debug<\/strong><\/code> to your command to get more details on your interactions.<\/p>\n<h3>Samples<\/h3>\n<p>You can find more samples here (contain sample commands for CMD, PowerShell, and Bash) <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/tree\/main\/samples\">Microsoft Graph CLI samples<\/a><\/p>\n<h2>Changelog<\/h2>\n<p>This new release also includes bug fixes included in detailed change log here:<\/p>\n<h3>v1.0.0-preview2.<\/h3>\n<ul>\n<li>Added headers support via the\u00a0&#8211;headers\u00a0option.<\/li>\n<li>Fix bug with sites command crashing during parse.<\/li>\n<\/ul>\n<p>See <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/blob\/v1.0.0-preview.2\/CHANGELOG.md#100-preview2---2023-09-06\">full change log<\/a><\/p>\n<h3>v1.0.0-preview1 (Public Preview)<\/h3>\n<p>Additional capabilities supported in this release include:<\/p>\n<ul>\n<li>Support for JMESPath queries via the\u00a0<code>--query<\/code>\u00a0option<\/li>\n<\/ul>\n<p><code>mgc users list --query \"value[].{Name: displayName, Email: mail}\"<\/code><\/p>\n<ul>\n<li>Header command options can now be called multiple times. The header values will now be additive.<\/li>\n<li>Contains documentation links to API reference.<\/li>\n<li>Add automatic page iteration via the\u00a0&#8211;all\u00a0command option.<\/li>\n<\/ul>\n<h2>Additional resources to help you get started:<\/h2>\n<ol>\n<li>Explore the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/graph\/cli\/overview\" target=\"_blank\" rel=\"noopener\">documentation<\/a>, where you can find how to install the SDK, authenticate, discover which API a command is calling and more.<\/li>\n<li>Use\u00a0<a href=\"https:\/\/aka.ms\/ge\" target=\"_blank\" rel=\"noopener\">Microsoft Graph Explorer<\/a>, a tool that lets you make requests and see responses against Microsoft Graph, and which displays corresponding snippets to requests you make.<\/li>\n<li>Visit the\u00a0<a href=\"https:\/\/developer.microsoft.com\/graph\">Microsoft Graph Dev Center<\/a>.<\/li>\n<\/ol>\n<h2>Feedback and Bug Reports<\/h2>\n<p>We welcome your feedback and bug reports for this release candidate version. If you encounter any issues or have suggestions for improvement, please open an issue on the <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/issues\">GitHub repository<\/a>.<\/p>\n<p>Happy coding!<\/p>\n<p>Follow us on <a href=\"https:\/\/twitter.com\/Microsoft365Dev\">X | @Microsoft365Dev<\/a> for the latest news and updates.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This release candidate provides Graph Beta endpoints, expanded distribution options including publication on NuGet, new features, and bug fixes.<\/p>\n","protected":false},"author":117208,"featured_media":15384,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[254],"class_list":["post-15340","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-microsoft-graph-cli"],"acf":[],"blog_post_summary":"<p>This release candidate provides Graph Beta endpoints, expanded distribution options including publication on NuGet, new features, and bug fixes.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/15340","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/users\/117208"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=15340"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/15340\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/15384"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=15340"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=15340"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=15340"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}