# OpenCLI Agent Pack: Microsoft 365 CLI

Use this when an AI agent needs to work with `m365`.

## What this CLI is for
The official CLI from Microsoft. Microsoft 365, sharepoint, and teams automation from the terminal. Supports structured output — good for scripts and agents.

Best for: microsoft 365, sharepoint, and teams automation from the terminal.

## Agent readiness
Great for agents (75/100)
- Structured output is available for parsing.
- Supports non-interactive/scripted use.
- Works well in CI or repeatable automation.

## Install
```sh
npm install -g @pnp/cli-microsoft365
```

## Verify before real work
```sh
m365 status
```
Expected signal: Shows Microsoft 365 CLI login status.

## Safe starting commands
```sh
m365 status
```

## Guardrails for agents
- Verify identity/account before running task commands.
- Network access is required; avoid leaking secrets in logs.
- Require confirmation before apply, delete, deploy, transfer, merge, or write actions.

## Suggested agent instruction
You may use Microsoft 365 CLI (`m365`) for microsoft 365, sharepoint, and teams automation from the terminal.. First install it if missing, then run the verify command. Start with read-only or inspection commands. Summarize what you found before changing anything. Ask for confirmation before commands that mutate remote state, spend money, deploy, delete data, merge code, or expose secrets.

Source: OpenCLI
