فرمانهای دستنوشته
فرمانهایی که برای آدمها نوشته شدهاند، با همهٔ آرگومانها، پرچمها و نمونهها.
فرمانها
هر فرمان در اینجا پرچمهای سراسری مانند --json، --profile و --dry-run را هم میپذیرد. پرچمهای سراسری را ببینید
loginwhoamistatussendinboxreadsearchreplyarchiveunarchivetrashstarunstarmark readmark unreadsnoozeunsnoozelabel addlabel removetemp newtemp listtemp readtemp watchtemp deleteai translateai languagesai composeai summarizemcp configmcp toolsmcp callmcp servedocs askdocs opendocs readagentsverifylogoutprofile listprofile useprofile removeprofile currentopenupdatecompletionapi
openemail login
Sign in with your browser, or save an API key
نحوه استفاده
openemail login openemail login --no-browser openemail login --scopes <list> openemail login --with-token < key.txt openemail login --token <key> openemail login --profile <name>
With no flags in an interactive terminal it asks how you want to sign in. The browser sign-in opens the OpenEmail approval page, where you pick the workspace, the access and how long it lasts, then brings the approval back to the terminal on its own. Over SSH, or with --no-browser, it prints the link and you paste back the code the browser shows. A browser sign-in asks for a verification code before sensitive changes, exactly like the web app. An API key never asks for a code, which makes it the choice for scripts and servers. The sign-in is saved in ~/.openemail/config.json as a profile, and becomes the active profile only when no other profile is active, so --profile <name> adds a second sign-in without changing what other commands use.
پرچمها
--token <key>Save this API key (oe_live_ or oe_test_). It lands in your shell history, so prefer
--with-token--with-tokenRead an API key from stdin and save it
--no-browserPrint the sign-in link and paste the code back instead of opening a browser. Chosen for you over SSH
--scopes <list>قابل تکرارPermissions to preselect on the approval page, comma separated. You can still change them there
--forceReplace the sign-in already saved on this profile without asking
نمونهها
openemail loginopenemail login --no-browseropenemail login --scopes emails:send,threads:readopenemail login --with-token < ~/.config/openemail/keyopenemail login --profile workopenemail whoami
Show who you are signed in as, and what you may do
نحوه استفاده
openemail whoami openemail whoami --json openemail whoami --profile <name>
Reads the credential the next command would use, a saved profile, OPENEMAIL_API_KEY or --api-key, and asks the API what it may do: the workspace, the mode, the scopes, any address or domain restriction, and when a browser sign-in expires.
نمونهها
openemail whoamiopenemail whoami --jsonopenemail whoami --profile workOPENEMAIL_API_KEY=oe_test_... openemail whoamiopenemail status
Show your sign-in, sender addresses and domains
نحوه استفاده
openemail status openemail status --json
Everything whoami shows, plus the addresses you can send from and the verification state of every domain, read in parallel. A section your credential may not read, for example domains without the domains:read scope, says so instead of failing the whole command.
نمونهها
openemail statusopenemail status --jsonopenemail status --profile workopenemail send
Send, schedule or translate and send an email
نحوه استفاده
openemail send --to <address> --subject <text> --text <body> [flags] openemail send --to <address> --subject <text> --body-file <path> [flags] openemail send --to <address> --template <id> [--props <json>] [flags]
Sends one email through emails.send. The body comes from --text, --html or both, then --body-file, then anything piped on stdin, and in an interactive terminal from your editor ($VISUAL or $EDITOR). Piped input that starts with an HTML tag is sent as HTML. Without --from you pick one of the addresses you can send from, or the only one is used. A piped body counts as unattended, so the picker is off and --from is needed when you can send from more than one address. --draft sends a saved draft's body, and its subject unless you pass --subject, to the recipients you name. In an interactive terminal you see a summary and confirm before anything goes, unless you pass --yes. Files attached with --attach travel inline while they come to 5 MB or less in total, and are uploaded to Files first and sent by reference when they come to more.
پرچمها
--to <address>قابل تکرارRecipient, or several comma separated.
Ada Lovelace <[email protected]>works too--cc <address>قابل تکرارCopy recipient, or several comma separated
--bcc <address>قابل تکرارBlind copy recipient, or several comma separated
--from <address>Address to send from. Left out, the only address you can send from is used, or you pick one in a terminal. A piped body turns the picker off
--reply-to <address>Address written into the Reply-To header
-s, --subject <text>Subject line
--text <text>Plain text body
--html <html>HTML body
-f, --body-file <path>Read the body from a file. A
.htmlor.htmfile is sent as HTML and anything else as text.-reads stdin-a, --attach <path>قابل تکرارAttach a file. Up to 5 MB in total travels inline, and a larger set is uploaded to Files first
--template <id-or-slug>Send a stored template instead of a body
--props <json|@file>Template props as a JSON object,
@fileor-for stdin--at <when>Schedule the send: an ISO date such as
2026-10-01T09:00:00Z, or a delay such as10m,2h,1dorPT1H--undo <seconds>Hold an immediate send for 0 to 900 seconds so it can still be cancelled
--translate <language>Translate the email before it goes, to a code or name such as
deorGerman--tag <key=value>قابل تکرارTag the email. Tags are echoed back on every read
--draft <id>Send the body of a saved draft, and its subject unless you pass
--subject.--toand--fromstill apply--thread <id>File the sent email into this thread
--idempotency-key <key>Your own idempotency key, so running the command again never sends twice
نمونهها
openemail send --to [email protected] --subject "Lunch?" --text "Thursday at noon works for me."cat report.md | openemail send --from [email protected] --to [email protected] --subject "Weekly report" --attach chart.pngopenemail send --to [email protected] --subject "Invoice" --body-file invoice.html --translate de --at 2hopenemail send --to [email protected] --template welcome --props '{"name":"Ada"}' --tag campaign=onboardingopenemail send --from [email protected] --to [email protected] --subject "Receipt" --text "Thanks" --idempotency-key order-4192 --jsonopenemail inbox
List the threads in your inbox or another folder
lsنحوه استفاده
openemail inbox [folder] [flags]
Lists one page of threads, newest first, and reads each one (six at a time) to show when it last moved, who wrote last, the subject, its labels and its id. The folder defaults to the inbox, and sent, archive, starred, snoozed, spam, trash, draft or a label id such as USER_RECEIPTS work too. A dot marks a thread with unread mail. Pass the id to openemail read to open it.
آرگومانها
<folder>Folder or label id to list (default inbox)
پرچمها
-u, --unreadOnly threads with unread mail
-q, --query <search>Mailbox search such as
from:ada has:pdf newer_than:7d-l, --label <label-id>قابل تکرارOnly threads carrying this label id, or every one of several comma separated
-n, --limit <n>Threads per page, 1 to 100 (default 25)
--cursor <cursor>Carry on from the cursor an earlier page printed
--allRead every page instead of the first one
--from-contactsOnly threads whose newest message came from a saved contact
--sort <order>Order of the threads, newest first unless you pick another
یکی از"newest""oldest""sender""subject"
نمونهها
openemail inboxopenemail inbox --unread --limit 50openemail ls sent --query "to:ada"openemail inbox archive --from-contacts --sort oldestopenemail inbox --all --json | jq -r ".items[].id"openemail read
Read a thread, message by message
showنحوه استفاده
openemail read <thread-id> [flags]
Prints every message on the thread, oldest first, with who sent it, who it went to, when, the subject, the attachments with their sizes and ids, and the body. A plain text part is shown as it is, and an HTML-only message is turned into readable text: paragraphs, lists, quotes, headings and links as text (url). With --html stdout gets only the raw HTML of one message, so it can be saved to a file, and the headers go to stderr. Reading marks the thread read unless you pass --no-mark-read.
آرگومانها
<thread-id>الزامیThread id from
openemail inbox
پرچمها
-m, --message <n>Show only this message, counting from 1. A negative number counts from the newest
--htmlPrint only the raw HTML of one message on stdout, with the headers on stderr
--mark-readMark the thread read once it is shown, which is the default. Pass
--no-mark-readto leave it unread
نمونهها
openemail read CAHk7pQ2x9LmZ4openemail read CAHk7pQ2x9LmZ4 --message -1openemail show CAHk7pQ2x9LmZ4 --html --message 1 > first.htmlopenemail read CAHk7pQ2x9LmZ4 --no-mark-read --jsonopenemail search
Search your mail with the same syntax as the app
نحوه استفاده
openemail search <query...> [flags]
Searches the inbox, or the folder in --folder, and shows the matches like openemail inbox. Plain words must all appear and match loosely, a quoted phrase must appear as written, and operators such as from:, to:, subject:, has:pdf, is:unread, after:2026/01/31 and newer_than:7d narrow it. A query that names a folder with in: or is: searches there, and in:anywhere searches every folder.
آرگومانها
<query...>الزامییک یا چندWhat to look for. Quote it or pass several words
پرچمها
--folder <folder>Folder to search (default inbox). A query that names one with
in:oris:searches there instead-u, --unreadOnly threads with unread mail
-l, --label <label-id>قابل تکرارOnly threads carrying this label id, or every one of several comma separated
-n, --limit <n>Threads per page, 1 to 100 (default 25)
--cursor <cursor>Carry on from the cursor an earlier page printed
--allRead every page instead of the first one
--from-contactsOnly threads whose newest message came from a saved contact
--sort <order>Order of the threads, newest first unless you pick another
یکی از"newest""oldest""sender""subject"
نمونهها
openemail search invoice from:adaopenemail search "quarterly report" has:pdf newer_than:30dopenemail search in:anywhere from:me to:ada --limit 50openemail search receipt --folder archive --sort oldest --jsonopenemail reply
Reply to the last message on a thread
نحوه استفاده
openemail reply <thread-id> --text <body> [flags] openemail reply <thread-id> --all --body-file <path> [flags]
Replies to whoever sent the last message on the thread, or to its Reply-To address, and files the reply into the same thread. When the last message is one you sent, the reply goes to the people it went to. --all copies everyone else on that message, leaving out your own addresses. The subject gets Re: unless it already has it, and the reply is sent from the address the thread was delivered to when you can send from it. The body flags work as they do for openemail send, including stdin and your editor.
آرگومانها
<thread-id>الزامیThread id from
openemail inbox
پرچمها
--text <text>Plain text body
--html <html>HTML body
-f, --body-file <path>Read the body from a file. A
.htmlor.htmfile is sent as HTML and anything else as text.-reads stdin--allReply to everyone on the last message, leaving out your own addresses
-a, --attach <path>قابل تکرارAttach a file. Up to 5 MB in total travels inline, and a larger set is uploaded to Files first
--from <address>Address to send from. Left out, the only address you can send from is used, or you pick one in a terminal. A piped body turns the picker off
--to <address>قابل تکرارRecipient, or several comma separated.
Ada Lovelace <[email protected]>works too--cc <address>قابل تکرارCopy recipient, or several comma separated
--bcc <address>قابل تکرارBlind copy recipient, or several comma separated
-s, --subject <text>Subject line
--at <when>Schedule the send: an ISO date such as
2026-10-01T09:00:00Z, or a delay such as10m,2h,1dorPT1H--undo <seconds>Hold an immediate send for 0 to 900 seconds so it can still be cancelled
--translate <language>Translate the email before it goes, to a code or name such as
deorGerman--tag <key=value>قابل تکرارTag the email. Tags are echoed back on every read
--idempotency-key <key>Your own idempotency key, so running the command again never sends twice
نمونهها
openemail reply CAHk7pQ2x9LmZ4 --text "Thanks, that works for me."openemail reply CAHk7pQ2x9LmZ4 --all --attach notes.pdfecho "Confirmed." | openemail reply CAHk7pQ2x9LmZ4 --yesopenemail reply CAHk7pQ2x9LmZ4 --body-file reply.html --undo 30openemail archive
Archive threads out of the inbox
نحوه استفاده
openemail archive <thread-id...>
Adds ARCHIVE and removes INBOX, the same pair the app uses, so the threads leave the inbox and stay searchable. Several ids are handled in one run, and each one is reported.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail archive CAHk7pQ2x9LmZ4openemail archive CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tn --jsonopenemail inbox --query "newer_than:30d from:alerts" --json | jq -r ".items[].id" | xargs openemail archiveopenemail unarchive
Move archived threads back to the inbox
نحوه استفاده
openemail unarchive <thread-id...>
Adds INBOX and removes ARCHIVE, so the threads show in the inbox again.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail unarchive CAHk7pQ2x9LmZ4openemail unarchive CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tnopenemail trash
Move threads to the Bin
نحوه استفاده
openemail trash <thread-id...>
Adds TRASH and takes the threads out of the inbox, spam, snoozed and archive in one step, like delete in the app. Nothing is deleted, and a snoozed thread loses its wake time. No API call takes a thread back out of the Bin, so you are asked to confirm unless you pass --yes.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail trash CAHk7pQ2x9LmZ4openemail trash CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tn --yesopenemail star
Star threads
نحوه استفاده
openemail star <thread-id...>
Adds the STARRED label, so the threads show under Starred.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail star CAHk7pQ2x9LmZ4openemail inbox starredopenemail unstar
Take the star off threads
نحوه استفاده
openemail unstar <thread-id...>
Removes the STARRED label.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail unstar CAHk7pQ2x9LmZ4openemail unstar CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tnopenemail mark read
Mark threads read
نحوه استفاده
openemail mark read <thread-id...>
Removes the UNREAD label from each thread.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail mark read CAHk7pQ2x9LmZ4openemail inbox --unread --json | jq -r ".items[].id" | xargs openemail mark readopenemail mark unread
Mark threads unread
نحوه استفاده
openemail mark unread <thread-id...>
Adds the UNREAD label to each thread, so it shows as new again.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail mark unread CAHk7pQ2x9LmZ4openemail mark unread CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tn --jsonopenemail snooze
Hide threads until a later time
نحوه استفاده
openemail snooze <thread-id...> --until <when>
Adds SNOOZED, takes the threads out of the inbox and stores when they come back. Threads are woken by an hourly sweep, so one returns up to about an hour after the time you set, always into the inbox. Snoozing a snoozed thread replaces its wake time.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
پرچمها
--until <when>When the thread returns: an ISO date such as
2026-10-01T09:00:00Z, or a delay such as3h,2dor1w
نمونهها
openemail snooze CAHk7pQ2x9LmZ4 --until 3hopenemail snooze CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tn --until 1wopenemail snooze CAHk7pQ2x9LmZ4 --until 2026-10-01T09:00:00+02:00openemail unsnooze
Bring snoozed threads back now
نحوه استفاده
openemail unsnooze <thread-id...>
Adds INBOX, removes SNOOZED and clears the wake time, so the threads return straight away. A thread that is not snoozed stays where it is.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
نمونهها
openemail unsnooze CAHk7pQ2x9LmZ4openemail inbox snoozedopenemail label add
Put labels on threads
نحوه استفاده
openemail label add <thread-id...> --label <label-id>
Adds every label in --label to each thread. A label id that names no label is refused and nothing on that thread changes, so create it first with openemail labels create. TRASH, SNOOZED and DRAFT cannot be set here: use openemail trash or openemail snooze.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
پرچمها
-l, --label <label-id>قابل تکرارLabel id such as
USER_RECEIPTSorSTARRED, or several comma separated
نمونهها
openemail label add CAHk7pQ2x9LmZ4 --label USER_RECEIPTSopenemail label add CAHk7pQ2x9LmZ4 CAJx0dW1bQe7Tn --label USER_TAXES,USER_2026openemail label remove
Take labels off threads
نحوه استفاده
openemail label remove <thread-id...> --label <label-id>
Removes every label in --label from each thread. A label the thread does not carry is not an error.
آرگومانها
<thread-id...>الزامییک یا چندOne or more thread ids from
openemail inbox
پرچمها
-l, --label <label-id>قابل تکرارLabel id such as
USER_RECEIPTSorSTARRED, or several comma separated
نمونهها
openemail label remove CAHk7pQ2x9LmZ4 --label USER_RECEIPTSopenemail label rm CAHk7pQ2x9LmZ4 --label IMPORTANT --jsonopenemail temp new
Create a disposable inbox
createنحوه استفاده
openemail temp new [--name <local-part>] [--domain <domain>] [--ttl <minutes>]
Creates a disposable address that needs no account and no API key, and keeps its token in ~/.openemail/temp-mail.json so the other temp commands can reach it. The address is printed on stdout on its own, so ADDRESS=$(openemail temp new) works in a script. It lives for 60 minutes unless you pass --ttl, up to 24 hours, and openemail temp-mail extend adds up to an hour at a time within 24 hours of its creation, saving the new token it returns. A name you choose with --name is issued to anyone who asks for it too, so leave it out when the mail should reach you alone.
پرچمها
--name <local-part>The part before the @, up to 64 letters, digits, dots, dashes or underscores, starting and ending with a letter or digit. Left out, one is generated. Anyone who asks for the same name reads its mail too
--domain <domain>Domain from
openemail temp-mail list-domains. Left out, the first one in that list is used--ttl <minutes>How long the inbox lives, 1 to 1440 minutes (default 60)
نمونهها
openemail temp newopenemail temp new --name signup-test --ttl 120ADDRESS=$(openemail temp new --ttl 15)openemail temp new --jsonopenemail temp list
List the disposable inboxes this CLI created
نحوه استفاده
openemail temp list
Lists the inboxes kept in ~/.openemail/temp-mail.json, soonest to expire last. Expired inboxes are forgotten as they are found, because their tokens no longer open anything. An inbox extended with openemail temp-mail extend shows its later expiry. Nothing is read from the network.
نمونهها
openemail temp listopenemail temp ls --jsonopenemail temp read
List the mail in a disposable inbox, or read one message
showopenنحوه استفاده
openemail temp read [inbox] [message-id] [flags]
Without a message id it lists what has arrived, newest first, with a short preview that is often enough to read a one time code. With one it prints the whole message, turning HTML into readable text, and lists its attachments by name and size, without their bytes. The inbox is its id or address, and can be left out when you have only one, so a lone thr_ id reads that message. Reading a message does not mark it seen, and its body is never cut. The sender of mail in a temporary inbox is never verified.
آرگومانها
<inbox>Inbox id or address from
openemail temp list<message-id>A
thr_id from the list
پرچمها
--htmlPrint only the raw HTML on stdout, with the headers on stderr
--inbox-token <token>The
oe_inbox_token of an inbox this CLI did not create
نمونهها
openemail temp readopenemail temp read quiet-otter-12@example-temp.comopenemail temp read thr_9e3b7c1a5f2d8e40b6a9c3f1openemail temp read tinb_k7m2q9xw4bdp thr_9e3b7c1a5f2d8e40b6a9c3f1openemail temp read tinb_k7m2q9xw4bdp thr_9e3b7c1a5f2d8e40b6a9c3f1 --html > message.htmlopenemail temp watch
Wait for mail to arrive in a disposable inbox
نحوه استفاده
openemail temp watch [inbox] [--first]
Prints what is already in the inbox, then checks every 3 seconds and prints each new message as it lands, until you press Ctrl+C or the inbox expires. When openemail temp-mail extend saves a new token for the inbox meanwhile, the watch carries on with it until the later expiry. With --first it stops as soon as there is a message, which suits a script waiting for a sign-up code. With --json each message is one JSON line on stdout.
آرگومانها
<inbox>Inbox id or address from
openemail temp list, optional when you have only one
پرچمها
--firstStop as soon as the inbox holds a message, which suits a script waiting for a code
--inbox-token <token>The
oe_inbox_token of an inbox this CLI did not create
نمونهها
openemail temp watchopenemail temp watch quiet-otter-12@example-temp.comopenemail temp watch --first --json | jq -r .snippetopenemail temp delete
Move the mail in a disposable inbox to the bin and forget its token
rmنحوه استفاده
openemail temp delete [inbox] [--yes]
Moves every message the inbox shows to the bin at once, then removes the inbox and its token from ~/.openemail/temp-mail.json. Nothing about the lease is stored on the server, so there is nothing to revoke: it runs on until its expiry, and mail that arrives in the meantime still reaches whoever holds the token. Nothing holds the address back either, so it can be issued again at once, to anybody. You are asked to confirm unless you pass --yes.
آرگومانها
<inbox>Inbox id or address from
openemail temp list, optional when you have only one
پرچمها
--inbox-token <token>The
oe_inbox_token of an inbox this CLI did not create
نمونهها
openemail temp deleteopenemail temp rm quiet-otter-12@example-temp.com --yesopenemail temp delete tinb_k7m2q9xw4bdp --yes --jsonopenemail ai translate
Translate a subject and body without sending anything
نحوه استفاده
openemail ai translate --to <language> [--text <text>|--html <html>|--body-file <path>] [--subject <subject>] openemail ai translate --to <language> < message.txt
Runs the same translation a translated send performs and prints the result, so you can read it before anything leaves. Nothing is stored and nothing is sent. The body comes from --text, --html, --body-file (a .html file is sent as HTML, anything else as text) or stdin when it is piped. --text and --html also read a file with @path or stdin with -. Each call spends one AI action, and the credential needs the emails:send scope.
پرچمها
--to <language>الزامیTarget language as a code (
de), an English name (German) or its own name (Deutsch)--from <language>The language you wrote in. Stating it skips detection
--subject <subject>A subject line to translate
--text <text|@file|->A plain text body to translate
--html <html|@file|->An HTML body to translate
--body-file <path>Read the body from a file. A .html or .htm file is HTML, anything else is text
--originalKeep your original text below the translation (the default). Pass
--no-originalto leave it out
نمونهها
openemail ai translate --to de --subject "Your invoice" --text "The invoice is attached."openemail ai translate --to Japanese --body-file reply.html --no-originalcat notes.txt | openemail ai translate --to fropenemail ai translate --to es --text "See you soon" --jsonopenemail ai languages
List every language translation accepts
langsنحوه استفاده
openemail ai languages [--search <text>]
Prints the language table the server translates into, in the order a picker should show it. Any row's code, English name or own name works as --to on openemail ai translate and openemail send --translate. Signed out, it prints the table bundled with this version of the CLI.
پرچمها
--search <text>Keep only languages whose code, English name or own name contains this text
نمونهها
openemail ai languagesopenemail ai languages --search portopenemail ai languages --json | jq -r '.[] | select(.rtl) | .code'openemail ai compose
Write an email body with AI from a short prompt
writeنحوه استفاده
openemail ai compose "<prompt>" [--to <address>] [--subject <subject>] [--thread <thread-id>] [--tone <tone>]
Asks the OpenEmail assistant to write an email body in your own writing style and prints it. Nothing is sent or saved, so pipe it into openemail send --from <address> when you are happy with it. With --thread the assistant reads the thread first and writes a reply to it. The prompt can also come from stdin. This uses the MCP tool composeEmail, so it needs a browser sign-in (openemail login) and spends one AI action, plus one for each web search it runs.
آرگومانها
<prompt...>یک یا چندWhat the email should say
پرچمها
--to <address>قابل تکرارWho it is for. Repeat the flag or separate addresses with commas
--cc <address>قابل تکرارWho is copied in
--subject <subject>The subject the email will have, which helps the assistant stay on topic
--thread <thread-id>Write a reply to this thread. The assistant reads its latest messages first
--tone <tone>The tone to write in
یکی از"formal""friendly""casual""concise""direct""warm"
نمونهها
openemail ai compose "thank Ada for the invoice and ask for a PDF copy" --to [email protected]openemail ai compose "say yes to Tuesday at 3pm" --thread thr_123 --tone friendlyopenemail ai compose "decline politely" --thread thr_123 | openemail send --from [email protected] --to [email protected] --subject "Re: Proposal"openemail ai compose "remind the team about Friday" --jsonopenemail ai summarize
Print the AI summary of a thread
summarisesummaryنحوه استفاده
openemail ai summarize <thread-id>
Prints the short summary OpenEmail keeps for a thread, with its subject, sender and date. Summaries are written when mail arrives, and a thread holding an encrypted message is never summarised. This uses the MCP tool getThreadSummary, so it needs a browser sign-in (openemail login).
آرگومانها
<thread-id>الزامیThe thread to summarise, as
openemail inboxlists it
نمونهها
openemail ai summarize thr_123openemail ai summarize thr_123 --jsonopenemail ai summarize thr_123 --profile workopenemail mcp config
Print the snippet that connects an AI client to OpenEmail
نحوه استفاده
openemail mcp config [--client <client>]
Prints what to add to an MCP client so it can read and act on your mail, and which file it goes in. There are two ways to connect. The remote server URL is the simplest: the client opens your browser, you approve it on the OpenEmail consent page, and it appears in Account, Connected apps. Each client runs its own browser sign-in for the remote URL. The local bridge (openemail mcp serve, started through npx) is for clients that only start local servers, and it reuses this CLI's sign-in, so run openemail login first. With no --client, every client is printed in short form.
پرچمها
--client <client>The client to print the full snippet for
یکی از"claude-code""claude-desktop""cursor""vscode""windsurf""codex"
نمونهها
openemail mcp configopenemail mcp config --client claude-codeopenemail mcp config --client cursor --profile workopenemail mcp config --client vscode --jsonopenemail mcp tools
List the MCP tools this sign-in can use
listنحوه استفاده
openemail mcp tools [tool]
Lists every tool the OpenEmail MCP server offers to this sign-in, with the first sentence of its description. The list already leaves out tools your role or the app grant cannot use. Name one tool to see its full description and arguments. It needs a browser sign-in (openemail login).
آرگومانها
<tool>Show the description and arguments of this tool
نمونهها
openemail mcp toolsopenemail mcp tools composeEmailopenemail mcp tools --json | jq -r '.[].name'openemail mcp call
Call one MCP tool and print its result
نحوه استفاده
openemail mcp call <tool> [--args <json|@file|->] [--arg key=value ...]
Calls a tool on the OpenEmail MCP server with your browser sign-in and prints the text it returns. --args gives every argument as one JSON object, and each --arg key=value sets or overrides one of them. A value is read as JSON when it parses (--arg maxResults=5 is a number, --arg labelIds='["Label_1"]' a list) and as text otherwise, so quote a number you mean as text (--arg 'id="123"'). A result that starts with Refused ( exits with code 4, and usually means your role or the app grant does not allow the tool. A tool that makes a sensitive change, such as creating a rule or removing a domain, first needs a verification code, as the same change does through the REST API. In an interactive terminal the command asks for the code and then calls the tool again. Unattended it exits with code 4, so run openemail verify beforehand. The MCP server never asks for confirmation, so a tool that sends or deletes acts at once. Run openemail mcp tools <tool> to see what a tool takes.
آرگومانها
<tool>الزامیThe tool to call, as
openemail mcp toolslists it
پرچمها
--args <json|@file|->Every argument as one JSON object, from inline JSON, a file (
@args.json) or stdin (-)--arg <key=value>قابل تکرارSet one argument. The value is JSON when it parses, text otherwise
نمونهها
openemail mcp call whoAmIopenemail mcp call listThreads --arg folder=inbox --arg maxResults=5openemail mcp call getThread --args '{"threadId":"thr_123"}'openemail mcp call listTemplates --json | jq .contentopenemail mcp serve
Run a local stdio MCP server that forwards to OpenEmail
نحوه استفاده
openemail mcp serve
Reads newline-delimited JSON-RPC from stdin, sends each message to the OpenEmail MCP server with your saved browser sign-in, and writes each answer to stdout as one line. Notifications produce no output, a batch is split into single requests and answered as one array, and an expired access token is refreshed without the client noticing. Nothing but protocol reaches stdout, and nothing reaches stderr unless you pass --debug, except one hint the first time a tool is refused because it needs a verification code. That refusal reaches the client unchanged, because the bridge cannot ask for a code over stdio. Run openemail verify in a terminal with the same profile, and tools that make a sensitive change run without a code for the next 60 minutes. It stops when stdin closes. Use it for MCP clients that only start local servers; openemail mcp config prints the snippet. It needs a browser sign-in (openemail login), because API keys cannot reach the MCP server.
نمونهها
openemail mcp serveopenemail mcp serve --profile workecho '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | openemail mcp serveopenemail mcp serve --debug 2> mcp.logopenemail docs ask
Ask the docs assistant a question
نحوه استفاده
openemail docs ask "<question>"
Sends your question to the OpenEmail docs assistant and prints the answer as it is written, followed by the numbered pages it came from. The assistant answers only from the documentation, so it cannot see or change your mailbox. It needs no sign-in and never sends your credentials. Questions are limited to 600 characters and to a daily number per network, so for longer research open the docs with openemail docs open.
آرگومانها
<question...>الزامییک یا چندWhat you want to know, in plain words
نمونهها
openemail docs ask "how do I verify a domain?"openemail docs ask what does step-up mean for the CLIopenemail docs ask "which scopes does sending need?" --json | jq -r .answeropenemail docs open
Open a docs page in your browser
نحوه استفاده
openemail docs open [slug] [--print]
Opens the OpenEmail documentation, or the page you name. A slug is the part of the address after /docs/, such as cli/ai-and-mcp, and a full docs link works too. Over SSH, or with --print, it prints the link instead.
آرگومانها
<slug>The page to open, such as
get-started/welcomeorcli/authentication
پرچمها
--printPrint the link instead of opening a browser
نمونهها
openemail docs openopenemail docs open cli/authenticationopenemail docs open cli/commands --printopenemail docs read
Print a docs page as Markdown
نحوه استفاده
openemail docs read [slug]
Prints the Markdown version of a docs page, the same text the website serves at the page address with .md on the end. It is handy for reading in the terminal or handing a page to another tool. With no slug it prints llms.txt, the index of every page. It needs no sign-in.
آرگومانها
<slug>The page to print, such as
cli/commands. Leave it out for the index of every page
نمونهها
openemail docs read cli/commandsopenemail docs readopenemail docs read get-started/welcome | lessopenemail docs read cli/scripting --json | jq -r .markdownopenemail agents
A guide for AI agents and scripts that drive this CLI
agentنحوه استفاده
openemail agents openemail agents --json
Prints a short guide, in Markdown, for an AI agent such as Claude Code or Codex, or a script in CI: how to sign in without a person, why to pass --json and how to read errors and exit codes, how to find commands with --help --json, how to preview a change with --dry-run and when to pass --yes, how lists and streams page, what happens when a verification code or a scope is missing, and a few recipes to copy. With --json it prints the same guide as one JSON document. It needs no sign-in and sends nothing.
نمونهها
openemail agentsopenemail agents > OPENEMAIL.mdopenemail agents --json | jq -r '.recipes[].commands[]'openemail verify
Enter a verification code now, so sensitive commands run for 60 minutes
نحوه استفاده
openemail verify openemail verify --status openemail verify --force
With a browser sign-in, a sensitive change such as adding a webhook, creating or turning on a rule, or removing a domain asks for a verification code first, the way the web app does. Commands ask for it when they need it. openemail verify asks for it now instead: it emails you a code, or asks for one from your authenticator app or a backup code when two-factor sign-in is on, and once the code is right, sensitive commands, openemail mcp call and openemail mcp serve run without a code for the next 60 minutes. Run it before a script or an AI client does something sensitive, because neither can type a code. It covers this profile only. An AI client connected through the remote server URL is a connected app of its own, so this does not cover it: allow that app with Allow changes for 60 minutes in its menu under Connected apps on the website (openemail open apps). --status shows whether this sign-in is verified and until when. A code allows 5 tries. After 10 wrong codes for this sign-in within 24 hours, or 20 across all your connected apps, verification is paused, so the command says when it resumes and exits 4. API keys never need a code.
پرچمها
--statusShow whether this sign-in is verified and until when, without asking for a code
--forceAsk for a new code even when this sign-in is already verified, which starts a fresh 60 minutes
نمونهها
openemail verifyopenemail verify --statusopenemail verify --status --jsonopenemail verify --profile workopenemail logout
Sign out and forget a saved profile
نحوه استفاده
openemail logout openemail logout --profile <name> openemail logout --all
A browser sign-in is revoked on the server first, which removes it from Account settings, Command line, and then forgotten on this device. The profile is forgotten even when the server cannot be reached, and the command says so. An API key is only forgotten: the key itself keeps working until you revoke it.
پرچمها
--allSign out of every saved profile
نمونهها
openemail logoutopenemail logout --profile workopenemail logout --allopenemail logout --jsonopenemail profile list
List the saved profiles
نحوه استفاده
openemail profile list openemail profile list --json
Shows every saved sign-in with its kind, workspace and user or key. The active profile is marked with a dot.
نمونهها
openemail profile listopenemail profile ls --jsonopenemail profile use
Make a saved profile the active one
switchنحوه استفاده
openemail profile use <name>
Every command without --profile then uses this sign-in. With no name in an interactive terminal it lets you pick one.
آرگومانها
<name>الزامیThe profile to activate
نمونهها
openemail profile use workopenemail profile useopenemail profile use default --jsonopenemail profile remove
Sign out of a profile and forget it
نحوه استفاده
openemail profile remove <name>
The same as openemail logout --profile <name>: a browser sign-in is revoked on the server, then the profile is forgotten on this device either way.
آرگومانها
<name>الزامیThe profile to remove
نمونهها
openemail profile remove workopenemail profile rm staging --jsonopenemail profile current
Print the profile the next command would use
نحوه استفاده
openemail profile current openemail profile current --json
Prints the profile name on stdout, so $(openemail profile current) works in scripts. When OPENEMAIL_API_KEY or --api-key is in effect no profile is used, and it says so on stderr.
نمونهها
openemail profile currentOPENEMAIL_PROFILE=work openemail profile currentopenemail profile current --jsonopenemail open
Open a page of the OpenEmail web app in your browser
نحوه استفاده
openemail open [page] [--print] openemail open forwarding <address> [--print]
Opens the web app at the page you name, signed in as whoever is signed in to that browser. Use it for what the CLI does not do yet, such as billing, workspaces, account security, data export, forwarding and DNS providers. With no page it opens the mailbox. forwarding takes the address whose forwarding you want to change. A path that starts with / is opened as it is. Over SSH, or with --print, it prints the link instead.
آرگومانها
<page>One of the pages below, or a path such as
/mail/workspace/domains<address>The address a
forwardingpage belongs to
پرچمها
--printPrint the link instead of opening a browser
نمونهها
openemail openopenemail open billingopenemail open cliopenemail open forwarding [email protected]openemail open providersopenemail open domains --printopenemail update
Check npm for a newer version of the CLI
نحوه استفاده
openemail update
Checks the npm registry now, ignoring the daily cache, and prints the command that installs the latest release with the package manager you used. The CLI never updates itself. When npm has no release of the CLI yet it says so and exits 0, and only a registry it could not reach exits 9.
نمونهها
openemail updateopenemail update --jsonopenemail completion
Print a shell completion script for bash, zsh or fish
نحوه استفاده
openemail completion <bash|zsh|fish>
Prints a completion script built from every command, subcommand and flag this version of the CLI knows. Load it in your shell profile, and run the command again after an update.
آرگومانها
<shell>الزامیbash, zsh or fish
نمونهها
eval "$(openemail completion bash)"openemail completion zsh > "${fpath[1]}/_openemail"openemail completion fish > ~/.config/fish/completions/openemail.fishopenemail api
Call any REST endpoint with your sign-in
نحوه استفاده
openemail api <method> <path> [--data <json|@file|->] [--query <key=value>] [--header <key=value>] openemail api <path>
Sends one request to the OpenEmail REST API through the same transport the other commands use, so your profile or API key, token refresh and verification codes all apply. The path is relative to the API origin, for example /threads or /keys/self, and a path on its own is a GET. A JSON response is printed as formatted JSON, and a file is saved with --out. A failed request prints the API error and exits with the matching code.
آرگومانها
<method>GET, POST, PUT, PATCH, DELETE or HEAD (default GET)
<path>الزامیPath on the API, such as
/threadsor/emails/msg_123
پرچمها
-d, --data <json|@file|->Request body: inline JSON,
@fileto read a file, or-for stdin-q, --query <key=value>قابل تکرارQuery parameter. Parameters written into the path are kept too
-H, --header <key=value>قابل تکرارExtra request header.
Key: valueworks too. The CLI sets Authorization itself-o, --out <path>Save the response body to this file as it came, which suits a download.
-writes it to stdout
نمونهها
openemail api /keys/selfopenemail api GET /threads --query folder=inbox --query limit=5openemail api POST /labels --data '{"name":"Receipts"}'openemail api PATCH /threads/CAHk7pQ2x9LmZ4 --data @patch.jsonopenemail api GET /files/file_123/content --out report.pdfopenemail api DELETE /webhooks/wh_123 --yes