NAVANEM
v11.8.0TypeScript · MIT license · jun 27, 2026 · 04:18 utc

CLI for Microsoft 365: Manage Your Tenant and SPFx Projects from Any OS

A cross-platform command-line tool to manage Microsoft 365 tenants and SharePoint Framework projects from Linux, macOS, or Windows. An independent open-source PnP community project, not an official Microsoft product.

by Microsoft 365 & Power Platform Community · spotlight by navanem

CLI for Microsoft 365 open-source spotlight cover with a gear motifView source on GitHub

TL;DR

  • CLI for Microsoft 365 is a cross-platform command-line tool that lets you manage a Microsoft 365 tenant and SharePoint Framework projects from Linux, macOS, or Windows, in any shell.
  • It is an independent open-source project (MIT licensed) from the Microsoft 365 & Power Platform Community (PnP). It is NOT an official Microsoft product and NOT built by Navanem. This page is a community spotlight.
  • One unified login reaches many workloads: Microsoft Entra ID, Teams, SharePoint Online, OneDrive, Outlook, Planner, Power Platform, Purview, Viva, and more, with JSON or text output for scripting.
  • Install it through npm (npm install -g @pnp/cli-microsoft365), yarn, npx, or run it in a Docker container (docker run --rm -it m365pnp/cli-microsoft365:latest).

What is CLI for Microsoft 365?

CLI for Microsoft 365 helps you manage your Microsoft 365 tenant and SharePoint Framework projects from the command line. It runs on any operating system (Linux, macOS, Windows) and in any shell, including Azure Cloud Shell, bash, cmder, PowerShell, and zsh. A single unified login gives you access to your Microsoft 365 workloads, so you can read and change configuration across services from one place.

The tool is built on Node.js and distributed as the @pnp/cli-microsoft365 package. Beyond tenant management, it can work with your SharePoint Framework (SPFx) projects: it can upgrade projects and check your environment compatibility. Commands follow a consistent structure (for example m365 spo site get), each ships with built-in help and examples, and responses can be returned as JSON or text for automation.

A note on this page: CLI for Microsoft 365 is an independent, community-led open-source project maintained by the Microsoft 365 & Power Platform Community (PnP), a virtual team of Microsoft employees and community members. It is NOT built by Navanem and it is NOT an official Microsoft product. As the project's own documentation states, it is not affiliated with Microsoft and not covered by Microsoft support. We spotlight it here because it is a useful tool for system administrators. All credit goes to its maintainers and contributors. If you find it valuable, please star and support it on GitHub.

Which Microsoft 365 workloads can it manage?

A single unified login reaches a broad set of workloads. The supported services include Microsoft Entra ID, Microsoft Teams, SharePoint Online, SharePoint Embedded, SharePoint Premium, OneDrive, OneNote, Outlook, Planner, Microsoft To Do, Bookings, Microsoft Viva, Purview, and the Power Platform family (Power Automate, Power Apps, and Power Platform). That spread covers day-to-day tenant tasks across collaboration, identity, and low-code services.

Does it run on any OS, and how do I install it?

Yes. The CLI runs on Linux, macOS, and Windows, and in shells such as bash, PowerShell, zsh, cmder, and Azure Cloud Shell. It needs Node.js (the project tests against Node.js 20 and higher and recommends the current LTS). The standard install is a global npm package:

shell
npm install -g @pnp/cli-microsoft365

You can also install it with yarn (yarn global add @pnp/cli-microsoft365), run it on demand with npx (npx @pnp/cli-microsoft365), or run it inside a Docker container (docker run --rm -it m365pnp/cli-microsoft365:latest). A beta channel is published as @pnp/cli-microsoft365@next.

How does scripting and output work?

The CLI is built for automation. A command can return its response as JSON, which is convenient for parsing in scripts. The global --query option accepts JMESPath queries to filter responses and return custom objects, and the global --output option switches to text output when you want human-readable results. Because every command exposes the same --help option for usage and examples, building repeatable scripts across workloads stays consistent.

How do I sign in?

Before logging in, the project recommends creating your own Microsoft Entra application registration, either with the m365 setup command or by following its "Using your own Microsoft Entra identity" guide. You then authenticate with m365 login, which uses the Device Code flow by default. The CLI supports several authentication methods: Azure Managed Identity, Certificate, Client Secret, Device Code, Federated identity, and Username and Password, so you can pick the approach that fits interactive use or unattended automation.

Why feature CLI for Microsoft 365?

Administrators who manage Microsoft 365 often want repeatable, scriptable operations rather than point-and-click portal work. CLI for Microsoft 365 brings many tenant workloads under one cross-platform tool with consistent commands, scripting-friendly output, and multiple authentication options. It is a long-running, community-maintained project that fills a practical gap for sysadmins, which is why we spotlight it here.

FAQ

Is CLI for Microsoft 365 made by Navanem?

No. It is an independent, community-led open-source project from the Microsoft 365 & Power Platform Community (PnP), released under the MIT license. Navanem did not build it and is not affiliated with it. The source and releases live on GitHub.

Is this an official Microsoft tool?

No. It is a community-led PnP project, not an official Microsoft product. Its own documentation states it is not affiliated with Microsoft and not covered by Microsoft support. It is also distinct from Microsoft's own offerings such as the Microsoft Graph CLI or the Microsoft 365 PowerShell modules.

What do I need to run it?

Node.js. The project tests against Node.js 20 and higher and recommends the current LTS release. After that, install the global npm package or use yarn, npx, or the Docker image.

What license is it under?

The MIT license, as stated in the repository's LICENSE file.

Where do I get it?

From the GitHub repository at github.com/pnp/cli-microsoft365, or by installing the @pnp/cli-microsoft365 package from npm.

#microsoft-365#sharepoint-online#Command Line#open-source#Automation#microsoft-entra-id