mog — Microsoft Ops Gadget
CLI for Microsoft 365: Mail, Calendar, OneDrive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote.
The Microsoft counterpart to gog (Google Ops Gadget). Same patterns, different cloud.
Quick Reference
For comprehensive usage, run:
mog --ai-help
This outputs the full dashdash-compliant documentation including:
- Setup/Prerequisites
- All commands and options
- Date/time formats
- Examples (positive and negative)
- Troubleshooting
- Slug system explanation
- gog compatibility notes
Modules
| Module |
Commands |
| mail |
search, get, send, folders, drafts, attachment |
| calendar |
list, create, get, update, delete, calendars, respond, freebusy, acl |
| drive |
ls, search, download, upload, mkdir, move, rename, copy, rm |
| contacts |
list, search, get, create, update, delete, directory |
| tasks |
lists, list, add, done, undo, delete, clear |
| word |
list, export, copy |
| ppt |
list, export, copy |
| excel |
list, get, update, append, create, metadata, tables, add-sheet, clear, copy, export |
| onenote |
notebooks, sections, pages, get, create-notebook, create-section, create-page, delete, search |
Quick Start
# Mail
mog mail search "from:someone" --max 10
mog mail send --to a@b.com --subject "Hi" --body "Hello"
mog mail send --to a@b.com --subject "Report" --body-file report.md
mog mail send --to a@b.com --subject "Newsletter" --body-html "<h1>Hello</h1>"
cat draft.txt | mog mail send --to a@b.com --subject "Hi" --body-file -
# Calendar
mog calendar list
mog calendar create --summary "Meeting" --from 2025-01-15T10:00:00 --to 2025-01-15T11:00:00
mog calendar freebusy alice@example.com bob@example.com
# Drive
mog drive ls
mog drive upload ./file.pdf
mog drive download <slug> --out ./file.pdf
# Tasks
mog tasks list
mog tasks add "Buy milk" --due tomorrow
mog tasks clear
# Contacts
mog contacts list
mog contacts directory "john"
# Excel
mog excel list
mog excel get <id> Sheet1 A1:D10
mog excel update <id> Sheet1 A1:B2 val1 val2 val3 val4
mog excel append <id> TableName col1 col2 col3
# OneNote
mog onenote notebooks
mog onenote search "meeting notes"
Slugs
mog generates 8-character slugs for Microsoft's long GUIDs:
a3f2c891 instead of AQMkADAwATMzAGZmAS04MDViLTRiNzgt...
- All commands accept slugs or full IDs
- Use
--verbose to see full IDs
Aliases
mog cal → mog calendar
mog todo → mog tasks
Credential Storage
OAuth tokens stored in config directory (0600 permissions):
| Platform |
Location |
| macOS |
~/.config/mog/ |
| Linux |
~/.config/mog/ |
| Windows |
%USERPROFILE%\.config\mog\ |
Files:
tokens.json - OAuth tokens (encrypted at rest by OS)
settings.json - Client ID
slugs.json - Slug cache
See Also
mog --ai-help - Full documentation
mog <command> --help - Command-specific help
1---2name: mog3description: "Microsoft Ops Gadget — CLI for Microsoft 365 (Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote)."4metadata:5 source: https://skillmd.com/skills/dvcrn/mog6---78# mog — Microsoft Ops Gadget910CLI for Microsoft 365: Mail, Calendar, OneDrive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote.1112The Microsoft counterpart to `gog` (Google Ops Gadget). Same patterns, different cloud.1314## Quick Reference1516For comprehensive usage, run:17```bash18mog --ai-help19```2021This outputs the full dashdash-compliant documentation including:22- Setup/Prerequisites23- All commands and options24- Date/time formats25- Examples (positive and negative)26- Troubleshooting27- Slug system explanation28- gog compatibility notes2930## Modules3132| Module | Commands |33|--------|----------|34| **mail** | search, get, send, folders, drafts, attachment |35| **calendar** | list, create, get, update, delete, calendars, respond, freebusy, acl |36| **drive** | ls, search, download, upload, mkdir, move, rename, copy, rm |37| **contacts** | list, search, get, create, update, delete, directory |38| **tasks** | lists, list, add, done, undo, delete, clear |39| **word** | list, export, copy |40| **ppt** | list, export, copy |41| **excel** | list, get, update, append, create, metadata, tables, add-sheet, clear, copy, export |42| **onenote** | notebooks, sections, pages, get, create-notebook, create-section, create-page, delete, search |4344## Quick Start4546```bash47# Mail48mog mail search "from:someone" --max 1049mog mail send --to a@b.com --subject "Hi" --body "Hello"50mog mail send --to a@b.com --subject "Report" --body-file report.md51mog mail send --to a@b.com --subject "Newsletter" --body-html "<h1>Hello</h1>"52cat draft.txt | mog mail send --to a@b.com --subject "Hi" --body-file -5354# Calendar55mog calendar list56mog calendar create --summary "Meeting" --from 2025-01-15T10:00:00 --to 2025-01-15T11:00:0057mog calendar freebusy alice@example.com bob@example.com5859# Drive60mog drive ls61mog drive upload ./file.pdf62mog drive download <slug> --out ./file.pdf6364# Tasks65mog tasks list66mog tasks add "Buy milk" --due tomorrow67mog tasks clear6869# Contacts70mog contacts list71mog contacts directory "john"7273# Excel74mog excel list75mog excel get <id> Sheet1 A1:D1076mog excel update <id> Sheet1 A1:B2 val1 val2 val3 val477mog excel append <id> TableName col1 col2 col37879# OneNote80mog onenote notebooks81mog onenote search "meeting notes"82```8384## Slugs8586mog generates 8-character slugs for Microsoft's long GUIDs:87- `a3f2c891` instead of `AQMkADAwATMzAGZmAS04MDViLTRiNzgt...`88- All commands accept slugs or full IDs89- Use `--verbose` to see full IDs9091## Aliases9293- `mog cal` → `mog calendar`94- `mog todo` → `mog tasks`9596## Credential Storage9798OAuth tokens stored in config directory (0600 permissions):99100| Platform | Location |101|----------|----------|102| **macOS** | `~/.config/mog/` |103| **Linux** | `~/.config/mog/` |104| **Windows** | `%USERPROFILE%\.config\mog\` |105106Files:107- `tokens.json` - OAuth tokens (encrypted at rest by OS)108- `settings.json` - Client ID109- `slugs.json` - Slug cache110111## See Also112113- `mog --ai-help` - Full documentation114- `mog <command> --help` - Command-specific help