m365-pnp-cli for Openclaw

A comprehensive command-line toolset for managing Microsoft 365 services including SharePoint, Teams, and Entra ID through your AI agent.

thomyg
v1.0.1
Feb 16, 2026
0
1.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install m365-pnp-cli

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install m365-pnp-cli using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is m365-pnp-cli?

The m365-pnp-cli skill provides a robust interface for interacting with the official PnP (Patterns and Practices) CLI for Microsoft 365. This tool allows developers and administrators to manage their entire tenant, covering everything from SharePoint Online site provisioning to Microsoft Teams channel management and Entra ID (Azure AD) user configuration. By utilizing this skill within Openclaw Skills, you can bridge the gap between AI automation and complex Microsoft cloud environments.

Built on top of Node.js, the skill offers a unified way to access Microsoft Graph and other Microsoft 365 APIs. It supports multiple authentication flows, making it suitable for both interactive development and unattended automated scripts. Its default JSON output format ensures that data is easily parseable by AI agents for downstream processing and decision-making.

m365-pnp-cli Use Cases

  • Automating the creation and configuration of SharePoint Online sites and lists.
  • Managing Microsoft Teams memberships, channels, and chat history for organizational audits.
  • Programmatically managing files and folders within OneDrive for Business.
  • Querying and updating Microsoft Entra ID (Azure AD) users, groups, and applications.
  • Extracting data from Microsoft Planner tasks and Outlook calendars for productivity reporting.
  • Managing Power Automate flows and Power Apps environments via command line.

How m365-pnp-cli Works

  1. The AI agent initiates the skill by checking for the global installation of the @pnp/cli-microsoft365 package.
  2. Users authenticate their Microsoft 365 session using the m365 login command, typically via the Device Code flow.
  3. The agent utilizes the m365 --help command to discover specific syntax and available options for various Microsoft 365 workloads.
  4. Commands are executed against the Microsoft 365 tenant, and the CLI communicates with the relevant cloud APIs (Graph, SPO, etc.).
  5. Results are returned in JSON format, often filtered with JMESPath queries to provide the AI agent with specific, actionable data.

m365-pnp-cli Setup

Ensure you have Node.js version 20.0.0 or higher installed on your system. Install the CLI globally using npm:

npm install -g @pnp/cli-microsoft365

Verify the installation and check the current status of your connection to the Openclaw Skills environment:

m365 status

To begin managing your tenant, initiate the login process:

m365 login

m365-pnp-cli Data Schema & Taxonomy

The skill organizes data based on the Microsoft 365 workload being accessed. Most commands return structured JSON that can be manipulated using the --query flag.

Service Area Command Prefix Common Metadata Returned
SharePoint m365 spo Title, URL, Template, SiteId
Teams m365 teams TeamId, DisplayName, Description
Entra ID m365 entra DisplayName, UserPrincipalName, Id
OneDrive m365 onedrive DriveId, FileName, FileSize

All responses can be filtered using JMESPath to reduce payload size and focus on relevant properties.

m365-pnp-cli Advanced Features

  • Support for complex JMESPath queries to filter and transform JSON output directly at the CLI level.
  • Flexible authentication options including Client Certificates, Managed Identity, and Federated Identity for secure DevOps pipelines.
  • Seamless integration with Microsoft Purview for compliance and data governance tasks.
  • Extensive help system accessible via m365 --help providing detailed documentation for every subcommand.
  • Ability to manage Power Platform components including Power Apps and Power Automate.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*