Skip to content
Jason's Blog
Go back

Introducing M365 CLI: A Modern Terminal Interface for Microsoft 365

I’m excited to announce the release of M365 CLI, a modern command-line interface for Microsoft 365. Whether you’re using a work/school account or a personal Microsoft account (Outlook.com, Hotmail, Live), you can now manage Mail, Calendar, OneDrive, and SharePoint directly from your terminal.

Why M365 CLI?

While there are existing tools for Microsoft 365, this CLI was built with two primary audiences in mind:

1. AI Agents (Like OpenClaw)

The primary motivation behind this project was to give AI agents a reliable, script-friendly way to interact with Microsoft 365 on behalf of users. By supporting structured JSON output and natural language workflows, agents can now:

2. Power Users

For developers and terminal enthusiasts, switching to a heavy GUI just to check an email or upload a file breaks focus. M365 CLI provides:

Key Features

Getting Started

Installation is simple via npm:

npm install -g m365-cli

Quick Usage Examples

Login:

# Work or school account (default)
m365 login

# Personal Microsoft account
m365 login --account-type personal

Check your latest emails:

m365 mail list --top 5

See your upcoming week:

m365 calendar list --days 7

Browse your OneDrive:

m365 onedrive ls

AI Agent Skills Available

If you are using an AI agent framework like OpenClaw, the corresponding skills are already published and ready to use on ClawHub:

Open Source

M365 CLI is completely open-source under the MIT License. Check out the code, read the full documentation, and contribute on GitHub:

👉 mrhah/m365-cli on GitHub

Give it a try and let me know how it fits into your workflow—whether you’re using it yourself or empowering your AI assistants!


Share this post on:

Previous Post
Workaround: Adding Unreleased GitHub Copilot Models to OpenClaw
Next Post
Bridging the Gap: Introducing M365 CLI for AI Agents and Power Users