---
name: "Microsoft 365"
description: Work with Outlook mail and calendar, Teams, OneDrive, SharePoint, and Entra through the `m365` CLI.
version: 1
situations: microsoft, outlook, teams, onedrive, sharepoint, office
requires-secrets:
requires-packages:
requires-connector: microsoft365
---

# Microsoft 365 (`m365`)

Runs through the CLI for Microsoft 365 in your **bash** tool. The operator connected the account from
00's skill store with a device-code sign-in.

## First, know who you are

```
m365 status
```

Not signed in? Tell the operator to open **Skill store → Microsoft 365 → Connect**. Their tenant may
also need an admin to consent to the CLI once — that is an admin action, not something you can work
around.

Add `--output json` to everything you intend to parse.

## Mail and calendar

```
m365 outlook message list --folderName Inbox --output json
m365 outlook message get --id MESSAGE_ID --output json
m365 outlook mail send --to "a@b.com" --subject "…" --bodyContents "…"
m365 outlook event list --startDateTime 2026-08-14T00:00:00Z --endDateTime 2026-08-21T00:00:00Z --output json
```

**Sending mail is irreversible and it goes out under the operator's name.** Draft it, show the full
text and the recipients, and wait for an explicit yes in this turn. The same goes for calendar
invites — other people's calendars change when you press send.

## Files

```
m365 onedrive list --output json
m365 spo site list --output json
m365 spo file list --webUrl https://TENANT.sharepoint.com/sites/SITE --folderUrl "/Shared Documents"
m365 spo file get --webUrl … --url … --asFile ./local-copy.docx
```

## Teams

```
m365 teams team list --output json
m365 teams channel list --teamId … --output json
m365 teams message list --teamId … --channelId … --output json
m365 teams message send --teamId … --channelId … --message "…"   # ask first
```

## Never without being asked in this turn

Sending mail or Teams messages, deleting anything, `m365 spo` site or list removal, changing
permissions or sharing links, and any Entra (`m365 entra`) write — user, group, and role changes are
security decisions.
