Installations
npm install @pnp/cli-microsoft365
Developer Guide
Typescript
No
Module System
ESM
Node Version
20.18.2
NPM Version
10.8.2
Score
56.3
Supply Chain
84
Quality
96.8
Maintenance
50
Vulnerability
82.6
License
Releases
Unable to fetch releases
Contributors
Languages
TypeScript (89.11%)
JavaScript (9.91%)
SCSS (0.87%)
HTML (0.06%)
PowerShell (0.03%)
Dockerfile (0.02%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
1,247,564
Last Day
941
Last Week
5,785
Last Month
26,031
Last Year
626,036
GitHub Statistics
MIT License
957 Stars
3,973 Commits
333 Forks
70 Watchers
1 Branches
134 Contributors
Updated on Feb 21, 2025
Package Meta Information
Latest Version
10.3.2
Package Id
@pnp/cli-microsoft365@10.3.2
Unpacked Size
9.13 MB
Size
1.24 MB
File Count
2,226
NPM Version
10.8.2
Node Version
20.18.2
Published on
Feb 12, 2025
Total Downloads
Cumulative downloads
Total Downloads
1,247,564
Last Day
1.5%
941
Compared to previous day
Last Week
-6.6%
5,785
Compared to previous week
Last Month
33.6%
26,031
Compared to previous month
Last Year
93.9%
626,036
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
31
Dev Dependencies
25
CLI for Microsoft 365
One CLI for Microsoft 365
CLI for Microsoft 365 helps you manage your Microsoft 365 tenant and SharePoint Framework projects.
Website | Features | Install | Usage | Build | Contribute
Code of Conduct | Need help? | Disclaimer
Microsoft 365 & Power Platform Community
Features
- Run on any OS
- Linux
- MacOS
- Windows
- Run on any shell
- Azure Cloud Shell
- bash
- cmder
- PowerShell
- zsh
- Unified login
- Access all your Microsoft 365 workloads
- Supported workloads
- Bookings
- Microsoft Entra ID
- Microsoft Teams
- Microsoft To Do
- Microsoft Viva
- OneDrive
- OneNote
- Outlook
- Planner
- Power Automate
- Power Apps
- Power Platform
- Purview
- Skype for Business
- SharePoint Online
- To Do
- Supported authentication methods
- Azure Managed Identity
- Certificate
- Client Secret
- Device Code
- Username and Password
- Manage your SharePoint Framework projects
- Upgrade your projects
- Check your environment compatibility
Follow our Bluesky, or X account to keep yourself updated about new features, improvements, and bug fixes.
Install
To use the CLI for Microsoft 365 you need Node.js
. The CLI has been tested with Node.js versions 18 and higher, but we recommend you to use the Node.js LTS version available at the moment.
npm install -g @pnp/cli-microsoft365
Install beta version β
npm install -g @pnp/cli-microsoft365@next
Alternate package managers 🧶
yarn
yarn global add @pnp/cli-microsoft365
npx
npx @pnp/cli-microsoft365
Run CLI for Microsoft 365 in a Docker container 🐳
docker run --rm -it m365pnp/cli-microsoft365:latest
Checkout our guide to learn more about how to run CLI for Microsoft 365 using Docker
Usage
Before logging in, you should create a custom Microsoft Entra application registration. Use the
m365 setup
command or refer to the Using your own Microsoft Entra identity guide.
Use the login
command to start the Device Code login flow to authenticate with your Microsoft 365 tenant.
1m365 login
For alternative authentication methods and usage, refer to the login command documentation
List all commands using the global --help
option.
1m365 --help
Get command information and example usage using the global --help
option.
1m365 spo site get --help
Execute a command and output response as JSON.
1m365 spo site get --url https://contoso.sharepoint.com
Filter responses and return custom objects using JMESPath queries using the global --query
option.
1m365 spo site list --query '[?Template==`GROUP#0`].{Title:Title, Url:Url}'
Execute a command and output response as text using the global --output
option.
1m365 spo site get --url https://contoso.sharepoint.com --output text
For more examples and usage, refer to the command and sample scripts documentation.
Build
To build and run this CLI locally, you will need node
>= 22.0.0
installed.
1# Clone this repository 2$ git clone https://github.com/pnp/cli-microsoft365 3 4# Go into the repository 5$ cd cli-microsoft365 6 7# Install dependencies 8$ npm install 9 10# Build the CLI 11$ npm run build 12 13# Symlink your local CLI build 14$ npm link
When you execute any m365
command from the terminal, it will now use your local clone of the CLI.
Contribute
We love to accept contributions.
If you want to get involved with helping us grow the CLI, whether that is suggesting or adding a new command, extending an existing command, or updating our documentation, we would love to hear from you.
Check out our Contributing Guide for detailed information on how to contribute to this project.
Need Help?
Join our community
Microsoft 365 & Power Platform Community
CLI for Microsoft 365 is a Microsoft 365 & Power Platform Community (PnP) project. Microsoft 365 & Power Platform Community is a virtual team consisting of Microsoft employees and community members focused on helping the community make the best use of Microsoft products. CLI for Microsoft 365 is an open-source project not affiliated with Microsoft and not covered by Microsoft support. If you experience any issues using the CLI, please submit an issue in the issues list.
Disclaimer
THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.

No vulnerabilities found.
Reason
30 commit(s) and 13 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:112
Reason
no binaries found in the repo
Reason
3 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-vhxf-7vqr-mrjg
- Warn: Project is vulnerable to: GHSA-cg87-wmx4-v546
- Warn: Project is vulnerable to: GHSA-vcjj-xf2r-mwvc
Reason
dependency not pinned by hash detected -- score normalized to 3
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/check_pr.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:80: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:118: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:128: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:129: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/check_pr.yml:135: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/check_pr.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:151: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:157: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:162: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:164: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:166: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:177: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:184: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:92: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:121: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:133: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release_next.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:82: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:120: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:130: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:134: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:140: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:156: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:168: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:174: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:180: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:197: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:218: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:225: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:231: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release_next.yml:236: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release_next.yml:238: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release_next.yml:240: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release_next.yml:251: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/release_next.yml:258: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release_next.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/pnp/cli-microsoft365/release_next.yml/main?enable=pin
- Warn: containerImage not pinned by hash: .devcontainer/Dockerfile:1: pin your Docker image by updating waldekm/powershell:alpine-3.18 to waldekm/powershell:alpine-3.18@sha256:144201efc80bf9a196a98ab69c909003817286340a18a595cdeece718dd46af2
- Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating waldekm/powershell:alpine-3.18 to waldekm/powershell:alpine-3.18@sha256:144201efc80bf9a196a98ab69c909003817286340a18a595cdeece718dd46af2
- Warn: npmCommand not pinned by hash: Dockerfile:41-50
- Info: 0 out of 49 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 12 third-party GitHubAction dependencies pinned
- Info: 0 out of 2 containerImage dependencies pinned
- Info: 11 out of 12 npmCommand dependencies pinned
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/release.yml:117
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/release_next.yml:164
- Warn: no topLevel permission defined: .github/workflows/check_pr.yml:1
- Warn: no topLevel permission defined: .github/workflows/release.yml:1
- Warn: no topLevel permission defined: .github/workflows/release_next.yml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
4.6
/10
Last Scanned on 2025-02-17
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More