|
351 | 351 | <body> |
352 | 352 | <div class="page"> |
353 | 353 | <h1 id="m365-cli">M365 CLI</h1> |
354 | | - <p style="font-size: 0.75rem; color: var(--text-light); font-weight: 200; margin-bottom: 2rem;">Updated Mar 23, 2026</p> |
| 354 | + <p style="font-size: 0.75rem; color: var(--text-light); font-weight: 200; margin-bottom: 2rem;">Updated Apr 1, 2026</p> |
355 | 355 |
|
356 | 356 | <div class="callout"><strong>Internal tool.</strong> M365 CLI gives you command-line access to Microsoft 365 services — Teams, Outlook Mail, Calendar, OneDrive & SharePoint Files, and User Profile. Built in Rust, connects via MCP protocol to Microsoft Graph. 80 actions across 5 services, all from your terminal.</div> |
357 | 357 |
|
358 | | - <p class="intro">Install in 30 seconds, authenticate once, then access all of M365 from the command line. Works standalone or as an AI skill for Claude Code / Codex.</p> |
| 358 | + <p class="intro">Install in 30 seconds, authenticate once, then access all of M365 from the command line. Works standalone or as an AI skill for Claude Code, Codex, and other AI agents.</p> |
359 | 359 |
|
360 | 360 | <!-- INSTALL --> |
361 | 361 | <h2 id="install">Install</h2> |
@@ -501,34 +501,53 @@ <h3 id="favorites-workflow">Before and after</h3> |
501 | 501 | # Sync favorites to OneDrive backup |
502 | 502 | m365 fav sync</code></pre> |
503 | 503 |
|
504 | | - <!-- CLAUDE CODE SKILL --> |
505 | | - <h2 id="skill">Using as a Claude Code skill</h2> |
| 504 | + <!-- AI AGENT SKILL --> |
| 505 | + <h2 id="skill">Using as an AI agent skill</h2> |
506 | 506 |
|
507 | | - <p>The M365 CLI comes with a skill file (<code>SKILL.md</code>) that gives Claude full knowledge of all 80 commands, parameters, and common workflows. This turns Claude into an M365 operator — it can send messages, search emails, schedule meetings, and manage files on your behalf.</p> |
| 507 | + <p>The M365 CLI comes with a skill file (<code>SKILL.md</code>) that gives AI agents full knowledge of all 80+ commands, parameters, and common workflows. The skill file is written for agents — it tells the agent how to install, authenticate, and use the CLI on the user's behalf.</p> |
| 508 | + |
| 509 | + <h3 id="agent-setup">Agent setup workflow</h3> |
| 510 | + |
| 511 | + <p>The skill file includes a 6-step setup workflow designed for AI agents to follow. Here's what happens when an agent sets up the CLI for the first time:</p> |
508 | 512 |
|
509 | 513 | <ol class="steps"> |
510 | 514 | <li> |
511 | | - <strong>Install the CLI</strong> — follow the <a href="#install">install steps</a> above. |
| 515 | + <strong>Run the installer</strong> — the agent launches the one-liner install script. On <strong>macOS</strong>, Gatekeeper may prompt the user to allow the binary. On <strong>Windows</strong>, a UAC elevation prompt appears (needed for Defender exclusion). The agent tells the user to approve any OS-level prompts. |
| 516 | + </li> |
| 517 | + <li> |
| 518 | + <strong>Wait for user confirmation</strong> — the agent pauses and asks the user to confirm the installation completed. The installer may fail silently or need user action. |
| 519 | + </li> |
| 520 | + <li> |
| 521 | + <strong>Verify installation</strong> — the agent checks the binary exists at the expected path (<code>~/.local/bin/m365</code> on macOS/Linux, <code>%LOCALAPPDATA%\m365-cli\m365.exe</code> on Windows) and runs <code>m365 --help</code>. |
| 522 | + </li> |
| 523 | + <li> |
| 524 | + <strong>Login</strong> — the agent runs <code>m365 login</code> using the <strong>absolute path</strong> to the binary (since PATH may not be updated in the current session). The user completes Microsoft Entra ID sign-in in the browser. The agent verifies with <code>m365 status</code>. |
512 | 525 | </li> |
513 | 526 | <li> |
514 | | - <strong>Install the skill</strong> — use Claude Code's plugin system: |
515 | | - <pre><code>/plugin marketplace add ttthree/m365-cli-docs |
516 | | -/plugin install m365-cli@m365-cli-docs</code></pre> |
517 | | - <p style="margin-top: 0.8em; font-size: 0.85rem; color: var(--text-dim);">Or manually download <code>SKILL.md</code>:</p> |
518 | | - <pre><code>mkdir -p .claude/skills/m365-cli |
519 | | -curl -fsSL https://raw.githubusercontent.com/ttthree/m365-cli-docs/main/skills/m365-cli/SKILL.md \ |
520 | | - -o .claude/skills/m365-cli/SKILL.md</code></pre> |
| 527 | + <strong>Install the skill file</strong> — the agent places <code>SKILL.md</code> in the appropriate skill directory for the platform: |
| 528 | + <table style="margin-top: 0.8em;"> |
| 529 | + <tbody> |
| 530 | + <tr><td><strong>Claude Code</strong></td><td><code>.claude/skills/m365-cli/SKILL.md</code> or <code>claude plugin add</code></td></tr> |
| 531 | + <tr><td><strong>Eureka</strong></td><td><code>skills/m365-cli/SKILL.md</code> in the workspace</td></tr> |
| 532 | + <tr><td><strong>Others</strong></td><td>Consult agent docs for skill directory location</td></tr> |
| 533 | + </tbody> |
| 534 | + </table> |
521 | 535 | </li> |
522 | 536 | <li> |
523 | | - <strong>Use it</strong> — Claude Code automatically discovers the skill. Just ask naturally: |
524 | | - <pre><code>> Send a Teams message to Alex saying "meeting at 3pm" |
| 537 | + <strong>Restart the agent session</strong> — most agents load skill files at startup, so a new session is needed for the skill to take effect. After restart, <code>m365</code> should be on PATH. |
| 538 | + </li> |
| 539 | + </ol> |
| 540 | + |
| 541 | + <h3 id="agent-usage">Once set up</h3> |
| 542 | + |
| 543 | + <p>After setup, the agent can handle M365 tasks naturally:</p> |
| 544 | + |
| 545 | + <pre><code>> Send a Teams message to Alex saying "meeting at 3pm" |
525 | 546 | > What emails did I get from my manager today? |
526 | 547 | > Schedule a 30-min meeting with the team tomorrow morning |
527 | 548 | > Summarize the last 20 messages in the Project Alpha chat</code></pre> |
528 | | - </li> |
529 | | - </ol> |
530 | 549 |
|
531 | | - <div class="callout"><strong>Favorites-first.</strong> The skill instructs Claude to always check <code>m365 fav get</code> before any operation that needs an ID. This means Claude resolves "send a message to Alex" in one step instead of three — no user ID lookup, no chat creation, just send.</div> |
| 550 | + <div class="callout"><strong>Favorites-first.</strong> The skill instructs agents to always check <code>m365 fav get</code> before any operation that needs an ID. This means the agent resolves "send a message to Alex" in one step instead of three — no user ID lookup, no chat creation, just send.</div> |
532 | 551 |
|
533 | 552 | <!-- ARCHITECTURE --> |
534 | 553 | <h2 id="architecture">Architecture</h2> |
|
0 commit comments