π¦ ClawHub
Skill
by @thomyg
CLI for Microsoft 365 - Manage Microsoft 365 tenant, SharePoint Online, Teams, OneDrive, and more. Official PnP (Patterns and Practices) CLI.
TERMINAL
clawhub install m365-pnp-cliπ About This Skill
name: m365-pnp-cli description: CLI for Microsoft 365 - Manage Microsoft 365 tenant, SharePoint Online, Teams, OneDrive, and more. Official PnP (Patterns and Practices) CLI. metadata: { "openclaw": { "requires": { "bins": ["m365"], "node": ">=20.0.0", "npmPackages": ["@pnp/cli-microsoft365"] }, "install": [ { "id": "node", "kind": "node", "package": "@pnp/cli-microsoft365", "label": "Install m365 CLI (npm)", "description": "Install the CLI for Microsoft 365 globally: npm install -g @pnp/cli-microsoft365" } ], "homepage": "https://pnp.github.io/cli-microsoft365", "repository": "https://github.com/pnp/cli-microsoft365", "author": "Microsoft PnP (Patterns and Practices)", "keywords": ["microsoft365", "m365", "sharepoint", "teams", "onenote", "outlook", "cli", "microsoft", "pnp"], "npmPackage": "@pnp/cli-microsoft365" } }
m365-pnp-cli Skill
This skill provides access to the CLI for Microsoft 365 β the official PnP (Patterns and Practices) tool for Microsoft 365 management.
β οΈ IMPORTANT FOR AGENTS
When in doubt, ALWAYS call m365 --help first to see all possibilities!
# Always call help when unsure!
m365 --helpFor specific commands:
m365 login --help
m365 spo --help
m365 teams --help
Installation
The CLI must be installed:
npm install -g @pnp/cli-microsoft365
Or use npx (sandbox):
npx @pnp/cli-microsoft365 --help
Source & Verification
What can the CLI do?
Supported Workloads
Authentication
Commands (Overview)
Login/Logout
m365 login # Device Code Login
m365 logout # Logout
m365 status # Check login status
SharePoint Online (spo)
m365 spo site list # List all sites
m365 spo site get --url # Get site details
m365 spo list list --webUrl # Lists in a site
m365 spo file list # List files
m365 spo folder add # Create folder
Teams
m365 teams channel list # List channels
m365 teams channel get # Get channel details
m365 teams user list # List team members
m365 teams chat list # List chats
m365 teams meeting list # List meetings
OneDrive
m365 onedrive drive list # OneDrive Drives
m365 onedrive file list # List files
m365 onedrive file get # Get file content
Outlook
m365 outlook mail list # List emails
m365 outlook calendar list # List calendar events
Planner
m365 planner task list # Planner Tasks
m365 planner plan get # Get plan details
Azure AD / Entra ID
m365 entra user list # List users
m365 entra group list # List groups
m365 entra app list # List apps
Usage as Assistant - IMPORTANT
β‘ First Step: ALWAYS call help!
# When in doubt - call help first!
m365 --helpFor specific commands:
m365 spo --help
m365 teams --help
m365 login --help
Basic Usage
# Login (Device Code Flow)
m365 loginCheck status
m365 statusSharePoint: List sites
m365 spo site listSharePoint: Get specific site
m365 spo site get --url "https://contoso.sharepoint.com/sites/test"Teams: List channels
m365 teams channel list --teamId OneDrive: Files
m365 onedrive file listOutlook: Emails
m365 outlook mail list --folder InboxPlanner: Tasks
m365 planner task list
Output Options
# As JSON (default)
m365 spo site listAs text
m365 spo site list --output textFilter with JMESPath
m365 spo site list --query "[?Template==\GROUP#0\].{Title:Title, Url:Url}"
Authentication
The CLI uses Device Code Flow by default:
m365 login
β You'll receive a code on another device
β Use that code to authenticate with Microsoft
For automated scripts, you can also use: