

Announcing Microsoft Graph CLI SDK v1.0.0-preview release candidate
source link: https://devblogs.microsoft.com/microsoft365dev/announcing-microsoft-graph-cli-sdk-v1-0-0-preview-release-candidate/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Announcing Microsoft Graph CLI SDK v1.0.0-preview release candidate

Carol Mbasinge Kigoonya
Simplify Microsoft Graph interactions with the intuitive Microsoft Graph CLI SDK now in preview. Microsoft Graph CLI SDK is a command-line tool, generated by Kiota, that provides convenient methods to access Microsoft Graph API capabilities on any operating system and any shell.
The CLI SDK 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. Check out what more you can do.
Cross platform support for the Microsoft Graph CLI SDK
The CLI tool should work on any terminal. We recommend:
- Windows Terminal + version
- MacOS (Minimum version: 10.12 Sierra) terminal
- PowerShell version 7.3.2
Installation
Download the CLI SDK to get started for Windows, Mac, Linux or Docker on the assets link of the latest release: CLI SDK Download. Find platform specific nuances on the CLI Read Me.
Optional:
Follow the instructions in Register an application for Microsoft identity platform authentication to get an application ID (also known as a client ID).
Replace YOUR_CLIENT_ID with the client ID from your app registration.
Multiple authentication options for the Microsoft Graph CLI SDK
The CLI SDK supports multiple authentication options to suit different scenarios for both Delegated and App only experiences.
To view supported authentication options, run the following command
mgc login –help
Delegated authentication options
- Interactive Browser Authentication:
Use this method if you want to authenticate interactively by entering your Microsoft 365 credentials in a web browser.
mgc login –-strategy InteractiveBrowser
- Device Code Authentication (default auth option)
Use this method if you’re unable to authenticate directly through a web browser and need to authenticate on a separate device.
mgc login –strategy DeviceCode
App-only authentication options
- Client Certificate authentication
mgc login --strategy ClientCertificate
- Environment login
Supports both certificate files and client secret using environment variables and is used by client application that needs to authenticate itself using a client ID.
mgc login --strategy Environment
Supported environment variables are:
- AZURE_TENANT_ID
- AZURE_CLIENT_ID
- AZURE_CLIENT_SECRET
- AZURE_CLIENT_CERTIFICATE_PATH
- AZURE_CLIENT_CERTIFICATE_PASSWORD
- AZURE_CLIENT_SEND_CERTIFICATE_CHAIN
Support for multiple output formats
Several output formats are supported using the –output option which can display data as JSON (default), table or text.
You can turn off Indent JSON responses using the –json-no-indent argument for the JSON output formatter.
Usage
Once installed, you can start using the Microsoft Graph CLI to interact with the Microsoft Graph API. Here are some examples of common commands:
- To check permissions for scopes Add -h to your command to view information that contains documentation links with permissions.
- To check logged in user
You can access the logged in user’s details using:
mgc me get
- To get information about a specific user, use the `user` command with the user’s ID or email address:
mgc user get --id <user_id>
- To create a new group, use the `group` command with the desired group name:
mgc group create --name <group_name>
- To upload a file to OneDrive, use the `drive item` command with the file path and destination drive:
mgc drive item upload --path <file_path> --drive <drive_id>
For a complete list of available commands and options, refer to the CLI documentation. You can also add –debug to your command to get more details on your interactions.
Samples
You can find additional samples here (contain sample commands for CMD, PowerShell & Bash) CLI SDK samples
Feedback and bug reports
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 GitHub repository.
Changelog
v1.0.0-preview1 (Public Preview)
Additional capabilities supported in this release include:
- support for JMESPath queries via the –query option
mgc users list --query "value[].{Name: displayName, Email: mail}"
- Header command options can now be called multiple times. The header values will now be additive.
- Contains documentation links to API reference.
- Add automatic page iteration via the –all command option.
Roadmap
The final stable release of the Microsoft Graph CLI SDK will be available by September 2023. We are incorporating feedback and addressing reported issues to provide a reliable and efficient tool for developers. Stay tuned for further updates!
Follow us on Twitter @Microsoft365Dev to stay up to date on news and announcements. Thank you for trying out the Microsoft Graph CLI SDK release candidate.
Happy coding!
Carol Mbasinge Kigoonya Senior Product Manager
Follow
Recommend
-
10
Announcing PowerShell Crescendo Release Candidate (RC) Jason December 9th, 2021 Announcing Crescendo 0.9.0 Release Can...
-
5
Microsoft releases Visual Studio 2022 for Mac Release Candidate 2 with multiple bug fixes...
-
5
Announcing .NET 7 Release Candidate 1 Jeremy Likness
-
10
Announcing Entity Framework 7 Release Candidate 1 Jeremy Likness
-
4
SQL Server 2022 Release Candidate 1 is now available SQL Server 2022 Release Candidate 1 is now available ...
-
7
Announcing .NET 7 Release Candidate 2 Jon Douglas
-
5
Announcing the new SharePoint Pages API in Microsoft Graph Share...
-
12
Microsoft Releases Final Release Candidate for ASP.NET Core 7 Nov 04, 2022...
-
8
Announcing Microsoft Graph Toolkit v3.0 preview-1 Sébasti...
-
8
We're excited to announce the general availability of several Windows 365 APIs in the Microsoft Graph v1.0 endpoint! What’s new? Microsoft Graph APIs for Windows 365 can be used to tailor Windows 365 managem...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK