Microsoft Outlook CLI
for cmdhub.
Outlook mail folders, messages, drafts, and attachments through Microsoft Graph.
cmdhub get msoutlook
data_object Agent Contract
Agents should start with auth/status and discovery commands, inspect schemas before composition, and treat commands marked as mutating as state-changing operations.
Output
Use human output for reading, `--json` for one object, and `--jsonl` for pipes.
Auth
Microsoft OAuth. Used for Outlook messages, drafts, attachments, and mail sending.
Refs
Prefer list/search, then short refs or piped JSONL. Use `resolve` to inspect cached refs.
Schemas
Use `msoutlook schema` and `catalog.json` to inspect fields, flags, examples, and side effects.
Auth scopes
offline_accessUser.ReadMail.ReadWriteMail.Sendterminal Command Reference
Generated from source. Global flags apply to all commands.
Global Flags
--json
bool
Emit JSON machine output--jsonl
bool
Emit JSONL records for piping--output, -o
string
Compatibility output mode: json|jsonl. Prefer --json or --jsonl--view
string = summary
View mode: summary|full--profile
string = default
Config/auth profile--config
string
Config path override--quiet, -q
bool
Suppress non-essential diagnostics--debug
bool
Enable debug diagnostics--limit
int = 50
Maximum items to emit--page-size
int = 50
Requested upstream page size--cursor
string
Continuation cursor--no-paginate
bool
Fetch only one page--version, -v
bool
Print version informationmsoutlook attachment
Work with Outlook message attachmentsmsoutlook attachment create
Add a file attachment to a draft message--file
string
File path to attach--message
string
Message or draft ref/IDmsoutlook attachment delete
Delete an attachment from a draft or message--message
string
Message ref or ID when attachment is not a local ref--yes
bool
Confirm attachment deletionmsoutlook attachment download
Download an attachment to a file--message
string
Message ref or ID when attachment is not a local ref--output-file
string
Write decoded attachment bytes to this pathmsoutlook attachment get
Get an attachment--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 pathmsoutlook attachment list
List message attachments--message
string
Message ref or IDmsoutlook auth
Manage Microsoft authenticationmsoutlook auth login
Authenticate with Microsoft Outlookmsoutlook auth logout
Remove stored Microsoft credentialsmsoutlook auth refresh
Refresh stored tokenmsoutlook auth status
Show auth statusmsoutlook auth whoami
Show current Microsoft identitymsoutlook automatic-reply
Manage bounded Outlook automatic repliesmsoutlook automatic-reply disable
Disable automatic replies--yes
bool
Confirm automatic reply disablemsoutlook automatic-reply get
Get automatic reply settingsmsoutlook automatic-reply set
Set a bounded automatic reply--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 effectmsoutlook capabilities
Describe capabilitiesmsoutlook category
Manage Outlook master categoriesmsoutlook category create
Create an Outlook category--color
string
Outlook preset color--name
string
Category display namemsoutlook category delete
Delete an Outlook category--yes
bool
Confirm category deletionmsoutlook category get
Get an Outlook categorymsoutlook category list
List Outlook categoriesmsoutlook category update
Update an Outlook category--color
string
New Outlook preset color--name
string
New category display namemsoutlook config
Inspect local configurationmsoutlook config explain
Explain resolved configurationmsoutlook conversation
Work with Outlook message conversationsmsoutlook conversation archive
Archive every message in a conversation--all
bool
Apply the action to every message in the conversation--yes
bool
Confirm the conversation mutationmsoutlook conversation delete
Delete every message in a conversation--all
bool
Apply the action to every message in the conversation--yes
bool
Confirm the conversation mutationmsoutlook conversation get
Get a conversationmsoutlook conversation list
List conversations--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 messagesmsoutlook conversation move
Move every message in a conversation--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 mutationmsoutlook conversation read
Mark every message in a conversation read--all
bool
Apply the action to every message in the conversation--yes
bool
Confirm the conversation mutationmsoutlook conversation search
Search conversations--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 messagesmsoutlook conversation unread
Mark every message in a conversation unread--all
bool
Apply the action to every message in the conversation--yes
bool
Confirm the conversation mutationmsoutlook doctor
Run msoutlook diagnosticsmsoutlook draft
Work with Outlook draftsmsoutlook draft create
Create a draft--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-separatemsoutlook draft delete
Delete a draft--all
bool
Confirm batch draft delete--yes
bool
Confirm destructive batch draft deletemsoutlook draft get
Get a draftmsoutlook draft list
List draft messages--query
string
Filter drafts locallymsoutlook draft send
Send a draftmsoutlook draft update
Update a draft--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-separatemsoutlook folder
Work with Outlook mail foldersmsoutlook folder create
Create a mail folder--name
string
Folder display name--parent
string
Parent folder ref, ID, or well-known namemsoutlook folder delete
Delete an ordinary mail folder--yes
bool
Confirm folder deletionmsoutlook folder get
Get a mail foldermsoutlook folder list
List mail folders--query
string
Filter folder names locallymsoutlook folder move
Move a mail folder under another folder--parent
string
Destination parent folder ref, ID, or well-known namemsoutlook folder update
Rename a mail folder--name
string
New folder display namemsoutlook mailbox
Inspect the selected Outlook mailboxmsoutlook mailbox get
Get selected mailbox metadatamsoutlook mailbox-settings
Inspect Outlook mailbox settingsmsoutlook mailbox-settings get
Get selected mailbox settingsmsoutlook message
Work with Outlook messagesmsoutlook message archive
Move a message to archive--all
bool
Confirm batch message mutationmsoutlook message categorize
Add a category to a message--category
string
Category ref, name, or IDmsoutlook message copy
Copy a message to another folder--folder
string
Destination folder ref, ID, or well-known namemsoutlook message create
Create or send a message--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-separatemsoutlook message delete
Delete a message--all
bool
Confirm batch message delete--yes
bool
Confirm destructive batch message deletemsoutlook message forward
Forward a message--body
string
Forward comment--draft
bool
Create a forward draft instead of sending--to
stringSlice = []
Forward recipient; repeat or comma-separatemsoutlook message get
Get a messagemsoutlook message list
List messages--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 messagesmsoutlook message move
Move a message to another folder--folder
string
Destination folder ref, ID, or well-known namemsoutlook message read
Mark a message read--all
bool
Confirm batch message mutationmsoutlook message reply
Reply to a message--body
string
Reply body--draft
bool
Create a reply draft instead of sendingmsoutlook message reply-all
Reply all to a message--body
string
Reply-all body--draft
bool
Create a reply-all draft instead of sendingmsoutlook message restore
Restore a deleted message to a folder--folder
string
Destination restore foldermsoutlook message search
Search messages--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 messagesmsoutlook message send
Send a draft or one explicit message--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-separatemsoutlook message uncategorize
Remove a category from a message--category
string
Category ref, name, or IDmsoutlook message unread
Mark a message unread--all
bool
Confirm batch message mutationmsoutlook message update
Update a message or draft--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-separatemsoutlook profile
Manage provider profilesmsoutlook profile create
Create an unauthenticated provider profilemsoutlook profile delete
Delete a local provider profilemsoutlook profile list
List provider profilesmsoutlook profile rename
Rename a local provider profilemsoutlook profile use
Set the default provider profilemsoutlook resolve
Resolve a local msoutlook referencemsoutlook rule
Manage bounded Outlook Inbox rulesmsoutlook rule create
Create a bounded Inbox rule--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 creationmsoutlook rule delete
Delete an Inbox rule--yes
bool
Confirm rule deletionmsoutlook rule disable
disable an Inbox rule--yes
bool
Confirm rule state changemsoutlook rule enable
enable an Inbox rule--yes
bool
Confirm rule state changemsoutlook rule get
Get an Inbox rulemsoutlook rule list
List Inbox rulesmsoutlook rule update
Update a bounded Inbox rule--assign-category
stringSlice = []
Assign category name; repeat or comma-separate--body-contains
stringSlice = []
Body token condition; repeat or comma-separate--enabled
bool = true
Set whether the rule is enabled--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 updatemsoutlook schema
Emit msoutlook schema hintsShow 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.
--in
bool
Show input schema--input
bool
Show input schema--out
bool
Show output schema--schema-output
bool
Show output schemamsoutlook version
Print version informationplay_circle Live Examples
Output captured from a real workspace. Regenerate with
scripts/gen-docs.sh --update.
auth
Not logged in. Next steps: - Login: msoutlook auth login
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
schemas
Schema: msoutlook.message.create.input.v1 (msoutlook message create input) Required: to, subject Optional: cc, bcc, body, importance, attach, draft
overview
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
alt_route Composition Patterns
Bridge your ecosystem with zero middleware.
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