outlookcli
by @mrhah
Manage personal Microsoft account (Outlook.com / Hotmail / Live) email, calendar, and OneDrive via the m365-cli command-line tool. Use for personal email/cal...
clawhub install outlookcliπ About This Skill
name: outlook description: >- Manage personal Microsoft account (Outlook.com / Hotmail / Live) email, calendar, and OneDrive via the m365-cli command-line tool. Use for personal email/calendar/OneDrive tasks β NOT for work/school accounts (use the m365-work skill) or SharePoint (personal accounts don't support it). required-binary: m365 requires.env: [] install: npm install -g m365-cli
Outlook Skill (m365-cli)
Manage a personal Microsoft account (Outlook.com / Hotmail / Live) via the m365 CLI.
Use --json for structured output suitable for AI agent consumption (most commands support it).
Prerequisites
m365-cli installed globally: npm install -g m365-clim365 login --account-type personalIf not authenticated, run login first. The CLI uses Device Code Flow β follow the on-screen URL and code.
Key Conventions
--json for programmatic output (most commands support it; trust/untrust do not).YYYY-MM-DDTHH:MM:SS (local) or YYYY-MM-DD (all-day).id field from --json list/search output.export M365_TIMEZONE="Asia/Shanghai".Provenance
https://github.com/mrhah/m365-clihttps://www.npmjs.com/package/m365-climrhahm365 from the m365-cli npm packageQuick Workflow Reference
Authentication
m365 login --account-type personal # First-time login
m365 logout # Clear credentials
# List emails (folders: inbox|sent|drafts|deleted|junk)
m365 mail list --top 10 --json
m365 mail list --folder sent --top 5 --json
m365 mail list --focused --json # Show only Focused Inbox emailsRead / send / search
m365 mail read --force --json
m365 mail send "to@example.com" "Subject" "Body" --json
m365 mail send "to@example.com" "Subject" "Body" --attach file.pdf --cc "cc@ex.com" --json
m365 mail search "keyword" --top 20 --jsonReply / reply-all / forward
m365 mail reply "content" --json
m365 mail reply "content" --attach file.pdf --json
m365 mail reply-all "content" --json
m365 mail reply-all "content" --attach a.pdf b.pdf --json
m365 mail forward "to@example.com" "comment" --json
m365 mail forward "to@example.com" "FYI" --attach report.pdf --jsonAttachments
m365 mail attachments --json
m365 mail download-attachment [local-path] --jsonDelete / move
m365 mail delete --force --json
m365 mail move --json # destination: inbox|sent|drafts|deleted|junk|archive or folder IDFolder management
m365 mail folder list --json
m365 mail folder list --parent inbox --json # List child folders
m365 mail folder create "My Projects" --json
m365 mail folder create "Sub" --parent inbox --json
m365 mail folder delete --force --jsonTrusted senders whitelist
m365 mail trusted --json
m365 mail trust user@example.com
m365 mail trust @example.com # Trust entire domain
m365 mail untrust user@example.com
Calendar
# List / get
m365 cal list --days 7 --json
m365 cal get --jsonCreate
m365 cal create "Title" --start "2026-03-10T14:00:00" --end "2026-03-10T15:00:00" --json
m365 cal create "Title" -s "2026-03-10T14:00:00" -e "2026-03-10T15:00:00" \
--location "Room A" --body "Notes" --attendees "a@ex.com,b@ex.com" --json
m365 cal create "Holiday" --start "2026-03-20" --end "2026-03-21" --allday --jsonUpdate / delete
m365 cal update --title "New Title" --location "Room B" --json
m365 cal delete --json
OneDrive
# List / get metadata
m365 od ls --json
m365 od ls Documents --json
m365 od get "Documents/report.pdf" --jsonDownload / upload
m365 od download "Documents/report.pdf" ~/Downloads/ --json
m365 od upload ~/Desktop/photo.jpg "Photos/vacation.jpg" --jsonSearch / mkdir / delete
m365 od search "budget" --top 20 --json
m365 od mkdir "Projects/New" --json
m365 od rm "old-file.txt" --force --json
For sharing, invitations, and advanced OneDrive options, see references/commands.md.
User Search
m365 user search "John" --top 5 --json # Searches contacts and people
Common Patterns
Read and reply to email
m365 mail list --top 5 --json # 1. Find email
m365 mail read --force --json # 2. Read content
m365 mail reply "Reply content" --json # 3. Reply
Reply with attachment
m365 mail reply "See attached" --attach report.pdf --json
Forward with attachment
m365 mail forward "boss@example.com" "FYI" --attach data.xlsx --json
Check calendar and schedule
m365 cal list --days 3 --json # 1. Check availability
m365 cal create "Meeting" -s "..." -e "..." --json # 2. Book slot
Download email attachment
m365 mail attachments --json # 1. List attachments
m365 mail download-attachment ~/Downloads/ --json # 2. Download
Delete and organize email
m365 mail list --top 10 --json # 1. Find email
m365 mail delete --force --json # 2a. Delete it, OR
m365 mail move archive --json # 2b. Move to archive
Manage mail folders
m365 mail folder list --json # 1. List all folders
m365 mail folder create "Projects" --json # 2. Create custom folder
m365 mail move --json # 3. Move email into it
Trusted Senders (Security)
m365 mail read filters untrusted sender content (shows metadata only). Use --force to bypass.
See references/commands.md for whitelist management commands.
Full Command Reference
See references/commands.md for every command, subcommand, flag, and default value.
Troubleshooting
m365 login --account-type personalexport M365_TIMEZONE="Your/Timezone"Security & Privacy
This skill accesses personal email, calendar, files, and contacts β all sensitive PII.
~/.m365-cli/credentials.json β it contains OAuth tokens.βοΈ Configuration
m365-cli installed globally: npm install -g m365-clim365 login --account-type personalIf not authenticated, run login first. The CLI uses Device Code Flow β follow the on-screen URL and code.
π Tips & Best Practices
m365 login --account-type personalexport M365_TIMEZONE="Your/Timezone"