Skip to main content

outlook-cli

Microsoft Outlook from your terminal—for humans and agents.

outlook-cli is an early Rust CLI for Outlook mail and calendars through the supported Microsoft Graph API, with an optional classic Outlook desktop backend for Windows and WSL. It aims to provide calm terminal workflows for people and a deterministic, introspectable command contract for automation.

Current milestone

  • Work/school and personal Microsoft accounts through delegated OAuth
  • Tokens protected by the operating system credential store
  • Mail listing, reading, search, sending, replying, moving, deletion, and read-state updates
  • Draft lifecycle and attachment upload/download up to 150 MiB
  • Calendar agenda and event creation
  • Text output on a terminal and JSON when piped
  • Read-only profiles, bounded collections, stable errors, and CLI Spec v0.3

Build

cargo build
cargo test --locked --all-targets

Windows tests also execute the bundled PowerShell bridge against mock Outlook objects, without accessing a mailbox. On other platforms this test can be run with a portable PowerShell installation:

OUTLOOK_TEST_POWERSHELL=/path/to/pwsh cargo test --test desktop_bridge -- --ignored

Install

cargo install outlook-cli --locked
# or, using a prebuilt wheel (supported platforms below)
uv tool install outlook-cli-rs

Both packages install the outlook executable.

Starting with 0.2.3, PyPI wheels cover Windows x64, macOS Intel/Apple Silicon, and Linux x64/ARM64 (glibc 2.17+ or musl 1.2+). WSL uses the Linux wheel. These wheels contain the compiled executable, so Rust is not needed to install or run them. Other platforms require Rust and native build tools to build the source distribution. To require a prebuilt package and fail instead of compiling:

uv tool install --no-build outlook-cli-rs

See the release process for the build matrix and publication checks.

Configure

outlook-cli includes a maintained multitenant Microsoft Entra public-client registration, so the normal setup is simply:

outlook init

The registration requests delegated Microsoft Graph permissions only: User.Read, Mail.ReadWrite, Mail.Send, and Calendars.ReadWrite. A read-only profile requests Mail.Read and Calendars.Read instead.

For a staged or headless setup:

outlook init --no-login
outlook auth login

Read-only profiles also block remote writes locally:

outlook init --read-only

Organizations with restrictive consent policies can use their own public-client registration. Enable public client flows and supply its Application (client) ID:

outlook init --client-id YOUR_APPLICATION_ID

The same override is available through OUTLOOK_CLIENT_ID. Tenant policy can still require administrator approval, and the maintained registration is not yet publisher verified while the project is in its early development phase.

For short-lived automation, OUTLOOK_ACCESS_TOKEN overrides stored credentials.

Classic Outlook on Windows / WSL

Use the same executable with a desktop profile:

outlook init --profile local --backend desktop
outlook --profile local inbox --limit 10
outlook --profile local mail folders
outlook --profile local mail folders --parent inbox
outlook --profile local mail list --folder sentitems
outlook --profile local mail search 'quarterly report' --limit 20
outlook --profile local mail read MESSAGE_ID
outlook --profile local doctor

Requires classic Outlook, a configured and signed-in Windows Outlook profile, and powershell.exe on PATH. From WSL, Windows executable interop must be enabled. New Outlook does not support COM/OOM or MAPI. See Microsoft's Outlook feature comparison.

Desktop initialization checks the connection; --no-login saves a profile without launching Outlook, including when preparing configuration on another platform. Authentication is managed in Windows Outlook. No Graph OAuth registration or token is used. auth status verifies desktop access; auth status --offline only reports configuration and leaves sign-in state unknown. doctor --offline checks platform and PowerShell availability without launching Outlook.

The CLI uses Outlook's active Windows profile and default store. A CLI profile selects the backend; it does not switch the Windows Outlook profile or account. Well-known folders resolve in the default store. mail folders lists its top-level mail folders; use --parent with a returned ID to browse further. Supported names are inbox, sentitems, deleteditems, outbox, drafts, and junkemail.

Desktop supports folder and message listing, reading, search, send, reply/reply-all, move, delete, mark-read/unread, and draft list/create/update/send/delete. Attachments, calendar commands, and whoami return unsupported. Read-only profiles block writes; deleting messages or drafts requires confirmation (or --yes).

New messages and replies use plain text and Outlook's configured sending account. A successful send means Outlook accepted the message for sending; offline Outlook may queue it. Draft updates preserve omitted fields; --clear-to, --clear-cc, and --clear-bcc remove the corresponding recipients. Draft update/send/delete reject sent messages and messages already submitted for sending. Moves return the message's new desktop ID; use that ID for subsequent commands. Delete follows Outlook's behavior, including permanent deletion from Deleted Items. If a write times out or the bridge fails, check Outlook before retrying: it may have completed. There is no automatic fallback to Graph. Existing profiles without a backend field continue to use Graph, which remains the default for init.

Desktop search is case-insensitive literal text in subject, sender name, or sender address, limited to one folder (inbox by default). KQL and regular expressions are not interpreted. Sender addresses may be Exchange legacy addresses as exposed by Outlook. Results reflect the desktop client's available/synchronized data.

Text output includes copyable message IDs and continuation tokens; JSON exposes the same values as structured fields. Desktop IDs encode both EntryID and StoreID, are unrelated to Graph IDs, and can change after moves. Pages scan at most 1,000 items or about 30 seconds before returning a continuation; a search page can be empty with more items still to scan. Pass --cursor with the same command, folder, and query to continue. Pagination uses item positions, so mailbox changes between calls can cause skipped or repeated results. Restart listing after switching the Windows Outlook profile or account.

The bundled PowerShell bridge receives input as JSON on stdin, returns JSON, and releases COM references without quitting Outlook. The CLI waits up to 45 seconds; Outlook may show Windows profile or security prompts. A timeout terminates the local bridge process, but WSL interop can leave a Windows-side process or prompt running; inspect Windows if a call times out.

Commands

outlook inbox --limit 20
outlook mail folders
outlook mail read MESSAGE_ID
outlook mail search 'subject:"quarterly report"' --limit 20
outlook mail mark-read MESSAGE_ID
printf 'All set.' | outlook mail reply MESSAGE_ID --body -
outlook mail send --to person@example.com --bcc archive@example.com \
  --subject 'Hello' --body 'Hi'
outlook mail move MESSAGE_ID --destination archive
outlook mail delete MESSAGE_ID --yes
outlook mail draft create --to person@example.com --subject 'Report' --body 'Attached.'
outlook mail attachment add DRAFT_ID ./report.pdf --content-type application/pdf
outlook mail attachment list DRAFT_ID
outlook mail attachment download MESSAGE_ID ATTACHMENT_ID ./report.pdf
outlook mail draft send DRAFT_ID
outlook calendar agenda --start 2026-09-03T00:00:00Z --end 2026-09-10T00:00:00Z
outlook calendar create --subject 'Project sync' \
  --start 2026-09-04T09:00:00 --end 2026-09-04T09:30:00 \
  --timezone Europe/Amsterdam --attendee person@example.com
outlook auth status                 # verify the selected credential
outlook auth status --offline       # inspect local credential state only
outlook profile list
outlook profile use work
outlook profile remove old --yes
outlook config show
outlook config path
outlook doctor --offline
outlook schema --command 'mail send'

Graph message and event requests opt into immutable Outlook IDs. Remote writes are blocked when the active profile is read-only. Destructive commands confirm on a terminal and require --yes in automation. Attachment downloads never overwrite unless --force is supplied; uploads switch automatically to Microsoft's resumable upload sessions at 3 MiB. Stdout contains data; diagnostics and sign-in instructions go to stderr.

Interactive inbox

outlook tui                         # Browse the active profile's inbox
outlook tui --folder sentitems       # Open another folder
outlook --profile local tui          # Classic Outlook on Windows/WSL
outlook tui --demo                   # Try sample mail without signing in
outlook tui --demo --snapshot        # Print an offline sample screen

The browser is read-only: previewing a message does not mark it as read. Wide terminals show a message list and a reading pane; below 100 columns, Enter or Tab switches between them. The minimum usable size is 36 × 12. Colors follow your terminal palette and respect --no-color and NO_COLOR.

Key Action
↑ / ↓ or j / k Select a message, or scroll the focused preview
Enter / Tab Switch between list and preview
Page Up / Page Down Scroll the message by ten lines
Home / End Jump to the beginning or end of the focused preview
/ Search the current folder; Enter applies, Esc cancels
Esc in the list Clear the search, or quit if no search is active
f Browse folders; Enter opens a folder's mail
→ / ← in folders Browse children / return to the parent
n Load the next page when available
r Refresh the focused pane, or retry a failed request
? Open the keyboard guide
q / Ctrl+C Quit

Graph searches use Outlook syntax; desktop searches use literal subject/sender text. Folder browsing includes child folders and pagination. An empty desktop search page can still have more matches to scan; press n when offered. Reads run asynchronously, with a timeout and cancellable previews. On WSL, the desktop bridge's existing Windows-process cleanup limitations still apply. Sign in with outlook init or outlook auth login before opening a live inbox. Interactive mode requires terminal input and output; use the regular commands and JSON for scripts. --snapshot always prints plain sample text and supports --width (36–240) and --height (12–100).

Terminal experience

Run outlook in a terminal for a quick-start guide. Mail lists show full subjects, sender details, unread and attachment indicators, and copyable IDs. Message reading includes recipients and preserves body paragraphs. Folders show total and unread counts; attachments show readable sizes; agendas include timezone and location when supplied by the backend. Paginated text output includes the next cursor, including when a desktop search returns an empty page with more items to scan.

Headings use a restrained cyan accent on terminals. Set NO_COLOR=1 or pass --no-color to disable colors. Redirected text has no color escapes. Mail views remove terminal control sequences from remote content before displaying it.

outlook inbox --output text          # Readable output even when redirected
outlook inbox --output json          # Structured records for scripts
outlook --no-color mail read MESSAGE_ID

Status

The command surface is under active development. Rich HTML composition, inline attachments, meeting responses, contacts, and delta synchronization are planned after the core Graph and authentication contracts settle.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

outlook_cli_rs-0.2.4.tar.gz (106.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

outlook_cli_rs-0.2.4-py3-none-win_amd64.whl (3.5 MB view details)

Uploaded Python 3Windows x86-64

outlook_cli_rs-0.2.4-py3-none-musllinux_1_2_x86_64.whl (4.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

outlook_cli_rs-0.2.4-py3-none-musllinux_1_2_aarch64.whl (4.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

outlook_cli_rs-0.2.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

outlook_cli_rs-0.2.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.9 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

outlook_cli_rs-0.2.4-py3-none-macosx_11_0_arm64.whl (3.6 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

outlook_cli_rs-0.2.4-py3-none-macosx_10_12_x86_64.whl (3.8 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file outlook_cli_rs-0.2.4.tar.gz.

File metadata

  • Download URL: outlook_cli_rs-0.2.4.tar.gz
  • Upload date:
  • Size: 106.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.5

File hashes

Hashes for outlook_cli_rs-0.2.4.tar.gz
Algorithm Hash digest
SHA256 14304ca4b98cd02b7f057596722e5855181abf840a107f2bcf03e8b2e35a1af6
MD5 5aca2b684eb255f6f3c6180f2fe5d5cf
BLAKE2b-256 8b29e2c4a7afa2203ba93fa82cab470dfb966dbbe4a28e05d892e65edbf8fdf8

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ae71a3225c1d396a6e2de1c8f85d8f666735b9bde4f7138b69c10d171b16f420
MD5 c58a05b14f299ae1ceab178908176f34
BLAKE2b-256 f07d81059db260c606993acf8d8f80dc58b0201934df5e51790465ded88b6fb2

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8144930f73922687e0c2da612a2f7b16cfac2cee5e331a789354180cf8f6fdab
MD5 f3661098daed27eab9224215fda30c1e
BLAKE2b-256 cf9034b3e81c9f589ad06b0c08959a3a3db2d3b40bac8961e70deed3af3efe83

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1b3c7851664dcb032ab837357a14d8843cb7182c9a5c8b58ca2585609ce29d00
MD5 d092cf883bedab37fd0cbf6818616a4f
BLAKE2b-256 0e68a522dd8981f5af32a80deace4f15611e1ada1ba7a197b8b37906797a6605

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7317b23ba71aba9f571ada01dd4b630102007863d3936e62219478fe599a4de0
MD5 0ebf79cdd1d352a26045f12d81987c9c
BLAKE2b-256 0d0b05b2e35f3bbb969ace9259a2fa327b11b66181bc6c51e9b8f10545838846

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c77733ae0b6a2f221aedb59976c3f046aaac58e393bafdd245152de5621b5d19
MD5 41de00238b09e9d9d5cff341b5e21671
BLAKE2b-256 73c6392b8fc5dc13b3e82fdd1a8cdbbb7b1d9749d902ecdb71775e28ab80be73

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a218e1575f446570149c18a86283ac72eb0a6f09b50b67c7fb8a2073b2eb4b7
MD5 b1a15fb24de44f4027e82ae1a7838327
BLAKE2b-256 766d4d12beaf04499c2599ec657c417472ed9db7186a6e5d286580d662c39894

See more details on using hashes here.

File details

Details for the file outlook_cli_rs-0.2.4-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for outlook_cli_rs-0.2.4-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e2fbdfe9973ddf52865383fe6cf06051683320bede88b629e4646f6e8e05f11a
MD5 b8c9fd4232c4b7696cddac46f2bc00d3
BLAKE2b-256 4a1251a44ecde92c0bada06f707fc692ccf6e6640a9000fa97d63615d43c5b69

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.4 This release

8 files

0.2.3

8 files

0.2.2

2 files

0.2.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page