{"id":6533,"date":"2021-07-09T10:21:07","date_gmt":"2021-07-09T18:21:07","guid":{"rendered":"https:\/\/officedevblogs.wpengine.com\/?p=6533"},"modified":"2021-07-09T10:21:07","modified_gmt":"2021-07-09T18:21:07","slug":"access-microsoft-graph-through-a-new-preview-cli","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/access-microsoft-graph-through-a-new-preview-cli\/","title":{"rendered":"Access Microsoft Graph through a new preview CLI"},"content":{"rendered":"<p><span data-contrast=\"auto\">We\u2019re excited to\u00a0bring\u00a0an alternative to PowerShell\u00a0<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-contrast=\"auto\">and JMESPath capabilities to you with the preview new command line interface (CLI) for Microsoft Graph. <\/span><span data-ccp-props=\"{&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">If you\u2019re looking for an alternative command line experience to access Microsoft Graph in a way that doesn\u2019t take a dependency <\/span><span data-contrast=\"auto\">on installation of\u00a0<\/span><span data-contrast=\"auto\">the PowerShell core,\u00a0Microsoft Graph CLI is\u00a0your answer.\u00a0With the CLI,\u00a0you can use your favorite command line<\/span><span data-contrast=\"auto\">&#8211;<\/span><span data-contrast=\"auto\">based\u00a0JSON\u00a0tool to handle\u00a0the\u00a0table and JSON outputs\u00a0as an alternative to the object output provided in PowerShell.\u00a0<\/span><span data-ccp-props=\"{&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">If\u00a0you\u2019ve been using\u00a0JMESPath, the CLI supports the use of\u00a0JMESPath\u00a0to customize your output without needing to set up the\u00a0JMESPath.<\/span><span data-ccp-props=\"{&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<pre class=\"lang: decode:true \"> $ mgc users user list --query \"[?userType=='Member'].{name:\u00a0displayName, email: mail}\" --output table<\/pre>\n<p><span data-contrast=\"auto\">And if you\u2019re just getting started\u00a0with\u00a0Microsoft Graph and are looking for a language agnostic, cross-platform\u00a0command line solution with simplified commands\u00a0to access Microsoft Graph, the CLI is\u00a0for\u00a0you.<\/span><span data-ccp-props=\"{&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n<h4><span data-contrast=\"none\">Be\u00a0<\/span><span data-contrast=\"none\">one of\u00a0<\/span><span data-contrast=\"none\">the first to try it<\/span><span data-contrast=\"none\">!<\/span><span data-contrast=\"none\">\u00a0<\/span><\/h4>\n<p><span data-contrast=\"auto\">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 <\/span><span data-contrast=\"auto\">this preview\u00a0<\/span><span data-contrast=\"auto\">version 0.1.4 of the Microsoft Graph CLI, we cover <\/span><span data-contrast=\"auto\">the most common\u00a0Microsoft Graph scenarios<\/span><span data-contrast=\"auto\">,<\/span><span data-contrast=\"auto\"> such as mail, users, and identity management<\/span><span data-contrast=\"auto\">;<\/span><span data-contrast=\"auto\"> we aim to add support for all features\u00a0in the future.\u00a0For a\u00a0comprehensive list of\u00a0supported and unsupported features\u00a0in this version, see\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/wiki\/Microsoft-Graph-CLI-Release-Support-0.1.4\"><span data-contrast=\"none\">Microsoft Graph CLI Preview Release Support<\/span><\/a><span data-contrast=\"none\">.<\/span><span data-contrast=\"auto\">\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">The preview version of the CLI is on Windows. Installation support on\u00a0 MacOS, Linux, and Docker is <\/span><a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/milestone\/8\"><span data-contrast=\"none\">coming soon<\/span><\/a><span data-contrast=\"auto\">.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">Whether you\u2019re new to\u00a0Microsoft\u00a0Graph or\u00a0are looking to include the Microsoft Graph CLI into your tooling, we\u2019re working to\u00a0make\u00a0sure you have an awesome experience.\u00a0<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">For getting\u00a0started information and installation instructions, see\u00a0the\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/blob\/dev\/README.md\"><span data-contrast=\"none\">Microsoft Graph CLI readme<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<p><span data-contrast=\"auto\">To try out\u00a0code samples,\u00a0see the\u00a0<\/span><a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/tree\/main\/docs\/samples\"><span data-contrast=\"none\">samples folder<\/span><\/a><span data-contrast=\"auto\">.<\/span><span data-ccp-props=\"{}\">\u00a0<\/span><\/p>\n<h3><span data-contrast=\"none\">Contribute to the future of the Microsoft Graph\u00a0CLI<\/span><span data-ccp-props=\"{&quot;335559738&quot;:40}\">\u00a0<\/span><\/h3>\n<p><span data-contrast=\"auto\">As we continue to work on improving the CLI experience, your feedback is\u00a0important\u00a0to us.\u00a0Try\u00a0the CLI and\u00a0tell us what you think!\u00a0You can\u00a0provide feedback\u00a0by <a href=\"https:\/\/github.com\/microsoftgraph\/msgraph-cli\/issues\">submitting an issue<\/a>\u00a0in our GitHub repository.<\/span><span data-ccp-props=\"{&quot;335559740&quot;:259}\">\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We\u2019re excited to\u00a0bring\u00a0an alternative to PowerShell\u00a0\u00a0and JMESPath capabilities to you with the preview new command line interface (CLI) for Microsoft Graph. \u00a0<\/p>\n","protected":false},"author":69077,"featured_media":25159,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-6533","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-graph"],"acf":[],"blog_post_summary":"<p>We\u2019re excited to\u00a0bring\u00a0an alternative to PowerShell\u00a0\u00a0and JMESPath capabilities to you with the preview new command line interface (CLI) for Microsoft Graph. \u00a0<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6533","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\/69077"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/comments?post=6533"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/posts\/6533\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media\/25159"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/media?parent=6533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/categories?post=6533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/microsoft365dev\/wp-json\/wp\/v2\/tags?post=6533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}