Skip to main content

Graph CLI architecture and configuration

The Graph CLI calls Microsoft Graph directly. It does not use MailGen's database or backend. A browser MailGen session does not replace the tool's application credential. Complete CLI setup first.

Request path​

The CLI checks the action, required flags, and configuration. Its app-only client resolves exact folder/category references. It executes the action and emits one JSON result with an exit code. It does not open interactive provider login.

Folder-name resolution includes nested and hidden folders. Several matches require an ID. Message requests use mailbox-scoped immutable IDs.

Configuration​

VariableMeaningRequired
TENANT_IDEntra tenant IDYes, nonempty
CLIENT_IDApplication client IDYes, nonempty
CLIENT_SECRETApplication secretYes, nonempty and confidential

Missing configuration returns exit code 2. The stateless CLI stores no delta checkpoint and does not read DELTA_LINK_ENCRYPTION_KEY. Keep its secret in its own secure runtime configuration.

Resources and results​

Email operations list, read, send, wait, move, categorize, and delete messages. Folder operations manage the provider hierarchy. Label operations manage Outlook master categories. A category color is a Graph preset, not a database-derived hexadecimal value.

Sending and finding the recipient copy are separate operations. See outputs and the command reference.

Documentation examples​

Where the documentation offers a mailbox selector, it changes displayed command examples only. Browser storage retains that choice. It does not authenticate, grant Graph access, or execute a command. Check the target before copying a write command.