← 返回
开发者工具

Mog

Microsoft Ops Gadget — CLI for Microsoft 365 (Mail, Calendar, Drive, Contacts, Tasks, Word, PowerPoint, Excel, OneNote).
Microsoft Ops Gadget —— Microsoft 365 命令行工具(邮件、日历、网盘、联系人、任务、Word、PowerPoint、Excel、OneNote)。
visionik
开发者工具 clawhub v0.3.1 1 版本 99263.3 Key: 无需
★ 6
Stars
📥 2,979
下载
💾 225
安装
1
版本
#latest

概述

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

ModuleCommands
------------------
mailsearch, get, send, folders, drafts, attachment
calendarlist, create, get, update, delete, calendars, respond, freebusy, acl
drivels, search, download, upload, mkdir, move, rename, copy, rm
contactslist, search, get, create, update, delete, directory
taskslists, list, add, done, undo, delete, clear
wordlist, export, copy
pptlist, export, copy
excellist, get, update, append, create, metadata, tables, add-sheet, clear, copy, export
onenotenotebooks, 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 calmog calendar
  • mog todomog tasks

Credential Storage

OAuth tokens stored in config directory (0600 permissions):

PlatformLocation
--------------------
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 --help - Command-specific help

版本历史

共 1 个版本

  • v0.3.1 当前
    2026-03-28 12:45 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 666 📥 323,791
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 920 📥 185,727
content-creation

Ecto

visionik
用于管理博客文章、页面、标签和内容的 Ghost.io 管理 API 命令行工具。
★ 1 📥 2,282