# Microsoft Outlook CLI

Outlook mail folders, messages, drafts, and attachments through Microsoft Graph.

## Install

```bash
cmdhub get msoutlook
```

## Authentication

OAuth2

## Agent-Readable Catalog

- Machine-readable command catalog: `/cli/msoutlook/catalog.json`
- Stable command anchors use the `cmd-...` IDs listed under each command.
- Inspect this catalog before planning tool use for command paths, examples, flags, mutation markers, and dry-run support.

## Overview

```bash
msoutlook auth login

# Read Outlook mail
msoutlook folder list
msoutlook message list --folder inbox --limit 10
msoutlook message get m1
msoutlook resolve u1

# Create and send mail
msoutlook message create --to alice@example.com --subject "Status" --body "Sent now"
msoutlook message create --to alice@example.com --subject "Status" --body "Attached" --attach ./status.txt
msoutlook message create --to alice@example.com --subject "Status" --body "Save first" --draft
msoutlook draft update d1 --attach ./status.txt
msoutlook draft send d1
msoutlook attachment list m1
msoutlook attachment get a1 --emit-content --json

# Pipe one listed message into a follow-up command
msoutlook message list --folder inbox --limit 1 --jsonl | msoutlook message get --json
```

## CLI Overview

Microsoft Outlook mail adapter CLI

Work with Outlook mail folders, messages, drafts, and attachments.

The intended workflow is:
- authenticate with msoutlook auth login
- list first
- follow up with short refs such as f1, m1, d1, or pipe jsonl into the next command
- use resolve when you need to inspect what a short ref expands to

## Generated Coverage

- Command groups: `18`
- Total documented command nodes: `89`
- Live examples: `4`
- Lifecycle surfaces: `auth`, `doctor`, `capabilities`, `schema`, `resolve`, `version`
- Machine-readable output: `--json`, `--jsonl`
- Human views: `summary`, `full`

## Auth Contract

- Auth mode: OAuth2
- Provider permission model: Microsoft OAuth
- Auth scopes: `offline_access`, `User.Read`, `Mail.ReadWrite`, `Mail.Send`
- Scope note: Used for Outlook messages, drafts, attachments, and mail sending.
- Standard commands: `auth login`, `auth logout`, `auth refresh`, `auth status`, `auth whoami`
- `auth status --json` reports `tool`, `profile`, `provider`, `authenticated`, and `suggested_next_step`.
- `auth whoami --json` is the stable way to answer identity questions.

## Agent Safety Notes

- Discovery commands such as `list`, `search`, `get`, `resolve`, `schema`, `doctor`, `capabilities`, `status`, and `whoami` are the safest commands to run first.
- Treat commands marked as mutating as state-changing local or provider operations.
- Mutating command paths: `msoutlook attachment create`, `msoutlook attachment delete`, `msoutlook auth login`, `msoutlook auth logout`, `msoutlook auth refresh`, `msoutlook automatic-reply set`, `msoutlook category create`, `msoutlook category delete`, `msoutlook category update`, `msoutlook conversation archive`, `msoutlook conversation delete`, `msoutlook conversation read`, `msoutlook conversation unread`, `msoutlook draft create`, `msoutlook draft delete`, `msoutlook draft send`, `msoutlook draft update`, `msoutlook folder create`, `msoutlook folder delete`, `msoutlook folder update`, `msoutlook message archive`, `msoutlook message create`, `msoutlook message delete`, `msoutlook message forward`, `msoutlook message read`, `msoutlook message reply`, `msoutlook message send`, `msoutlook message unread`, `msoutlook message update`, `msoutlook profile create`, `msoutlook profile delete`, `msoutlook profile use`, `msoutlook rule create`, `msoutlook rule delete`, `msoutlook rule update`
- No generated `--dry-run` flag was detected for this CLI. Use discovery commands before mutating commands.

## Global Flags

- `--json` (bool): Emit JSON machine output
- `--jsonl` (bool): Emit JSONL records for piping
- `--output` (string): Compatibility output mode: json|jsonl. Prefer --json or --jsonl
- `--view` (string): View mode: summary|full Default: `summary`.
- `--profile` (string): Config/auth profile Default: `default`.
- `--config` (string): Config path override
- `--quiet` (bool): Suppress non-essential diagnostics
- `--debug` (bool): Enable debug diagnostics
- `--limit` (int): Maximum items to emit Default: `50`.
- `--page-size` (int): Requested upstream page size Default: `50`.
- `--cursor` (string): Continuation cursor
- `--no-paginate` (bool): Fetch only one page
- `--version` (bool): Print version information

## Command Reference

### `msoutlook attachment`

- Anchor: `cmd-msoutlook-attachment`
- Mutates state: `no`
- Supports dry run: `no`

Work with Outlook message attachments

Example:

```bash
msoutlook attachment list m1
  msoutlook attachment get a1 --output-file ./file.txt
  msoutlook attachment create d1 --file ./report.txt
```

#### `msoutlook attachment create`

- Anchor: `cmd-msoutlook-attachment-create`
- Mutates state: `yes`
- Supports dry run: `no`

Add a file attachment to a draft message

Example:

```bash
msoutlook attachment create --help
msoutlook attachment create --message d1 --file ./report.txt
msoutlook attachment create d1 --file ./report.txt
```

Flags:

- `--file` (string): File path to attach
- `--message` (string): Message or draft ref/ID

#### `msoutlook attachment delete`

- Anchor: `cmd-msoutlook-attachment-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete an attachment from a draft or message

Example:

```bash
msoutlook attachment delete --help
msoutlook attachment delete AAMk... --message d1 --yes
msoutlook attachment delete a1 --yes
```

Flags:

- `--message` (string): Message ref or ID when attachment is not a local ref
- `--yes` (bool): Confirm attachment deletion

#### `msoutlook attachment download`

- Anchor: `cmd-msoutlook-attachment-download`
- Mutates state: `no`
- Supports dry run: `no`

Download an attachment to a file

Example:

```bash
msoutlook attachment download
msoutlook attachment download AAMk... --message m1 --output-file ./attachment.bin
msoutlook attachment download a1 --output-file ./attachment.bin
```

Flags:

- `--message` (string): Message ref or ID when attachment is not a local ref
- `--output-file` (string): Write decoded attachment bytes to this path

#### `msoutlook attachment get`

- Anchor: `cmd-msoutlook-attachment-get`
- Mutates state: `no`
- Supports dry run: `no`

Get an attachment

Example:

```bash
msoutlook attachment get
msoutlook attachment get AAMk... --message m1 --json
msoutlook attachment get a1
msoutlook attachment get a1 --output-file ./attachment.bin
```

Flags:

- `--emit-content` (bool): Include base64 content in JSON output
- `--message` (string): Message ref or ID when attachment is not a local ref
- `--output-file` (string): Write decoded attachment bytes to this path

#### `msoutlook attachment list`

- Anchor: `cmd-msoutlook-attachment-list`
- Mutates state: `no`
- Supports dry run: `no`

List message attachments

Example:

```bash
msoutlook attachment list
msoutlook attachment list --message d1
msoutlook attachment list m1
msoutlook message get m1 --jsonl | msoutlook attachment list
```

Flags:

- `--message` (string): Message ref or ID

### `msoutlook auth`

- Anchor: `cmd-msoutlook-auth`
- Mutates state: `no`
- Supports dry run: `no`

Manage Microsoft authentication

#### `msoutlook auth login`

- Anchor: `cmd-msoutlook-auth-login`
- Mutates state: `yes`
- Supports dry run: `no`

Authenticate with Microsoft Outlook

Example:

```bash
msoutlook auth login
msoutlook auth login --help
msoutlook auth status
```

#### `msoutlook auth logout`

- Anchor: `cmd-msoutlook-auth-logout`
- Mutates state: `yes`
- Supports dry run: `no`

Remove stored Microsoft credentials

Example:

```bash
msoutlook auth logout
msoutlook auth logout --help
msoutlook auth status
```

#### `msoutlook auth refresh`

- Anchor: `cmd-msoutlook-auth-refresh`
- Mutates state: `yes`
- Supports dry run: `no`

Refresh stored token

Example:

```bash
msoutlook auth refresh
msoutlook auth refresh --help
msoutlook auth status
```

#### `msoutlook auth status`

- Anchor: `cmd-msoutlook-auth-status`
- Mutates state: `no`
- Supports dry run: `no`

Show auth status

Example:

```bash
msoutlook auth status
msoutlook auth status --help
msoutlook auth status --json
msoutlook auth status --view full
```

#### `msoutlook auth whoami`

- Anchor: `cmd-msoutlook-auth-whoami`
- Mutates state: `no`
- Supports dry run: `no`

Show current Microsoft identity

Example:

```bash
msoutlook auth whoami
msoutlook auth whoami --help
msoutlook auth whoami --view full
```

### `msoutlook automatic-reply`

- Anchor: `cmd-msoutlook-automatic-reply`
- Mutates state: `no`
- Supports dry run: `no`

Manage bounded Outlook automatic replies

#### `msoutlook automatic-reply disable`

- Anchor: `cmd-msoutlook-automatic-reply-disable`
- Mutates state: `no`
- Supports dry run: `no`

Disable automatic replies

Example:

```bash
msoutlook automatic-reply disable --help
msoutlook automatic-reply disable --yes
```

Flags:

- `--yes` (bool): Confirm automatic reply disable

#### `msoutlook automatic-reply get`

- Anchor: `cmd-msoutlook-automatic-reply-get`
- Mutates state: `no`
- Supports dry run: `no`

Get automatic reply settings

Example:

```bash
msoutlook automatic-reply get
msoutlook automatic-reply get --json
msoutlook automatic-reply get --view full
```

#### `msoutlook automatic-reply set`

- Anchor: `cmd-msoutlook-automatic-reply-set`
- Mutates state: `yes`
- Supports dry run: `no`

Set a bounded automatic reply

Example:

```bash
msoutlook automatic-reply set --from "2026-05-26 09:00" --to "2026-05-27 17:00" --internal-message "I am out today." --external-audience contacts --yes
msoutlook automatic-reply set --help
```

Flags:

- `--external-audience` (string): External audience: none, contacts, or all
- `--external-message` (string): External automatic reply message
- `--from` (string): Automatic reply start time
- `--internal-message` (string): Internal automatic reply message
- `--to` (string): Automatic reply end time
- `--yes` (bool): Confirm automatic reply external effect

### `msoutlook capabilities`

- Anchor: `cmd-msoutlook-capabilities`
- Mutates state: `no`
- Supports dry run: `no`

Describe capabilities

Example:

```bash
msoutlook capabilities --help
```

### `msoutlook category`

- Anchor: `cmd-msoutlook-category`
- Mutates state: `no`
- Supports dry run: `no`

Manage Outlook master categories

#### `msoutlook category create`

- Anchor: `cmd-msoutlook-category-create`
- Mutates state: `yes`
- Supports dry run: `no`

Create an Outlook category

Example:

```bash
msoutlook category create --help
msoutlook category create --name "cmdhub eval" --color preset7
```

Flags:

- `--color` (string): Outlook preset color
- `--name` (string): Category display name

#### `msoutlook category delete`

- Anchor: `cmd-msoutlook-category-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete an Outlook category

Example:

```bash
msoutlook category delete --help
msoutlook category delete cat1 --yes
```

Flags:

- `--yes` (bool): Confirm category deletion

#### `msoutlook category get`

- Anchor: `cmd-msoutlook-category-get`
- Mutates state: `no`
- Supports dry run: `no`

Get an Outlook category

Example:

```bash
msoutlook category get
msoutlook category get cat1 --view full
```

#### `msoutlook category list`

- Anchor: `cmd-msoutlook-category-list`
- Mutates state: `no`
- Supports dry run: `no`

List Outlook categories

Example:

```bash
msoutlook category list
msoutlook category list --jsonl
msoutlook category list --limit 20
```

#### `msoutlook category update`

- Anchor: `cmd-msoutlook-category-update`
- Mutates state: `yes`
- Supports dry run: `no`

Update an Outlook category

Example:

```bash
msoutlook category update --help
msoutlook category update cat1 --name "cmdhub eval done" --color preset6
```

Flags:

- `--color` (string): New Outlook preset color
- `--name` (string): New category display name

### `msoutlook config`

- Anchor: `cmd-msoutlook-config`
- Mutates state: `no`
- Supports dry run: `no`

Inspect local configuration

#### `msoutlook config explain`

- Anchor: `cmd-msoutlook-config-explain`
- Mutates state: `no`
- Supports dry run: `no`

Explain resolved configuration

Example:

```bash
msoutlook config explain --help
```

### `msoutlook conversation`

- Anchor: `cmd-msoutlook-conversation`
- Mutates state: `no`
- Supports dry run: `no`

Work with Outlook message conversations

Example:

```bash
msoutlook conversation list --folder inbox --limit 10
  msoutlook conversation search --query "quarterly packet"
  msoutlook conversation get c1 --view full
```

#### `msoutlook conversation archive`

- Anchor: `cmd-msoutlook-conversation-archive`
- Mutates state: `yes`
- Supports dry run: `no`

Archive every message in a conversation

Example:

```bash
msoutlook conversation archive --help
msoutlook conversation archive c1 --all --yes
```

Flags:

- `--all` (bool): Apply the action to every message in the conversation
- `--yes` (bool): Confirm the conversation mutation

#### `msoutlook conversation delete`

- Anchor: `cmd-msoutlook-conversation-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete every message in a conversation

Example:

```bash
msoutlook conversation delete --help
msoutlook conversation delete c1 --all --yes
```

Flags:

- `--all` (bool): Apply the action to every message in the conversation
- `--yes` (bool): Confirm the conversation mutation

#### `msoutlook conversation get`

- Anchor: `cmd-msoutlook-conversation-get`
- Mutates state: `no`
- Supports dry run: `no`

Get a conversation

Example:

```bash
msoutlook conversation get
msoutlook conversation get c1 --view full
```

#### `msoutlook conversation list`

- Anchor: `cmd-msoutlook-conversation-list`
- Mutates state: `no`
- Supports dry run: `no`

List conversations

Example:

```bash
msoutlook conversation list
msoutlook conversation list --query invoice --folder inbox
```

Flags:

- `--folder` (string): Folder ref, ID, or well-known name such as inbox
- `--query` (string): Search text or Graph-style fielded terms
- `--unread` (bool): Only show conversations with unread messages

#### `msoutlook conversation move`

- Anchor: `cmd-msoutlook-conversation-move`
- Mutates state: `no`
- Supports dry run: `no`

Move every message in a conversation

Example:

```bash
msoutlook conversation move --help
msoutlook conversation move c1 --all --yes
```

Flags:

- `--all` (bool): Apply the action to every message in the conversation
- `--folder` (string): Destination folder ref, ID, or well-known name
- `--yes` (bool): Confirm the conversation mutation

#### `msoutlook conversation read`

- Anchor: `cmd-msoutlook-conversation-read`
- Mutates state: `yes`
- Supports dry run: `no`

Mark every message in a conversation read

Example:

```bash
msoutlook conversation read --help
msoutlook conversation read c1 --all --yes
```

Flags:

- `--all` (bool): Apply the action to every message in the conversation
- `--yes` (bool): Confirm the conversation mutation

#### `msoutlook conversation search`

- Anchor: `cmd-msoutlook-conversation-search`
- Mutates state: `no`
- Supports dry run: `no`

Search conversations

Example:

```bash
msoutlook conversation search
msoutlook conversation search --query invoice --folder inbox
```

Flags:

- `--folder` (string): Folder ref, ID, or well-known name such as inbox
- `--query` (string): Search text or Graph-style fielded terms
- `--unread` (bool): Only show conversations with unread messages

#### `msoutlook conversation unread`

- Anchor: `cmd-msoutlook-conversation-unread`
- Mutates state: `yes`
- Supports dry run: `no`

Mark every message in a conversation unread

Example:

```bash
msoutlook conversation unread --help
msoutlook conversation unread c1 --all --yes
```

Flags:

- `--all` (bool): Apply the action to every message in the conversation
- `--yes` (bool): Confirm the conversation mutation

### `msoutlook doctor`

- Anchor: `cmd-msoutlook-doctor`
- Mutates state: `no`
- Supports dry run: `no`

Run msoutlook diagnostics

Example:

```bash
msoutlook doctor
msoutlook doctor --help
msoutlook doctor --json
msoutlook doctor --view full
```

### `msoutlook draft`

- Anchor: `cmd-msoutlook-draft`
- Mutates state: `no`
- Supports dry run: `no`

Work with Outlook drafts

Example:

```bash
msoutlook draft list
  msoutlook draft get d1 --view full
  msoutlook draft update d1 --body "Revised body"
```

#### `msoutlook draft create`

- Anchor: `cmd-msoutlook-draft-create`
- Mutates state: `yes`
- Supports dry run: `no`

Create a draft

Example:

```bash
msoutlook draft create --help
msoutlook draft create --to alice@example.com --subject "Review" --body "Draft body"
msoutlook draft create --to alice@example.com --subject "With file" --body "Attached" --attach ./report.txt
```

Flags:

- `--attach` (stringSlice): File path(s) to attach
- `--bcc` (stringSlice): Bcc recipient; repeat or comma-separate
- `--body` (string): Message body
- `--cc` (stringSlice): Cc recipient; repeat or comma-separate
- `--importance` (string): Importance: low, normal, or high
- `--subject` (string): Message subject
- `--to` (stringSlice): Recipient; repeat or comma-separate

#### `msoutlook draft delete`

- Anchor: `cmd-msoutlook-draft-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete a draft

Example:

```bash
msoutlook draft delete --all --yes d1 d2
msoutlook draft delete --help
msoutlook draft delete d1
msoutlook draft list --jsonl | msoutlook draft delete --all --yes
```

Flags:

- `--all` (bool): Confirm batch draft delete
- `--yes` (bool): Confirm destructive batch draft delete

#### `msoutlook draft get`

- Anchor: `cmd-msoutlook-draft-get`
- Mutates state: `no`
- Supports dry run: `no`

Get a draft

Example:

```bash
msoutlook draft get
msoutlook draft get d1
msoutlook draft get d1 --view full
msoutlook draft get d1 d2
msoutlook draft list --limit 2 --jsonl | msoutlook draft get
```

#### `msoutlook draft list`

- Anchor: `cmd-msoutlook-draft-list`
- Mutates state: `no`
- Supports dry run: `no`

List draft messages

Example:

```bash
msoutlook draft list
msoutlook draft list --jsonl | msoutlook draft get
msoutlook draft list --query review --limit 10
```

Flags:

- `--query` (string): Filter drafts locally

#### `msoutlook draft send`

- Anchor: `cmd-msoutlook-draft-send`
- Mutates state: `yes`
- Supports dry run: `no`

Send a draft

Example:

```bash
msoutlook draft list --limit 1 --jsonl | msoutlook draft send
msoutlook draft send --help
msoutlook draft send d1
```

#### `msoutlook draft update`

- Anchor: `cmd-msoutlook-draft-update`
- Mutates state: `yes`
- Supports dry run: `no`

Update a draft

Example:

```bash
msoutlook draft update --help
msoutlook draft update d1 --attach ./report.txt
msoutlook draft update d1 --body "Revised body" --importance high
msoutlook draft update d1 --subject "Updated subject"
```

Flags:

- `--attach` (stringSlice): File path(s) to add as attachments
- `--bcc` (stringSlice): Bcc recipient; repeat or comma-separate
- `--body` (string): New body
- `--cc` (stringSlice): Cc recipient; repeat or comma-separate
- `--importance` (string): Importance: low, normal, or high
- `--subject` (string): New subject
- `--to` (stringSlice): Recipient; repeat or comma-separate

### `msoutlook folder`

- Anchor: `cmd-msoutlook-folder`
- Mutates state: `no`
- Supports dry run: `no`

Work with Outlook mail folders

Example:

```bash
msoutlook folder list
  msoutlook folder list --query sent
  msoutlook folder get f1 --view full
```

#### `msoutlook folder create`

- Anchor: `cmd-msoutlook-folder-create`
- Mutates state: `yes`
- Supports dry run: `no`

Create a mail folder

Example:

```bash
msoutlook folder create --help
msoutlook folder create --name "cmdhub child" --parent f1
msoutlook folder create --name "cmdhub triage"
```

Flags:

- `--name` (string): Folder display name
- `--parent` (string): Parent folder ref, ID, or well-known name

#### `msoutlook folder delete`

- Anchor: `cmd-msoutlook-folder-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete an ordinary mail folder

Example:

```bash
msoutlook folder delete --help
msoutlook folder delete f1 --yes
```

Flags:

- `--yes` (bool): Confirm folder deletion

#### `msoutlook folder get`

- Anchor: `cmd-msoutlook-folder-get`
- Mutates state: `no`
- Supports dry run: `no`

Get a mail folder

Example:

```bash
msoutlook folder get
msoutlook folder get f1
msoutlook folder get f1 f2
msoutlook folder get inbox --view full
msoutlook folder list --query sent --limit 2 --jsonl | msoutlook folder get
```

#### `msoutlook folder list`

- Anchor: `cmd-msoutlook-folder-list`
- Mutates state: `no`
- Supports dry run: `no`

List mail folders

Example:

```bash
msoutlook folder list
msoutlook folder list --jsonl | msoutlook message list --limit 10
msoutlook folder list --query archive --limit 5
```

Flags:

- `--query` (string): Filter folder names locally

#### `msoutlook folder move`

- Anchor: `cmd-msoutlook-folder-move`
- Mutates state: `no`
- Supports dry run: `no`

Move a mail folder under another folder

Example:

```bash
msoutlook folder move --help
msoutlook folder move f1 --parent archive
```

Flags:

- `--parent` (string): Destination parent folder ref, ID, or well-known name

#### `msoutlook folder update`

- Anchor: `cmd-msoutlook-folder-update`
- Mutates state: `yes`
- Supports dry run: `no`

Rename a mail folder

Example:

```bash
msoutlook folder update --help
msoutlook folder update f1 --name "cmdhub triage done"
```

Flags:

- `--name` (string): New folder display name

### `msoutlook mailbox`

- Anchor: `cmd-msoutlook-mailbox`
- Mutates state: `no`
- Supports dry run: `no`

Inspect the selected Outlook mailbox

#### `msoutlook mailbox get`

- Anchor: `cmd-msoutlook-mailbox-get`
- Mutates state: `no`
- Supports dry run: `no`

Get selected mailbox metadata

Example:

```bash
msoutlook mailbox get
msoutlook mailbox get --json
```

### `msoutlook mailbox-settings`

- Anchor: `cmd-msoutlook-mailbox-settings`
- Mutates state: `no`
- Supports dry run: `no`

Inspect Outlook mailbox settings

#### `msoutlook mailbox-settings get`

- Anchor: `cmd-msoutlook-mailbox-settings-get`
- Mutates state: `no`
- Supports dry run: `no`

Get selected mailbox settings

Example:

```bash
msoutlook mailbox-settings get
msoutlook mailbox-settings get --view full
```

### `msoutlook message`

- Anchor: `cmd-msoutlook-message`
- Mutates state: `no`
- Supports dry run: `no`

Work with Outlook messages

Example:

```bash
msoutlook message list --folder inbox --limit 10
  msoutlook message get m1 --view full
  msoutlook message reply m1 --draft --body "Received."
```

#### `msoutlook message archive`

- Anchor: `cmd-msoutlook-message-archive`
- Mutates state: `yes`
- Supports dry run: `no`

Move a message to archive

Example:

```bash
msoutlook message archive --all m1 m2
msoutlook message archive --help
msoutlook message archive m1
msoutlook message list --folder inbox --jsonl | msoutlook message archive --all
```

Flags:

- `--all` (bool): Confirm batch message mutation

#### `msoutlook message categorize`

- Anchor: `cmd-msoutlook-message-categorize`
- Mutates state: `no`
- Supports dry run: `no`

Add a category to a message

Example:

```bash
msoutlook message categorize --help
msoutlook message categorize m1 --category cat1
```

Flags:

- `--category` (string): Category ref, name, or ID

#### `msoutlook message copy`

- Anchor: `cmd-msoutlook-message-copy`
- Mutates state: `no`
- Supports dry run: `no`

Copy a message to another folder

Example:

```bash
msoutlook message copy --help
msoutlook message copy m1 --folder f2
```

Flags:

- `--folder` (string): Destination folder ref, ID, or well-known name

#### `msoutlook message create`

- Anchor: `cmd-msoutlook-message-create`
- Mutates state: `yes`
- Supports dry run: `no`

Create or send a message

Example:

```bash
msoutlook message create --help
msoutlook message create --to alice@example.com --subject "Review" --body "Save first" --draft
msoutlook message create --to alice@example.com --subject "Status" --body "Sent now"
msoutlook message create --to alice@example.com --subject "With file" --body "Attached" --attach ./report.txt --draft
```

Flags:

- `--attach` (stringSlice): File path(s) to attach
- `--bcc` (stringSlice): Bcc recipient; repeat or comma-separate
- `--body` (string): Message body
- `--cc` (stringSlice): Cc recipient; repeat or comma-separate
- `--draft` (bool): Save as draft instead of sending
- `--importance` (string): Importance: low, normal, or high
- `--subject` (string): Message subject
- `--to` (stringSlice): Recipient; repeat or comma-separate

#### `msoutlook message delete`

- Anchor: `cmd-msoutlook-message-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete a message

Example:

```bash
msoutlook message delete --all --yes m1 m2
msoutlook message delete --help
msoutlook message delete m1
msoutlook message list --folder inbox --jsonl | msoutlook message delete --all --yes
```

Flags:

- `--all` (bool): Confirm batch message delete
- `--yes` (bool): Confirm destructive batch message delete

#### `msoutlook message forward`

- Anchor: `cmd-msoutlook-message-forward`
- Mutates state: `yes`
- Supports dry run: `no`

Forward a message

Example:

```bash
msoutlook message forward --help
msoutlook message forward m1 --to alice@example.com --body "FYI"
msoutlook message forward m1 --to alice@example.com --draft --body "FYI"
```

Flags:

- `--body` (string): Forward comment
- `--draft` (bool): Create a forward draft instead of sending
- `--to` (stringSlice): Forward recipient; repeat or comma-separate

#### `msoutlook message get`

- Anchor: `cmd-msoutlook-message-get`
- Mutates state: `no`
- Supports dry run: `no`

Get a message

Example:

```bash
msoutlook message get
msoutlook message get m1
msoutlook message get m1 --view full
msoutlook message get m1 m2
msoutlook message list --folder inbox --limit 2 --jsonl | msoutlook message get
```

#### `msoutlook message list`

- Anchor: `cmd-msoutlook-message-list`
- Mutates state: `no`
- Supports dry run: `no`

List messages

Example:

```bash
msoutlook folder list --query sent --limit 1 --jsonl | msoutlook message list --limit 5
msoutlook message list
msoutlook message list --folder inbox --limit 10
msoutlook message list inbox --query invoice --unread
```

Flags:

- `--folder` (string): Folder ref, ID, or well-known name such as inbox
- `--query` (string): Filter messages locally by subject, sender, recipient, or preview
- `--unread` (bool): Only show unread messages

#### `msoutlook message move`

- Anchor: `cmd-msoutlook-message-move`
- Mutates state: `no`
- Supports dry run: `no`

Move a message to another folder

Example:

```bash
msoutlook message move --help
msoutlook message move m1 --folder archive
msoutlook message move m1 --folder f2
```

Flags:

- `--folder` (string): Destination folder ref, ID, or well-known name

#### `msoutlook message read`

- Anchor: `cmd-msoutlook-message-read`
- Mutates state: `yes`
- Supports dry run: `no`

Mark a message read

Example:

```bash
msoutlook message list --folder inbox --jsonl | msoutlook message read --all
msoutlook message read --all m1 m2
msoutlook message read --help
msoutlook message read m1
```

Flags:

- `--all` (bool): Confirm batch message mutation

#### `msoutlook message reply`

- Anchor: `cmd-msoutlook-message-reply`
- Mutates state: `yes`
- Supports dry run: `no`

Reply to a message

Example:

```bash
msoutlook message reply --help
msoutlook message reply m1 --body "Sent now"
msoutlook message reply m1 --draft --body "Received."
```

Flags:

- `--body` (string): Reply body
- `--draft` (bool): Create a reply draft instead of sending

#### `msoutlook message reply-all`

- Anchor: `cmd-msoutlook-message-reply-all`
- Mutates state: `no`
- Supports dry run: `no`

Reply all to a message

Example:

```bash
msoutlook message reply-all --help
msoutlook message reply-all m1 --body "Sent now"
msoutlook message reply-all m1 --draft --body "Thanks all."
```

Flags:

- `--body` (string): Reply-all body
- `--draft` (bool): Create a reply-all draft instead of sending

#### `msoutlook message restore`

- Anchor: `cmd-msoutlook-message-restore`
- Mutates state: `no`
- Supports dry run: `no`

Restore a deleted message to a folder

Example:

```bash
msoutlook message restore --help
msoutlook message restore m1 --folder inbox
```

Flags:

- `--folder` (string): Destination restore folder

#### `msoutlook message search`

- Anchor: `cmd-msoutlook-message-search`
- Mutates state: `no`
- Supports dry run: `no`

Search messages

Example:

```bash
msoutlook message search
msoutlook message search --query 'from:alex subject:packet' --unread --limit 10
msoutlook message search --query invoice --folder inbox
```

Flags:

- `--folder` (string): Folder ref, ID, or well-known name such as inbox
- `--query` (string): Search text or Graph-style fielded terms
- `--unread` (bool): Only show unread messages

#### `msoutlook message send`

- Anchor: `cmd-msoutlook-message-send`
- Mutates state: `yes`
- Supports dry run: `no`

Send a draft or one explicit message

Example:

```bash
msoutlook message send --help
msoutlook message send --to alice@example.com --subject "Status" --body "Sent now"
msoutlook message send d1
```

Flags:

- `--attach` (stringSlice): File path(s) to attach
- `--bcc` (stringSlice): Bcc recipient; repeat or comma-separate
- `--body` (string): Message body
- `--cc` (stringSlice): Cc recipient; repeat or comma-separate
- `--importance` (string): Importance: low, normal, or high
- `--subject` (string): Message subject
- `--to` (stringSlice): Recipient; repeat or comma-separate

#### `msoutlook message uncategorize`

- Anchor: `cmd-msoutlook-message-uncategorize`
- Mutates state: `no`
- Supports dry run: `no`

Remove a category from a message

Example:

```bash
msoutlook message uncategorize --help
msoutlook message uncategorize m1 --category cat1
```

Flags:

- `--category` (string): Category ref, name, or ID

#### `msoutlook message unread`

- Anchor: `cmd-msoutlook-message-unread`
- Mutates state: `yes`
- Supports dry run: `no`

Mark a message unread

Example:

```bash
msoutlook message list --folder inbox --jsonl | msoutlook message unread --all
msoutlook message unread --all m1 m2
msoutlook message unread --help
msoutlook message unread m1
```

Flags:

- `--all` (bool): Confirm batch message mutation

#### `msoutlook message update`

- Anchor: `cmd-msoutlook-message-update`
- Mutates state: `yes`
- Supports dry run: `no`

Update a message or draft

Example:

```bash
msoutlook message update --help
msoutlook message update d1 --attach ./report.txt
msoutlook message update d1 --body "Revised body" --importance high
msoutlook message update d1 --subject "Updated subject"
```

Flags:

- `--attach` (stringSlice): File path(s) to add as attachments
- `--bcc` (stringSlice): Bcc recipient; repeat or comma-separate
- `--body` (string): New body
- `--cc` (stringSlice): Cc recipient; repeat or comma-separate
- `--importance` (string): Importance: low, normal, or high
- `--subject` (string): New subject
- `--to` (stringSlice): Recipient; repeat or comma-separate

### `msoutlook profile`

- Anchor: `cmd-msoutlook-profile`
- Mutates state: `no`
- Supports dry run: `no`

Manage provider profiles

#### `msoutlook profile create`

- Anchor: `cmd-msoutlook-profile-create`
- Mutates state: `yes`
- Supports dry run: `no`

Create an unauthenticated provider profile

Example:

```bash
msoutlook profile create --help
```

#### `msoutlook profile delete`

- Anchor: `cmd-msoutlook-profile-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete a local provider profile

Example:

```bash
msoutlook profile delete --help
```

#### `msoutlook profile list`

- Anchor: `cmd-msoutlook-profile-list`
- Mutates state: `no`
- Supports dry run: `no`

List provider profiles

Example:

```bash
msoutlook profile list --help
```

#### `msoutlook profile rename`

- Anchor: `cmd-msoutlook-profile-rename`
- Mutates state: `no`
- Supports dry run: `no`

Rename a local provider profile

Example:

```bash
msoutlook profile rename --help
```

#### `msoutlook profile use`

- Anchor: `cmd-msoutlook-profile-use`
- Mutates state: `yes`
- Supports dry run: `no`

Set the default provider profile

Example:

```bash
msoutlook profile use --help
```

### `msoutlook resolve`

- Anchor: `cmd-msoutlook-resolve`
- Mutates state: `no`
- Supports dry run: `no`

Resolve a local msoutlook reference

Example:

```bash
msoutlook resolve --help
msoutlook resolve d1 --view full
msoutlook resolve m1
msoutlook resolve u1
```

### `msoutlook rule`

- Anchor: `cmd-msoutlook-rule`
- Mutates state: `no`
- Supports dry run: `no`

Manage bounded Outlook Inbox rules

#### `msoutlook rule create`

- Anchor: `cmd-msoutlook-rule-create`
- Mutates state: `yes`
- Supports dry run: `no`

Create a bounded Inbox rule

Example:

```bash
msoutlook rule create --help
msoutlook rule create --name "cmdhub invoices" --subject-contains invoice --assign-category "Finance" --yes
msoutlook rule create --name "cmdhub receipts" --from receipts@example.com --move-folder f1 --yes
```

Flags:

- `--assign-category` (stringSlice): Assign category name; repeat or comma-separate
- `--body-contains` (stringSlice): Body token condition; repeat or comma-separate
- `--disabled` (bool): Create the rule disabled
- `--from` (stringSlice): Sender token or address condition; repeat or comma-separate
- `--has-attachments` (bool): Match messages with attachments
- `--importance` (string): Importance condition: low, normal, or high
- `--mark-read` (bool): Mark matching messages as read
- `--move-folder` (string): Move matching messages to this folder ref, ID, or well-known name
- `--name` (string): Rule name
- `--stop-processing` (bool): Stop processing later Inbox rules
- `--subject-contains` (stringSlice): Subject token condition; repeat or comma-separate
- `--yes` (bool): Confirm rule creation

#### `msoutlook rule delete`

- Anchor: `cmd-msoutlook-rule-delete`
- Mutates state: `yes`
- Supports dry run: `no`

Delete an Inbox rule

Example:

```bash
msoutlook rule delete --help
msoutlook rule delete r1 --yes
```

Flags:

- `--yes` (bool): Confirm rule deletion

#### `msoutlook rule disable`

- Anchor: `cmd-msoutlook-rule-disable`
- Mutates state: `no`
- Supports dry run: `no`

disable an Inbox rule

Example:

```bash
msoutlook rule disable --help
msoutlook rule disable r1 --yes
```

Flags:

- `--yes` (bool): Confirm rule state change

#### `msoutlook rule enable`

- Anchor: `cmd-msoutlook-rule-enable`
- Mutates state: `no`
- Supports dry run: `no`

enable an Inbox rule

Example:

```bash
msoutlook rule enable --help
msoutlook rule enable r1 --yes
```

Flags:

- `--yes` (bool): Confirm rule state change

#### `msoutlook rule get`

- Anchor: `cmd-msoutlook-rule-get`
- Mutates state: `no`
- Supports dry run: `no`

Get an Inbox rule

Example:

```bash
msoutlook rule get
msoutlook rule get r1 --view full
```

#### `msoutlook rule list`

- Anchor: `cmd-msoutlook-rule-list`
- Mutates state: `no`
- Supports dry run: `no`

List Inbox rules

Example:

```bash
msoutlook rule list
msoutlook rule list --jsonl
msoutlook rule list --limit 20
```

#### `msoutlook rule update`

- Anchor: `cmd-msoutlook-rule-update`
- Mutates state: `yes`
- Supports dry run: `no`

Update a bounded Inbox rule

Example:

```bash
msoutlook rule update --help
msoutlook rule update r1 --move-folder f2 --yes
msoutlook rule update r1 --name "cmdhub receipts v2" --yes
```

Flags:

- `--assign-category` (stringSlice): Assign category name; repeat or comma-separate
- `--body-contains` (stringSlice): Body token condition; repeat or comma-separate
- `--enabled` (bool): Set whether the rule is enabled Default: `true`.
- `--from` (stringSlice): Sender token or address condition; repeat or comma-separate
- `--has-attachments` (bool): Match messages with attachments
- `--importance` (string): Importance condition: low, normal, or high
- `--mark-read` (bool): Mark matching messages as read
- `--move-folder` (string): Move matching messages to this folder ref, ID, or well-known name
- `--name` (string): Rule name
- `--stop-processing` (bool): Stop processing later Inbox rules
- `--subject-contains` (stringSlice): Subject token condition; repeat or comma-separate
- `--yes` (bool): Confirm rule update

### `msoutlook schema`

- Anchor: `cmd-msoutlook-schema`
- Mutates state: `no`
- Supports dry run: `no`

Emit msoutlook schema hints

Show schema hints for Outlook resource payloads emitted or accepted by this CLI.

Use this when you need to understand structured output fields for automation or downstream parsing.

Example:

```bash
msoutlook schema
msoutlook schema --help
msoutlook schema draft.update --in --json
msoutlook schema message.create --in
msoutlook schema message.get --out
```

Flags:

- `--in` (bool): Show input schema
- `--input` (bool): Show input schema
- `--out` (bool): Show output schema
- `--schema-output` (bool): Show output schema

### `msoutlook version`

- Anchor: `cmd-msoutlook-version`
- Mutates state: `no`
- Supports dry run: `no`

Print version information

Example:

```bash
msoutlook version
msoutlook version --help
msoutlook version --json
msoutlook version --view full
```

## Live Examples

### Auth

#### Check Microsoft auth status

Shows whether the Microsoft grant is configured.

_Example metadata: requires auth; provider state: live._

```bash
msoutlook auth status
```

```text
Not logged in.

Next steps:
- Login: msoutlook auth login
```

#### Run diagnostics

Checks Microsoft provider configuration and stored credentials.

_Example metadata: requires auth; provider state: live._

```bash
msoutlook doctor
```

```text
msoutlook doctor: FAIL
Checks: credential_backend ok, credential_security warn, profiles warn, microsoft_oauth ok, token fail
CHECK                STATUS  DETAIL
credential_backend   OK      using file
credential_security  WARN    credential backend stores local plaintext secrets
profiles             WARN    no provider profiles configured
microsoft_oauth      OK      built-in Microsoft provider client is configured
token                FAIL    no stored Microsoft token

Next steps:
- Status:       msoutlook auth login
- Capabilities: msoutlook capabilities
```

### Overview

#### Show capabilities

Lists supported Microsoft Outlook resources.

_Example metadata: requires auth; provider state: live._

```bash
msoutlook capabilities
```

```text
msoutlook capabilities
Resources: attachment, auth, automatic-reply, capabilities, category, config, conversation, doctor, draft, folder, mailbox, mailbox-settings, message, profile, resolve, rule, schema, version
Machine output: --json, --jsonl
Required scopes: Mail.ReadWrite, Mail.Send, User.Read, offline_access

Next steps:
- Scopes:   msoutlook capabilities --section scopes
- Schema:   msoutlook schema
- Contract: msoutlook capabilities --json
- Help:     msoutlook --help
```

### Schemas

#### Inspect message schema

Shows fields for creating a message.

_Example metadata: requires auth; provider state: live._

```bash
msoutlook schema message.create --in
```

```text
Schema: msoutlook.message.create.input.v1 (msoutlook message create input)
Required: to, subject
Optional: cc, bcc, body, importance, attach, draft
```
