Command reference
ms365
A fast, scriptable CLI for Microsoft 365 (Microsoft Graph)
Synopsis
ms365 drives Microsoft 365 from the terminal via the Microsoft Graph API: read and send mail, manage your calendar, and inspect your profile — with named accounts so a personal Outlook.com sign-in and a work/school tenant live side by side and never cross tokens.
Sign-in is the OAuth device-code flow (no secrets stored beyond MSAL's refresh tokens,
which live in your OS keyring). The default sign-in is read-only; write commands tell you
the extra scope to grant (e.g. auth login --scopes Mail.Send).
Examples:
ms365 auth login -a personal
ms365 mail list -a personal --top 20
ms365 mail list --folder inbox --search "invoice"
ms365 mail get
Options
-a, --account string named account (profile) to use
--all follow @odata.nextLink until exhausted (list commands)
--base-url string Microsoft Graph base URL override (sovereign clouds)
--client-id string Entra app (client) ID override — defaults to the embedded Microsoft Graph Command Line Tools app
--columns strings comma-separated columns to show
--dry-run print the equivalent curl and make no request
-h, --help help for ms365
--jq string gojq expression applied to the response before rendering
--limit int max items to return across pages (list commands)
--no-color disable colored output
-o, --output string output format: table|json|yaml|csv|id
--quiet suppress non-essential chatter
--show-token reveal the bearer token in dry-run output
--timezone string return mail/calendar datetimes in this timezone (Prefer: outlook.timezone, e.g. "America/Caracas")
-v, --verbose verbose request logging (stderr)
SEE ALSO
- ms365 agent - AI-agent integration helpers
- ms365 alias - Manage user-defined command aliases
- ms365 api - Send a raw authenticated Graph request (escape hatch)
- ms365 auth - Sign in and out of Microsoft 365 accounts
- ms365 calendar - Read your Outlook calendar (Calendars.Read)
- ms365 completion - Generate shell completion scripts
- ms365 config - Inspect and edit ms365 configuration
- ms365 doctor - Diagnose configuration, keyring, and Graph connectivity
- ms365 init - First-run setup: name an account and sign in
- ms365 mail - Read Outlook mail (Mail.Read)
- ms365 mcp - MCP server management
- ms365 me - Show the signed-in user's profile (User.Read)
- ms365 update - Update ms365 to the latest GitHub release
- ms365 version - Print version, commit, and build date