ClawSkills logoClawSkills

Mog

Microsoft Ops Gadget — Microsoft 365 的命令行界面(邮件、日历、云端硬盘、联系人、任务、Word、PowerPoint、Excel、OneNote)。

介绍

# mog — Microsoft Ops Gadget

Microsoft 365 的命令行界面:邮件、日历、OneDrive、联系人、任务、Word、PowerPoint、Excel、OneNote。

这是 `gog` (Google Ops Gadget) 的 Microsoft 对应版本。相同的模式,不同的云。

## 快速参考

要获取全面的使用说明,请运行: ```bash mog --ai-help ```

这将输出符合 dashdash 规范的完整文档,包括: - 设置/先决条件 - 所有命令和选项 - 日期/时间格式 - 示例(正面和反面) - 故障排除 - Slug 系统说明 - gog 兼容性说明

## 模块

| 模块 | 命令 | |--------|----------| | **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 |

## 快速开始

```bash # Mail mog mail search "from:someone" --max 10 mog mail send --to [email protected] --subject "Hi" --body "Hello" mog mail send --to [email protected] --subject "Report" --body-file report.md mog mail send --to [email protected] --subject "Newsletter" --body-html "<h1>Hello</h1>" cat draft.txt | mog mail send --to [email protected] --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 [email protected] [email protected]

# 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 会为 Microsoft 冗长的 GUID 生成 8 个字符的 slug: - 使用 `a3f2c891` 代替 `AQMkADAwATMzAGZmAS04MDViLTRiNzgt...` - 所有命令都接受 slug 或完整 ID - 使用 `--verbose` 查看完整 ID

## 别名

- `mog cal` → `mog calendar` - `mog todo` → `mog tasks`

## 凭据存储

OAuth 令牌存储在配置目录中(权限为 0600):

| 平台 | 位置 | |----------|----------| | **macOS** | `~/.config/mog/` | | **Linux** | `~/.config/mog/` | | **Windows** | `%USERPROFILE%\.config\mog\` |

文件: - `tokens.json` - OAuth 令牌(由操作系统静态加密) - `settings.json` - 客户端 ID - `slugs.json` - Slug 缓存

## 另请参阅

- `mog --ai-help` - 完整文档 - `mog <command> --help` - 特定命令的帮助

更多产品