← 返回
未分类 Key 中文

Ms365 Cli

Manage Microsoft 365 Emails and Calendar using the ms365 CLI. Trigger this skill when the user needs to "read my email", "send an email", "search emails", "c...
使用 ms365 CLI 管理 Microsoft 365 邮件和日历。当用户需要“读取邮件”、“发送邮件”、“搜索邮件”等时触发此技能。
thecfguy
未分类 clawhub v1.1.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 325
下载
💾 0
安装
1
版本
#latest

概述

Microsoft 365 Skill for OpenClaw

This skill empowers your OpenClaw agent to manage your Microsoft 365 Emails and Calendar directly from the terminal. It leverages the ms365 CLI tool to perform operations securely and efficiently.

Prerequisites

Before using this skill, ensure the ms365 CLI package is installed on the local system or available via npx.

# To install globally:
npm install -g ms365

Requirements:

  • Node.js 22 or later
  • A Microsoft 365 account (work, school, or personal)
  • An Azure AD app registration with delegated permissions

Authentication Lifecycle

The agent cannot authenticate on behalf of the user. The user must manually run these commands beforehand or you can prompt the user to run them in an interactive terminal.

  1. Configure Azure App credentials: ms365 auth configure --client-id --tenant-id
  2. Login to Microsoft 365: ms365 auth login (Uses Device Code flow; user action required)
  3. Check Auth Status: ms365 auth status
  4. Logout: ms365 auth logout

Capabilities & Usage Instructions

You (the Agent) can use the bash tool to execute ms365 CLI commands to interact with the user's Microsoft 365 account. Below are the allowed operations.

📧 Email Operations

List Emails

Use this to check recent messages or list items in a specific folder.

  • Command: ms365 email list
  • Modifiers:
  • -c, --count : Number of results (default: 20)
  • -f, --folder : Target folder - supports well-known names (inbox, sentitems, drafts, etc.), folder display names (case-insensitive), or folder IDs
  • --select : Comma-separated fields (e.g., subject,from,bodyPreview)
  • --list-folders: Show available folders instead of listing emails
  • --all-folders: List emails from all folders at once
  • Example: ms365 email list -c 5 -f inbox
  • Example: ms365 email list --list-folders

Read Email

Fetches the full content of an email message given its ID.

  • Command: ms365 email read
  • Example: ms365 email read AAMkADYzZ1...

Search Emails

Use Keyword Query Language (KQL) to find specific emails.

  • Command: ms365 email search ""
  • Modifiers:
  • -c, --count : Result count limit
  • Example: ms365 email search "from:boss@example.com subject:urgent" -c 10

Send Email

Compose and send an email directly without drafting it first.

  • Command: ms365 email send [options]
  • Modifiers:
  • --to : Comma-separated recipient emails (Required)
  • --subject "": Email subject line
  • --body "": The content of the email
  • --cc, --bcc: Additional recipients
  • --html: Treats the --body as HTML content
  • --importance : Sets email priority
  • Example: ms365 email send --to "jane@example.com" --subject "Meeting Notes" --body "Please find the notes attached."

Draft Email

Create an email that gets saved to the Drafts folder instead of sending immediately.

  • Command: ms365 email draft [options]
  • Modifiers: (Same as Send Email)
  • Example: ms365 email draft --to "team@example.com" --subject "Weekly Update" --body "Draft content here"

Move Email

Move an email from one folder to another. Supports well-known folder names, custom folder display names, and folder IDs.

  • Command: ms365 email move
  • Modifiers:
  • --list-folders: Show available folders before moving
  • Note: can be a well-known folder name (inbox, drafts, sentitems, deleteditems, junkemail, archive, outbox), a folder display name (case-insensitive), or a folder ID.
  • Example: ms365 email move AAMkAD... archive
  • Example: ms365 email move AAMkAD... "Archive 2024"

Delete Email

Moves an email to 'Deleted Items' or deletes it permanently.

  • Command: ms365 email delete
  • Modifiers:
  • --permanent: Hard-deletes the email bypassing 'Deleted Items'.
  • Example: ms365 email delete AAMkAD...

List Folders

List all available mail folders with metadata including unread counts and folder structure.

  • Command: ms365 email folders list
  • Modifiers:
  • -c, --count : Max number of folders (default: 50)
  • --select : Comma-separated fields
  • Example: ms365 email folders list

Folder Info

Get detailed information about a specific folder by name or ID.

  • Command: ms365 email folders info
  • Example: ms365 email folders info inbox

Create Folder

Create a new custom mail folder.

  • Command: ms365 email folders create
  • Modifiers:
  • --parent : Parent folder ID for nested folders
  • Example: ms365 email folders create "Archive 2024"

📅 Calendar Operations

List Events

Fetch upcoming calendar events.

  • Command: ms365 calendar list
  • Modifiers:
  • -d, --days : Lookahead days limit (default is 7)
  • --start , --end : ISO 8601 constraints (overrides days)
  • -c, --count : Maximum entries to return
  • Example: ms365 calendar list --days 3 -c 10

Create Event

Schedule a new meeting or blocker on the user's calendar.

  • Command: ms365 calendar create [options]
  • Modifiers:
  • --subject ""</code>: Event title</li><li><code>--start <datetime></code>: ISO 8601 string (e.g., <code>2024-07-01T09:00:00</code>)</li><li><code>--end <datetime></code>: ISO 8601 string (e.g., <code>2024-07-01T10:00:00</code>)</li><li><code>--timezone <tz></code>: IANA timezone (default <code>UTC</code>, e.g., <code>America/New_York</code>)</li><li><code>--attendees <emails></code>: Comma-separated addresses</li><li><code>--body "<content>"</code>: Event details (<code>--html</code> can be used to treat body as HTML)</li><li><code>--location "<location>"</code>: Physical or virtual location string</li><li><code>--all-day</code>: Flag to make this an all-day event</li><li><code>--online-meeting</code>: Automatically creates and attaches a Teams link</li><li><strong>Example:</strong> <code>ms365 calendar create --subject "Sync" --start "2024-07-01T09:00:00" --end "2024-07-01T09:30:00" --attendees "bob@example.com" --online-meeting</code></li></ul><h4>Delete Event</h4><p>Remove an event from the calendar.</p><ul><li><strong>Command:</strong> <code>ms365 calendar delete <id></code></li><li><strong>Example:</strong> <code>ms365 calendar delete AAMkADc...</code></li></ul><h4>Create Recurring Event</h4><p>Schedule a recurring meeting or blocker on the user's calendar.</p><ul><li><strong>Command:</strong> <code>ms365 calendar series-create [options]</code></li><li><strong>Modifiers:</strong></li><li><code>--subject "<title>"</code>: Event title (Required)</li><li><code>--start <datetime></code>: ISO 8601 start time (Required)</li><li><code>--end <datetime></code>: ISO 8601 end time (Required)</li><li><code>--pattern <pattern></code>: Recurrence pattern (daily, weekly, absoluteMonthly, relativeMonthly, absoluteYearly, relativeYearly) (Required)</li><li><code>--interval <number></code>: Interval between occurrences (default: 1)</li><li><code>--days-of-week <days></code>: For weekly patterns (Mo,Tu,We,Th,Fr,Sa,Su)</li><li><code>--range <type></code>: How recurrence ends (endDate, noEnd, numbered) (default: noEnd)</li><li><code>--end-date <datetime></code>: End date for recurrence (Required if range is endDate)</li><li><code>--occurrences <number></code>: Number of occurrences (Required if range is numbered)</li><li><code>--timezone <tz></code>: IANA timezone (default: UTC)</li><li><code>--attendees <emails></code>: Comma-separated addresses</li><li><code>--body "<content>"</code>: Event details</li><li><code>--location "<location>"</code>: Physical or virtual location</li><li><code>--all-day</code>: Make this an all-day event</li><li><code>--online-meeting</code>: Automatically creates and attaches a Teams link</li><li><strong>Example:</strong> <code>ms365 calendar series-create --subject "Daily Standup" --start "2024-07-10T09:00:00" --end "2024-07-10T09:30:00" --pattern daily --range numbered --occurrences 10</code></li></ul><h4>Delete Recurring Event</h4><p>Remove a recurring event or individual occurrences from the series.</p><ul><li><strong>Command:</strong> <code>ms365 calendar series-delete <id></code></li><li><strong>Modifiers:</strong></li><li><code>--this-and-following</code>: Delete this and following events in series</li><li><code>--single</code>: Delete only this single occurrence</li><li><strong>Example:</strong> <code>ms365 calendar series-delete AAMkADc...</code></li></ul><hr><h3>📇 Contacts Operations</h3><h4>List Contacts</h4><p>Fetch contacts from your personal contacts folder.</p><ul><li><strong>Command:</strong> <code>ms365 contacts list</code></li><li><strong>Modifiers:</strong></li><li><code>-c, --count <number></code>: Number of results (default: 50)</li><li><code>--select <fields></code>: Comma-separated fields</li><li><strong>Example:</strong> <code>ms365 contacts list --count 25</code></li></ul><h4>Search Contacts</h4><p>Search contacts by name or email address.</p><ul><li><strong>Command:</strong> <code>ms365 contacts search "<query>"</code></li><li><strong>Modifiers:</strong></li><li><code>-c, --count <number></code>: Max results to return (default: 25)</li><li><strong>Example:</strong> <code>ms365 contacts search "alice@example.com" --count 10</code></li></ul><hr><ul><li><strong>Data limits:</strong> By default, list commands return bounded records. If you need more context, use <code>--count</code> responsibly. Do not request more than 100 items at once to avoid payload bloating.</li><li><strong>Always Verify IDs:</strong> Ensure that you have the correct item ID before executing mutating operations like <code>move</code> or <code>delete</code>. You can retrieve IDs using the <code>list</code> or <code>search</code> commands.</li><li><strong>Dates and Timezones:</strong> When creating calendar events, verify the user's local timezone. Always provide explicit timezones using the <code>--timezone</code> flag or use UTC natively.</li><li><strong>Auth Tokens:</strong> If <code>ms365</code> returns authentication errors like <code>Token expired</code> or <code>Unauthorized</code>, prompt the user to run <code>ms365 auth login</code>.</li></ul></div> </div> </div> <div id="tab-versions" class="detail-content"> <div class="detail-section"> <h2>版本历史</h2> <p style="margin-bottom:12px;font-size:14px;color:#94a3b8;">共 1 个版本</p> <ul class="version-list"> <li> <div> <span class="version-tag">v1.1.0</span> <span style="font-size:11px;color:#5b6abf;margin-left:8px;background:#eef0ff;padding:1px 8px;border-radius:10px;">当前</span> </div> <div style="font-size:12px;color:#94a3b8;"> 2026-05-07 13:09 安全 安全 </div> </li> </ul> </div> </div> <div id="tab-security" class="detail-content"> <div class="detail-section"> <h2>安全检测</h2> <div class="sec-grid"> <div class="sec-card"> <h4>腾讯云安全 (Keen)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://tix.qq.com/search/skill?keyword=71af3ed29e04591624068e1f1f024ade" target="_blank">查看报告</a> </div> <div class="sec-card"> <h4>腾讯云安全 (Sanbu)</h4> <div class="sec-status sec-safe"> 安全,无风险 </div> <a href="https://static.cloudsec.tencent.com/html-report-v2/2026/05/26/443543_db611b127b28670fdfbe3ceae38d88b6.html?q-sign-algorithm=sha1&q-ak=AKID8JMG1bzBC1dz96qNhssfFftujT1NCoFi&q-sign-time=1781965868%3B1813501868&q-key-time=1781965868%3B1813501868&q-header-list=host&q-url-param-list=&q-signature=cfe3dae94ae702d404a7bb014050a5e3722802eb" target="_blank">查看报告</a> </div> </div> </div> </div> <!-- Recommended Skills --> <div style="margin-top:24px;"> <h2 style="font-size:18px;font-weight:600;margin-bottom:16px;">🔗 相关推荐</h2> <div class="rec-grid"> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">office-efficiency</span> <h3><a href="/s/excel-xlsx">Excel / XLSX</a></h3> <div class="rec-owner">ivangdavila</div> <div class="rec-desc">创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 381</span> <span style="color:#5b6abf;">📥 144,061</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">office-efficiency</span> <h3><a href="/s/gog">Gog</a></h3> <div class="rec-owner">steipete</div> <div class="rec-desc">Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 926</span> <span style="color:#5b6abf;">📥 186,721</span> </div> </div> <div class="rec-card"> <span class="badge-cat" style="margin-bottom:8px;display:inline-block;">office-efficiency</span> <h3><a href="/s/word-docx">Word / DOCX</a></h3> <div class="rec-owner">ivangdavila</div> <div class="rec-desc">创建、检查和编辑 Microsoft Word 文档及 DOCX 文件,支持样式、编号、修订记录、表格、分节符及兼容性检查等功能。</div> <div class="rec-stats"> <span style="color:#f39c12;">★ 457</span> <span style="color:#5b6abf;">📥 151,507</span> </div> </div> </div> </div> </div> <script> document.addEventListener('DOMContentLoaded',function(){ document.querySelectorAll('.detail-tab').forEach(function(btn){ btn.addEventListener('click',function(e){ var tab = this.getAttribute('data-tab'); document.querySelectorAll('.detail-tab').forEach(function(b){b.classList.remove('active')}); document.querySelectorAll('.detail-content').forEach(function(c){c.classList.remove('active')}); this.classList.add('active'); var el = document.getElementById('tab-'+tab); if(el) el.classList.add('active'); }); }); }); </script> <div class="footer"> <p>Skill工具集 © 2026</p> </div></body> </html>