Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

An unofficial command line utility for accessing the Microsoft Graph, written with Deno and Typescript

License

Notifications You must be signed in to change notification settings

nakleiderer/microsoft_graph_cli

Repository files navigation

microsoft_graph_cli

Deno CI GitHub TypeScript semantic-release Commitizen friendly

All Contributors

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@v1.1.3/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 replace mgraph with your selected name in all usage examples.
  • (Optional) You may install any released version of this CLI by changing v1.1.3 to the desired version.

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@v1.1.3/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 use any released version of this CLI by changing the v1.1.3 to the desired version.

Updating

If you've previously installed with deno install, you may update by adding the -f flag to the command:

deno install --unstable [permissions] -n mgraph -f https://deno.land/x/microsoft_graph_cli@v1.1.3/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 replace mgraph with your selected name in all usage examples.
  • (Optional) You may install any released version of this CLI by changing the v1.1.3 to the desired version.

If you use the deno run installation option, simply change the v1.1.3 to the latest release when you next run the program.

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):

(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.