Skip to main content

Microsoft Graph CLI toolset

The Microsoft Graph CLI toolset manages Outlook mailboxes directly through Graph. It can send and find messages, mark them read, move/delete them, and manage folders and master categories. Workflows combine typed operations in one process.

Start with installation and authorization. The CLI uses its own app-only credential. It does not inherit a signed-in MailGen user's mailbox permission.

Purpose​

The tool supports controlled synchronization experiments. A workflow can send from mailbox A and wait for its copy in mailbox B. It can retain B's immutable message ID, categorize that copy, and move it. You can then inspect the separate sync system's reaction.

It performs these provider operations without an eCAS API call or database access. It is separate from production Graph synchronization.

AreaCapability
MessagesList/get, send/respond, wait, mark read, move, categories, trash, permanent delete
FoldersRecursive list, get, create, rename, move, delete
LabelsList, get, create, change color, delete
WorkflowsCompose typed operations in TypeScript
AutomationOne JSON result and predictable exit code

Here, label means an Outlook master category. A message holds category display names. Category-management commands return category IDs.

Stateless execution​

Each invocation reads application credentials and creates an authenticated Graph client. It executes the action, prints JSON, and exits. It keeps no cross-command workflow state or message/folder IDs. It does not call InstantUserDataGetter, connect to Prisma, or read DELTA_LINK_ENCRYPTION_KEY.

Message identity​

Message requests include:

Prefer: IdType="ImmutableId"

The ID remains stable for moves within the same mailbox. Sender and recipient copies have different IDs. Use internetMessageId to find the recipient copy, then use that result's emailId.

Name resolution​

Folder/category names match exactly without case sensitivity. No match stops the operation. Multiple folder matches stop it and return candidate IDs. An explicit ID targets that object. This prevents a workflow from silently choosing an ambiguous folder.

Continue​

  1. Set up the CLI.
  2. Find a command.
  3. Interpret JSON and failures.
  4. Compose a workflow.

The executable project is Architecture/GraphSyncExperimenter/cli-graph/. These reader pages are its separate documentation.