microsoft-graph-cli
An unofficial command line utility for accessing the Microsoft Graph, written with Deno and Typescript
Installation
Before You Get Started
Ensure Deno 1.5.4 installed. If you don't have Deno installed yet, follow the Deno installation guide.
This CLI should work on Mac OS, Linux, and Windows operating systems. However, it has only been tested on macOS Catalina v.10.15.7. If you run into any problems, please open an issue.
Use Deno Install (Preferred)
If you'd like to install this project as an executable in your path, run:
deno install --unstable [permissions] -n mgraph https://deno.land/x/microsoft_graph_cli/cli.ts
- Replace
[permissions]
in this command with any permissions you wish to grant to the CLI. See Permissions for all optional and required permissions and their rationale. Example:--allow-net --allow-read --allow-write
- (Optional) If you would like to grant all permissions to this CLI, you may replace
[permissions]
with--allow-all
. This will prevent errors if future versions require new permissions, but is considered less secure. - (Optional) You may install this cli with a different executable name by replace
mgraph
with a name of your choice. If you do so, make sure to replacemgraph
with your selected name in all usage examples.
Use Deno Run
If you don't wish to use deno install, replace any instances of mgraph
in the usage examples with:
deno run --unstable [permissions] https://deno.land/x/microsoft_graph_cli/cli.ts
- Replace
[permissions]
in this command with any permissions you wish to grant to the CLI. See Permissions for all optional and required permissions and their rationale. Example:--allow-net --allow-read --allow-write
- (Optional) If you would like to grant all permissions to this CLI, you may replace
[permissions]
with--allow-all
. This will prevent errors if future versions require new permissions, but is considered less secure.
Usage
Run mgraph --help
for a full list of all commands and parameters.
Permissions
The following permissions are used by this CLI for the following reasons:
Name | Reason |
---|---|
--allow-env | Detect the cache directory to cache tokens and maintain login state. |
--allow-net | Make API calls to the Microsoft Graph. |
Host a local server for interactive authentication. | |
--allow-read | Read cached tokens and maintain login state. |
Read configuration files. | |
Output results to files. | |
--allow-run | Automatically open the user's default browser for interactive authentication. |
--allow-write | Cache tokens and maintain login state. |
Output results to files. |
Acknowledgements
The following projects and resources made this project possible (alphabetical order):
- all-contributors: Generates the Contributors badge and lists contributors in the readme.
- Deno: The runtime and a dependency host for this project.
- deno_cache_dir: Returns the path to the user's cache directory.
- deno_free_port: Gets an available port.
- Microsoft Graph JavaScript Client Library
- Microsoft Graph TypeScript Types: Provides TypeScript definitions for Microsoft Graph objects.
- oak: A middleware framework for Deno.
- OAuth2 Client for Deno: A minimalist OAuth 2.0 client for Deno.
- opener: Opens URLs in the user's default browsers.
- Skypack: Hosts NPM packages compiled as ES Modules enabling the use of some NPM packages in Deno.
- TypeScript: The primary programming language for this project.
(If you feel an acknowledgement is missing, please open an issue explaining the missing project or resource and we'll update the list.)
Contributors
This project follows the all-contributors specification. Contributions of any kind welcome! If you would like to contribute to this project, please see the contributing documentation.
Thanks to these wonderful people (emoji key):
Nicolas Kleiderer 💻 📖 🎨 |
(If you have contributed anything to this project and your name is missing, please open an issue referencing your contributions and we'll update the list.)
Notice of Non-Affiliation and Disclaimer
This project is not affiliated, associated, authorized, endorsed by, or in any way officially connected with Microsoft, or any of its subsidiaries or its affiliates. The official Microsoft Graph CLI may be found at https://github.com/microsoftgraph/msgraph-cli
The name Microsoft as well as related names, marks, emblems and images are registered trademarks of their respective owners.
License
This project is available under the MIT license. See LICENSE for the full license.