mog

Review·Scanned 2/19/2026

This skill is a Microsoft 365 CLI (mog) that manages Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, and OneNote via Microsoft Graph. It makes network calls to https://graph.microsoft.com/v1.0 and https://login.microsoftonline.com/common/oauth2/v2.0, stores OAuth tokens at ~/.config/mog/tokens.json (and supports keyring), and includes build/run commands like go build -o {{.BINARY}} ./cmd/mog.

from clawhub.ai·vd40bacb·356.0 KB·0 installs
Scanned from 0.3.1 at d40bacb · Transparency log ↗
$ vett add clawhub.ai/visionik/mogReview findings below

📊 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

ModuleDescription
📧 MailSearch, send, drafts, attachments, folders
📅 CalendarEvents, create, respond, freebusy, ACL
📁 DriveOneDrive files — list, upload, download, move
👥 ContactsPersonal contacts + org directory lookup
TasksMicrosoft To-Do — lists, add, complete, clear
📝 WordDocuments — list, export, copy
📊 PowerPointPresentations — list, export, copy
📈 ExcelSpreadsheets — read, write, tables, export
📓 OneNoteNotebooks, sections, pages, search

Extras:

  • 🔗 Slug system — 8-char shorthand for Microsoft's long GUIDs
  • 🤖 AI-friendly--ai-help outputs 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

  1. Go to Azure PortalApp registrationsNew registration
  2. Name: mog CLI (or any name)
  3. Supported account types: Select based on your needs
  4. Redirect URI: Leave blank (uses device code flow)

2. Add API Permissions

Add these Delegated permissions:

PermissionDescription
User.ReadSign in and read user profile
offline_accessMaintain access (refresh tokens)
Mail.ReadWriteRead and write mail
Mail.SendSend mail
Calendars.ReadWriteFull calendar access
Files.ReadWrite.AllFull OneDrive access
Contacts.ReadRead contacts
Contacts.ReadWriteFull contacts access
People.ReadRead people
Tasks.ReadWriteRead and write tasks
Notes.ReadWriteRead 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

OptionDescription
--jsonOutput JSON (best for scripting)
--plainStable text output (TSV, no colors)
--verboseShow full IDs and extra details
--forceSkip confirmations
--no-inputNever prompt (CI mode)
--ai-helpFull docs for AI agents

📧 Mail

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 calmog 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 todomog 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 --verbose to also see full IDs
  • ✅ Slugs cached in ~/.config/mog/slugs.json
  • mog auth logout clears 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:

Patternmoggog
Calendar events--summary, --from, --toSame
Task notes--notesSame
Output format--json, --plainSame
Max results--maxSame
Excel readmog excel get <id> Sheet1 A1:D10gog sheets get <id> Sheet1!A1:D10
Spreadsheet writemog excel update <id> ...gog sheets update <id> ...

🗂️ Configuration

FilePurpose
~/.config/mog/tokens.jsonOAuth tokens (sensitive)
~/.config/mog/settings.jsonClient ID and settings
~/.config/mog/slugs.jsonID-to-slug cache

Environment Variables:

VariableDescription
MOG_CLIENT_IDAzure 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.