6.4k★by visionik
mog – OpenClaw Skill
mog is an OpenClaw Skills integration for data analytics workflows. Microsoft Ops Gadget — CLI for Microsoft 365 (Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote).
Skill Snapshot
| name | mog |
| description | Microsoft Ops Gadget — CLI for Microsoft 365 (Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote). OpenClaw Skills integration. |
| owner | visionik |
| repository | visionik/mogcli |
| language | Markdown |
| license | MIT |
| topics | |
| security | L1 |
| install | openclaw add @visionik/mogcli |
| last updated | Feb 7, 2026 |
Maintainer

name: mog description: Microsoft Ops Gadget — CLI for Microsoft 365 (Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote).
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 |
|---|---|
| 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:
a3f2c891instead ofAQMkADAwATMzAGZmAS04MDViLTRiNzgt...- All commands accept slugs or full IDs
- Use
--verboseto see full IDs
Aliases
mog cal→mog calendarmog 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 IDslugs.json- Slug cache
See Also
mog --ai-help- Full documentationmog <command> --help- Command-specific help
📊 mog — Microsoft Ops Gadget
CLI for Microsoft 365 — Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote
The Microsoft counterpart to gog (Google Ops Gadget). Same patterns, different cloud.
✨ Features
| Module | Description |
|---|---|
| Search, send, drafts, attachments, folders | |
| 📅 Calendar | Events, create, respond, freebusy, ACL |
| 📁 Drive | OneDrive files — list, upload, download, move |
| 👥 Contacts | Personal contacts + org directory lookup |
| ✅ Tasks | Microsoft To-Do — lists, add, complete, clear |
| 📝 Word | Documents — list, export, copy |
| 📊 PowerPoint | Presentations — list, export, copy |
| 📈 Excel | Spreadsheets — read, write, tables, export |
| 📓 OneNote | Notebooks, sections, pages, search |
Extras:
- 🔗 Slug system — 8-char shorthand for Microsoft's long GUIDs
- 🤖 AI-friendly —
--ai-helpoutputs comprehensive docs for LLMs - 🔄 gog-compatible — Same flags and patterns for muscle memory
🚀 Quick Start
# Install
go install github.com/visionik/mogcli/cmd/mog@latest
# Authenticate (see Setup below for Azure AD app)
mog auth login --client-id YOUR_CLIENT_ID
# Check mail
mog mail search "*" --max 10
# Send email
mog mail send --to bob@example.com --subject "Hello" --body "Hi Bob!"
# List calendar events
mog calendar list
# Create event with attendees
mog calendar create --summary "Meeting" \
--from 2025-01-15T10:00:00 --to 2025-01-15T11:00:00 \
--attendees "alice@example.com"
# Upload to OneDrive
mog drive upload ./report.pdf
# Add a task
mog tasks add "Review PR" --due tomorrow --important
# Read Excel spreadsheet
mog excel get myworkbook.xlsx Sheet1 A1:D10
# Search OneNote
mog onenote search "meeting notes"
📦 Installation
# Go install (recommended)
go install github.com/visionik/mogcli/cmd/mog@latest
# Or clone for development
git clone https://github.com/visionik/mogcli.git
cd mogcli
go build -o mog ./cmd/mog
⚙️ Setup — Azure AD App
1. Create App Registration
- Go to Azure Portal → App registrations → New registration
- Name:
mog CLI(or any name) - Supported account types: Select based on your needs
- Redirect URI: Leave blank (uses device code flow)
2. Add API Permissions
Add these Delegated permissions:
| Permission | Description |
|---|---|
User.Read | Sign in and read user profile |
offline_access | Maintain access (refresh tokens) |
Mail.ReadWrite | Read and write mail |
Mail.Send | Send mail |
Calendars.ReadWrite | Full calendar access |
Files.ReadWrite.All | Full OneDrive access |
Contacts.Read | Read contacts |
Contacts.ReadWrite | Full contacts access |
People.Read | Read people |
Tasks.ReadWrite | Read and write tasks |
Notes.ReadWrite | Read and write OneNote |
3. Authenticate
mog auth login --client-id YOUR_CLIENT_ID
Opens a browser for Microsoft login. Tokens stored at ~/.config/mog/tokens.json.
4. Verify
mog auth status
📖 Command Reference
Global Options
| Option | Description |
|---|---|
--json | Output JSON (best for scripting) |
--plain | Stable text output (TSV, no colors) |
--verbose | Show full IDs and extra details |
--force | Skip confirmations |
--no-input | Never prompt (CI mode) |
--ai-help | Full docs for AI agents |
mog mail search <query> # Search messages
mog mail search "*" --max 10 # Recent messages
mog mail get <id> # Read a message
mog mail send --to X --subject Y --body Z
mog mail folders # List folders
# Drafts
mog mail drafts list
mog mail drafts create --to X --subject Y --body Z
mog mail drafts send <draftId>
# Attachments
mog mail attachment list <messageId>
mog mail attachment download <messageId> <attachmentId> --out ./file.pdf
📅 Calendar
mog calendar list # Upcoming events
mog calendar list --from 2025-01-01 --to 2025-01-31
mog calendar calendars # List calendars
mog calendar create --summary "Meeting" \
--from 2025-01-15T10:00:00 \
--to 2025-01-15T11:00:00
mog calendar get <eventId>
mog calendar update <eventId> --summary "New Title"
mog calendar delete <eventId>
# Respond to invites
mog calendar respond <eventId> accept
mog calendar respond <eventId> decline --comment "Can't make it"
# Check availability
mog calendar freebusy alice@example.com bob@example.com \
--start 2025-01-15T09:00:00 --end 2025-01-15T17:00:00
# View permissions
mog calendar acl
Alias: mog cal → mog calendar
📁 Drive (OneDrive)
mog drive ls # Root folder
mog drive ls /Documents # Specific path
mog drive search "report" # Search files
mog drive download <id> --out ./file.pdf
mog drive upload ./doc.pdf
mog drive upload ./doc.pdf --folder <folderId> --name "renamed.pdf"
mog drive mkdir "New Folder"
mog drive move <id> <destinationId>
mog drive rename <id> "new-name.pdf"
mog drive copy <id> --name "copy.pdf"
mog drive rm <id>
✅ Tasks (Microsoft To-Do)
mog tasks lists # List task lists
mog tasks list # Tasks in default list
mog tasks list <listId> # Tasks in specific list
mog tasks list --all # Include completed
mog tasks add "Buy milk"
mog tasks add "Call mom" --due tomorrow --notes "Birthday"
mog tasks add "Review PR" --list Work --due monday --important
mog tasks done <taskId>
mog tasks undo <taskId>
mog tasks delete <taskId>
mog tasks clear # Clear completed tasks
mog tasks clear <listId> # Clear from specific list
Alias: mog todo → mog tasks
👥 Contacts
mog contacts list
mog contacts search "john"
mog contacts get <id>
mog contacts create --name "John Doe" --email "john@example.com"
mog contacts update <id> --email "new@example.com"
mog contacts delete <id>
mog contacts directory "john" # Org directory lookup
📈 Excel
mog excel list # List workbooks
mog excel metadata <id> # List worksheets
# Read data
mog excel get <id> # First sheet, used range
mog excel get <id> Sheet1 A1:D10 # Specific range
# Write data (positional values fill row by row)
mog excel update <id> Sheet1 A1:B2 val1 val2 val3 val4
# Append to table
mog excel append <id> TableName col1 col2 col3
# Create & manage
mog excel create "Budget 2025"
mog excel add-sheet <id> --name "Q2"
mog excel tables <id>
mog excel clear <id> Sheet1 A1:C10 # Clear values (keep formatting)
mog excel copy <id> "Budget Copy"
# Export
mog excel export <id> --out ./data.xlsx
mog excel export <id> --format csv --out ./data.csv
📓 OneNote
mog onenote notebooks # List notebooks
mog onenote sections <notebookId> # List sections
mog onenote pages <sectionId> # List pages
mog onenote get <pageId> # Get page content (text)
mog onenote get <pageId> --html # Get raw HTML
mog onenote create-notebook "Work Notes"
mog onenote create-section <notebookId> "January"
mog onenote create-page <sectionId> "Meeting Notes" "Content here"
mog onenote delete <pageId>
mog onenote search "meeting"
📝 Word
mog word list # List documents
mog word export <id> --out ./doc.docx
mog word export <id> --format pdf --out ./doc.pdf
mog word copy <id> "Copy of Report"
📊 PowerPoint
mog ppt list # List presentations
mog ppt export <id> --out ./deck.pptx
mog ppt export <id> --format pdf --out ./deck.pdf
mog ppt copy <id> "Copy of Deck"
🔗 Slug System
Microsoft Graph uses very long GUIDs (100+ characters). mog generates 8-character slugs:
Full: AQMkADAwATMzAGZmAS04MDViLTRiNzgtMDA...
Slug: a3f2c891
- ✅ All commands output slugs by default
- ✅ All commands accept slugs or full IDs
- ✅ Use
--verboseto also see full IDs - ✅ Slugs cached in
~/.config/mog/slugs.json - ✅
mog auth logoutclears the cache
🤖 AI-Friendly
Run mog --ai-help for comprehensive documentation including:
- All commands with options
- Date/time format specifications
- Positive and negative examples
- Exit codes and piping patterns
- Troubleshooting guide
Follows the dashdash specification.
🔄 gog Compatibility
mog follows gog patterns for muscle memory across clouds:
| Pattern | mog | gog |
|---|---|---|
| Calendar events | --summary, --from, --to | Same |
| Task notes | --notes | Same |
| Output format | --json, --plain | Same |
| Max results | --max | Same |
| Excel read | mog excel get <id> Sheet1 A1:D10 | gog sheets get <id> Sheet1!A1:D10 |
| Spreadsheet write | mog excel update <id> ... | gog sheets update <id> ... |
🗂️ Configuration
| File | Purpose |
|---|---|
~/.config/mog/tokens.json | OAuth tokens (sensitive) |
~/.config/mog/settings.json | Client ID and settings |
~/.config/mog/slugs.json | ID-to-slug cache |
Environment Variables:
| Variable | Description |
|---|---|
MOG_CLIENT_ID | Azure AD client ID (alternative to --client-id) |
🛠️ Development
# Using Taskfile (recommended)
task test # Run tests
task test:coverage # With coverage
task lint # Lint
task fmt # Format
task check # All checks
# Or directly with Go
go test ./...
go build ./cmd/mog
📄 License
MIT
👨💻 Developed By
visionik and Vinston 🐺 (Clawdbot) using the visionik.md framework.
Permissions & Security
Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.
Requirements
- OpenClaw CLI installed and configured.
- Language: Markdown
- License: MIT
- Topics:
FAQ
How do I install mog?
Run openclaw add @visionik/mogcli in your terminal. This installs mog into your OpenClaw Skills catalog.
Does this skill run locally or in the cloud?
OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.
Where can I verify the source code?
The source repository is available at https://github.com/openclaw/skills/tree/main/skills/visionik/mogcli. Review commits and README documentation before installing.
