{"id":16510,"date":"2023-11-22T08:00:50","date_gmt":"2023-11-22T16:00:50","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/?p=16510"},"modified":"2023-11-22T08:12:27","modified_gmt":"2023-11-22T16:12:27","slug":"microsoft-graph-cli-v1-0-0-is-now-generally-available","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-cli-v1-0-0-is-now-generally-available\/","title":{"rendered":"Microsoft Graph CLI v1.0.0 is now generally available"},"content":{"rendered":"<p>We are thrilled to announce that Microsoft Graph CLI, the command-line tool that provides convenient methods to access Microsoft Graph API capabilities on any operating system and any shell, is <strong>now in general availability<\/strong>. We announced <a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/announcing-microsoft-graph-cli-sdk-v1-0-0-preview-release-candidate\/\">v1.0.0 preview<\/a> in June and CLI <a href=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/microsoft-graph-cli-v1-0-0-release-candidate-now-with-beta-support\/\">v1.0.0 Release Candidate<\/a> in September and have since addressed feedback, resolved bugs and added features.<\/p>\n<h2>What&#8217;s new?<\/h2>\n<p>The v1.0.0 release candidate includes the following changes and improvements:<\/p>\n<ul>\n<li><strong>Added authentication options:<\/strong> Added managed identity to app-only authentication options. Multiple authentication options help unlock multiple authentication options to support your desired user experiences. The CLI now supports to Delegated authentication options (Device code flow and Interactive browser) and App-only authentication options (Client Secret, Environment Variables and Managed Identity) to connect to Microsoft Graph.<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/CarolKigoonya\/53b6b80a2fe0f82910ecc76a8719f0fb.js\"><\/script><\/p>\n<ul>\n<li><strong>Output improvements:<\/strong> Improved efficiency when interacting\/manipulating output by adding \u201c<code>raw_json<\/code>\u201d as an output option, removing quotes from output, reducing verbose logging, improving error messages on authentication failure, and changing output encoding to\u00a0utf-8\u00a0for better compatibility with other tools like\u00a0jq.<\/li>\n<\/ul>\n<p>Available output options are <code>table<\/code>, <code>raw_json<\/code>, <code>json<\/code>, <code>text<\/code>, <code>none<\/code>.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/CarolKigoonya\/34e9f794093e440471e96946d35e4719.js\"><\/script><\/p>\n<p><img decoding=\"async\" width=\"1429\" height=\"520\" class=\"wp-image-16511\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-screenshot-of-a-computer-description-automatica-14.png\" alt=\"A screenshot of a computer Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-screenshot-of-a-computer-description-automatica-14.png 1429w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-screenshot-of-a-computer-description-automatica-14-300x109.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-screenshot-of-a-computer-description-automatica-14-1024x373.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-screenshot-of-a-computer-description-automatica-14-768x279.png 768w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/p>\n<ul>\n<li><strong>Added \u201cme\u201d command:<\/strong> Support for the me command that calls the \u201cme\u201d endpoint for a signed in user to get information about themselves (similar to what you get under users resource e.g. my id, names, calendars, contacts, drives, events etc)<\/li>\n<\/ul>\n<p><img decoding=\"async\" width=\"772\" height=\"317\" class=\"wp-image-16512\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-2.png\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-2.png 772w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-2-300x123.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-2-768x315.png 768w\" sizes=\"(max-width: 772px) 100vw, 772px\" \/><\/p>\n<ul>\n<li><strong>Microsoft Graph CLI beta support:<\/strong>\u00a0Explore the Graph Beta experience, CLI Beta is now accessible through the\u00a0<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.<\/li>\n<li><strong>Header support:<\/strong>\u00a0Fine-tune your Microsoft Graph interactions with comprehensive header support. With the new\u00a0<em>&#8211;headers<\/em>\u00a0option, you have more control over your CLI experience. Customize headers as needed to align perfectly with your specific requirements and use cases.<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/CarolKigoonya\/637d1fd1ad1b3802f638cef7154f72aa.js\"><\/script><\/p>\n<p><strong><em>Sample request<\/em><\/strong><\/p>\n<p><img decoding=\"async\" width=\"1619\" height=\"120\" class=\"wp-image-16513\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-3.png\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-3.png 1619w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-3-300x22.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-3-1024x76.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-3-768x57.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-3-1536x114.png 1536w\" sizes=\"(max-width: 1619px) 100vw, 1619px\" \/><\/p>\n<p><strong><em>Sample response<\/em><\/strong><\/p>\n<p><img decoding=\"async\" width=\"1927\" height=\"384\" class=\"wp-image-16514\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-black-and-white-screen-description-automaticall.png\" alt=\"A black and white screen Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-black-and-white-screen-description-automaticall.png 1927w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-black-and-white-screen-description-automaticall-300x60.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-black-and-white-screen-description-automaticall-1024x204.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-black-and-white-screen-description-automaticall-768x153.png 768w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/a-black-and-white-screen-description-automaticall-1536x306.png 1536w\" sizes=\"(max-width: 1927px) 100vw, 1927px\" \/><\/p>\n<h2>Get Started<\/h2>\n<h3>Prerequisites<\/h3>\n<p>The CLI tool should work on any terminal. We recommend:<\/p>\n<ul>\n<li>Windows Terminal 1.18<\/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>Download the CLI to get started for Windows, Mac, Linux or Docker on the assets link of the latest release:<\/p>\n<ul>\n<li>Windows: <a href=\"https:\/\/aka.ms\/get\/graphcli\/latest\/win-x64.zip\">https:\/\/aka.ms\/get\/graphcli\/latest\/win-x64.zip<\/a><\/li>\n<li>Linux: <a href=\"https:\/\/aka.ms\/get\/graphcli\/latest\/linux-x64.zip\">https:\/\/aka.ms\/get\/graphcli\/latest\/linux-x64.zip<\/a><\/li>\n<li>macOS xarm64: <a href=\"https:\/\/aka.ms\/get\/graphcli\/latest\/osx-arm64.zip\">https:\/\/aka.ms\/get\/graphcli\/latest\/osx-arm64.zip<\/a><\/li>\n<li>macOS x64: <a href=\"https:\/\/aka.ms\/get\/graphcli\/latest\/osx-x64.zip\">https:\/\/aka.ms\/get\/graphcli\/latest\/osx-x64.zip<\/a><\/li>\n<\/ul>\n<p>Find platform specific installation nuances on the\u00a0<a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\">CLI Read Me<\/a>.<\/p>\n<p>To learn how to use the CLI, check out the <a href=\"https:\/\/learn.microsoft.com\/en-us\/graph\/cli\/overview?context=graph%2Fapi%2F1.0&amp;view=graph-rest-1.0\">CLI documentation<\/a> and additional <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/tree\/main\/samples\" target=\"_blank\" rel=\"noopener\">CLI samples<\/a> from our GitHub repository (contains sample commands for CMD, PowerShell &amp; Bash).<\/p>\n<h2>Usage<\/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\u00a0<strong>-h<\/strong>\u00a0to your command to view information that contains <strong>documentation links<\/strong> with permissions.<\/li>\n<li>To get information about a specific user, use the `user` command with the user\u2019s ID or email address:\n<code>\u00a0mgc user get --id &lt;user_id&gt;<\/code><\/li>\n<\/ul>\n<p><img decoding=\"async\" width=\"1197\" height=\"412\" class=\"wp-image-16515\" src=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-5.png\" srcset=\"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-5.png 1197w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-5-300x103.png 300w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-5-1024x352.png 1024w, https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-content\/uploads\/sites\/73\/2023\/11\/word-image-16510-5-768x264.png 768w\" sizes=\"(max-width: 1197px) 100vw, 1197px\" \/><\/p>\n<ul>\n<li>To create a new group, use the `<code>group<\/code>` 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<ul>\n<li>For a complete list of available commands and options, refer to the CLI documentation. You can also add\u00a0<code>\u2013debug<\/code>\u00a0to your command to get more details on your interactions.<\/li>\n<\/ul>\n<h2>Additional resources<\/h2>\n<ul>\n<li>Explore the\u00a0<a href=\"https:\/\/learn.microsoft.com\/en-us\/graph\/cli\/overview\">documentation<\/a>, where you can find how to install the CLI, 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\" target=\"_blank\" rel=\"noopener\">Microsoft Graph Dev Center<\/a>.<\/li>\n<li>Follow us on <a href=\"http:\/\/twitter.com\/microsoft365dev\">X (Twitter) \/ @Microsoft365Dev<\/a> for the latest updates.<\/li>\n<\/ul>\n<h2>Feedback and bug reports<\/h2>\n<p>You can report issues, ask questions, or request features on <a href=\"https:\/\/github.com\/microsoftgraph\/microsoft-graph-toolkit\/releases\">Microsoft Graph GitHub repository<\/a>. Thank you for your support and feedback!<\/p>\n<p>Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft Graph CLI, the command-line tool that provides convenient methods to access Microsoft Graph API capabilities on any operating system and any shell, is now available.<\/p>\n","protected":false},"author":117208,"featured_media":16517,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[254],"class_list":["post-16510","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph","tag-microsoft-graph-cli"],"acf":[],"blog_post_summary":"<p>Microsoft Graph CLI, the command-line tool that provides convenient methods to access Microsoft Graph API capabilities on any operating system and any shell, is now available.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/16510","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=16510"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/16510\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/16517"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=16510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=16510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=16510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}