Skip to content

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 ms365 mail send --to ana@example.com --subject "Lunch?" --body "12:30?" ms365 calendar events --from 2026-07-20 --to 2026-07-27 ms365 calendar create --subject "1:1" --from 2026-07-21T10:00 --to 2026-07-21T10:30 ms365 me -o json

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