GithubHelp home page GithubHelp logo

briantjackett / msgraph-cli Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microsoftgraph/msgraph-cli-archived

0.0 1.0 0.0 31.29 MB

Python based command line tools for interacting with Microsoft Graph

License: Other

Python 99.98% Batchfile 0.01% C++ 0.01% Rich Text Format 0.01% Shell 0.01% Dockerfile 0.01%

msgraph-cli's Introduction

Microsoft Graph CLI

It is said that imitation is the sincerest form of flattery and if you are familiar with the Azure CLI, you can tell we are fans. The Microsoft Graph CLI leverages the same tool chain that is used to build the Azure CLI, but instead brings the entire surface area of Microsoft Graph to your command shell.

This project is still in its early phases, but we are building not only on the work of the Azure CLI team but also on the Microsoft Graph PowerShell SDK project to enable us to quickly generate a CLI for all the new capabilities of Microsoft Graph as soon as they are available.

Installation

Windows

Download directly from the releases.

Linux

If you're using Ubuntu 20.04+, download and install libffi6

sudo apt install path/to/libff6

Download the .deb package from the latest release and install the package with the command below.

sudo dpkg -i msgraph-cli_all.deb

Docker

Build a docker image by running the command below.

docker build --target build-env -f ./build_scripts/debian/Dockerfile -t microsoft/msgraph-cli:ubuntu-builder .

Run the docker container interactively using the command below.

docker run -it --name deb microsoft/msgraph-cli:ubuntu-builder   

Usage

$ mg [ group ] [ command ] {parameters}

Get Started

Login

$ mg login --scopes "user.read.all"

Query

You can use the --query parameter and the JMESPath query syntax to customize your output.

$ mg users user list --query "[?userType=='Member'].{name: displayName, email: mail}" --output table
Name                      Email
------------------------  -------------------------------------
Conf Room Adams           [email protected]
Adele Vance               [email protected]
MOD Administrator         [email protected]
Alex Wilber               [email protected]

Exit codes

For scripting purposes, we output certain exit codes for differing scenarios.

Exit Code Scenario
0 Command ran successfully.
1 Generic error; server returned bad status code, CLI validation failed, etc.
2 Parser error; check input to command line.

Common scenarios and use Microsoft Graph CLI effectively

More samples and snippets

Reporting issues and feedback

If you encounter any bugs with the tool please file an issue in the Issues section of our GitHub repo.

Developer setup

If you would like to setup a development environment and contribute to the CLI, read Setting Up Your Development Environment.

Contribute code

This project has adopted the Microsoft Open Source Code of Conduct.

For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

msgraph-cli's People

Contributors

jobala avatar michaelmainer avatar dependabot[bot] avatar darrelmiller avatar roinochieng avatar thewahome avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.