Olk
by @rlrghb
Microsoft Outlook and OneDrive CLI for email, calendar, contacts, tasks, and files via Microsoft Graph API.
clawhub install olkπ About This Skill
name: olk description: Microsoft Outlook and OneDrive CLI for email, calendar, contacts, tasks, and files via Microsoft Graph API. homepage: https://github.com/rlrghb/olkcli metadata: { "openclaw": { "emoji": "π¬", "requires": { "bins": ["olk"] }, "install": [ { "id": "brew", "kind": "brew", "formula": "rlrghb/tap/olk", "bins": ["olk"], "label": "Install olk (Homebrew)", }, ], }, }
olk
Use olk for Outlook Mail/Calendar/Contacts/Tasks and OneDrive files. Works with personal Microsoft accounts and enterprise Azure AD/Entra ID.
Setup (once)
olk auth login β device-code OAuth2 flow for personal accounts (opens browser)olk auth login --enterprise β login with enterprise scopes for work/school accounts (enables OOO, inbox rules, directory search)olk auth login --client-id ID --tenant-id ID β enterprise custom app registrationolk auth list β list authenticated accountsolk auth status β check token validityolk auth logout [EMAIL] β remove stored credentialsolk auth clean --force β remove ALL stored accounts and tokensolk mail list [-n 25] [-f FOLDER] [-u] [--from SENDER] [--after DATE] [--before DATE] [--focused] [--other]olk mail get [--format full|text|html] olk mail send --to a@b.com --subject "Hi" --body "Hello"olk mail send --to a@b.com --subject "Hi" --body "Hello
" --htmlecho "Hello" | olk mail send --to a@b.com --subject "Hi"olk mail send --to a@b.com --to b@c.com --cc d@e.com --subject "Hi" --body "Hello"olk mail send --to a@b.com --subject "Report" --body "See attached" --attach report.pdf --attach data.csvolk mail send --to a@b.com --subject "Urgent" --body "ASAP" --importance higholk mail send --to a@b.com --subject "Contract" --body "Please review" --read-receiptolk mail search "from:boss@co.com subject:urgent" [-n 25]olk mail reply --body "Thanks" olk mail reply --body "Thanks" --reply-all olk mail forward --to a@b.com [--comment "FYI"] olk mail move olk mail delete --force olk mail mark --read or olk mail mark --unread olk mail foldersolk mail folders create -n "Project X"olk mail folders rename -n "New Name" olk mail folders delete --force olk mail attachments olk mail attachments --save [--out DIR] olk mail attachments --attachment-id [--out DIR] Drafts
olk mail drafts list [-n 25]olk mail drafts create --to a@b.com --subject "Draft" --body "WIP" [--cc X] [--bcc X] [--html]echo "WIP" | olk mail drafts create --to a@b.com --subject "Draft"olk mail drafts send olk mail drafts delete --force Flags & Categories
olk mail flag flagged|complete|notFlagged olk mail importance low|normal|high olk mail categorize -c "Red Category" -c "Blue Category" olk mail categorize -c none olk mail categories listolk mail categories create -n "My Category" [--preset preset0]olk mail categories delete --force none, preset0 (red) through preset24Out-of-Office (enterprise/work accounts only β requires olk auth login --enterprise)
olk mail ooo getolk mail ooo set --message "I'm out of office"olk mail ooo set --message "On vacation" --start 2026-04-10 --end 2026-04-17 [--audience none|contactsOnly|all]olk mail ooo set --message "Internal msg" --external-message "External msg"olk mail ooo offInbox Rules (enterprise/work accounts only β requires olk auth login --enterprise)
olk mail rules listolk mail rules create --name "Archive boss" --from boss@co.com --move Archiveolk mail rules create --name "Auto-read newsletters" --subject-contains "newsletter" --mark-readolk mail rules create --name "Forward invoices" --subject-contains "invoice" --forward-to accounting@co.comolk mail rules delete --force Focused Inbox
olk mail list --focusedolk mail list --otherolk mail list --focused --unreadWell-known folder names: inbox, sentitems, drafts, deleteditems, junkemail, archive.
Calendar
olk calendar events [-d DAYS] [--after DATE] [--before DATE] [--calendar ID] [-n 25]olk calendar get olk calendar create --subject "Standup" --start 2025-06-15T09:00 --end 2025-06-15T09:30olk calendar create --subject "Sync" --start 2025-06-15T10:00 --end 2025-06-15T10:30 --attendees a@b.com --attendees c@d.comolk calendar create --subject "Offsite" --start 2025-06-15 --end 2025-06-16 --all-dayolk calendar create --subject "Call" --start 2025-06-15T14:00 --end 2025-06-15T14:30 --online-meetingolk calendar create --subject "Standup" --start 2025-06-15T09:00 --end 2025-06-15T09:15 -r dailydaily, weekdays (Mon-Fri), weekly, monthly, yearlyolk calendar update [--subject X] [--start Y] [--end Z] [--location L] olk calendar delete --force olk calendar respond accept|decline|tentative olk calendar calendarsolk calendar availability --emails user@co.com [--emails user2@co.com] [-d DAYS] [--after DATE] [--before DATE]olk calendar view [-d 7] [--after DATE] [--before DATE] [--calendar ID] [-n 50]olk calendar find-times --attendees a@b.com --attendees c@d.com [-d 60] [--after DATE] [--before DATE]People / Directory
olk people search "john" [-n 25]olk people search "Jane Smith"Contacts
olk contacts list [-n 25] [--skip N] [--sort displayName|givenName|surname]olk contacts get olk contacts create --first-name John --last-name Doe [-e j@d.com] [-e backup@d.com] [-p 555-1234] [--business-phone P] [--home-phone P] [--company Acme] [--title Engineer] [--department D] [--manager M] [--birthday YYYY-MM-DD] [--notes N] [--middle-name M] [--nickname N] [-g CATEGORY] [--street S] [--city C] [--state S] [--postal-code P] [--country C] [--address-type business|home|other]olk contacts update [--first-name X] [--last-name Y] [-e EMAIL]... [-p MOBILE] [--business-phone P] [--home-phone P] [--company C] [--title T] [--department D] [--manager M] [--birthday YYYY-MM-DD] [--notes N] [--middle-name M] [--nickname N] [-g CATEGORY]... [--street S] [--city C] [--state S] [--postal-code P] [--country C] [--address-type business|home|other] olk contacts delete --force olk contacts search "John" [-n 25]Tasks (Microsoft To Do)
olk todo listsolk todo lists create -n "Project Tasks"olk todo lists delete --force olk todo list [--list LIST_ID] [-n 25] [--status notStarted|inProgress|completed|waitingOnOthers|deferred]olk todo get [--list LIST_ID] olk todo create --title "Buy groceries" [--due 2026-04-15] [--start 2026-04-10] [--importance low|normal|high] [--body "Notes"] [--reminder 2026-04-14T09:00] [--recurrence daily|weekdays|weekly|monthly|yearly] [-c "Work" -c "Urgent"] [--list LIST_ID]olk todo update [--title X] [--due DATE] [--start DATE] [--importance low|normal|high] [--body TEXT] [--reminder DATETIME] [--recurrence PATTERN] [-c CATEGORY] [--list LIST_ID] olk todo complete [--list LIST_ID] olk todo delete --force [--list LIST_ID] Checklist Items
olk todo checklist list [--list LIST_ID] olk todo checklist create -n "Step 1" [--list LIST_ID] olk todo checklist toggle [--list LIST_ID] olk todo checklist update -n "New name" [--list LIST_ID] olk todo checklist delete --force [--list LIST_ID] Task Attachments
olk todo attach list [--list LIST_ID] olk todo attach upload [--list LIST_ID] olk todo attach download [--out DIR] [--list LIST_ID] olk todo attach delete --force [--list LIST_ID] Linked Resources
olk todo links list [--list LIST_ID] olk todo links create -n "Resource name" [--url URL] [--app-name APP] [--external-id ID] [--list LIST_ID] olk todo links delete --force [--list LIST_ID] If --list is omitted, the default (first) task list is used automatically.
OneDrive
olk drive listolk drive info [--drive-id ID]olk drive ls [PATH] [--drive-id ID] [-n 50]olk drive get [--drive-id ID] olk drive search [--drive-id ID] [-n 25] olk drive recent [--drive-id ID]olk drive shared [--drive-id ID]olk drive download [--out DIR] [--drive-id ID] olk drive upload [--drive-id ID] [--replace] olk drive mkdir [--drive-id ID] olk drive cp [--name NEW_NAME] [--drive-id ID] olk drive mv [--drive-id ID] olk drive rm --force [--drive-id ID] olk drive share [--type view|edit] [--scope anonymous|organization] [--drive-id ID] olk drive versions [--drive-id ID] If --drive-id is omitted, the user's primary drive is used automatically.
Configuration
olk config set timezone America/New_Yorkolk config get timezone--tz flag > OLK_TIMEZONE env > config file > system local"timezone" fieldUser Profile
olk whoami β display current user's name, email, job title, department, office, phoneShortcuts
olk send ... β olk mail send ...olk ls ... β olk mail list ...olk inbox ... β olk mail list ...olk search β olk mail search olk today β olk calendar events --days 1olk week β olk calendar events --days 7Output Formats
--json: JSON envelope { results, count, nextLink }.--json --results-only: bare JSON array (best for scripting).--plain: tab-separated values for piping to awk, cut.--select from,subject: comma-separated field projection.Global Flags
--json β JSON output (env: OLK_JSON)--plain β TSV output (env: OLK_PLAIN)--account EMAIL β use a specific account (env: OLK_ACCOUNT)--results-only β unwrap JSON envelope (env: OLK_RESULTS_ONLY)--select FIELDS β field projection (env: OLK_SELECT)--force β skip confirmations (env: OLK_FORCE)--dry-run β preview without executing (env: OLK_DRY_RUN)-v, --verbose β verbose output (env: OLK_VERBOSE)--color auto|never|always β color mode (env: OLK_COLOR)--timeout SECONDS β request timeout, default 60 (env: OLK_TIMEOUT)--tz TIMEZONE β IANA time zone for display, e.g. America/New_York, UTC, Local (env: OLK_TIMEZONE)Scripting Examples
olk mail list --unread --json --results-only | jq lengtholk today --json --results-only | jq -r '.[].subject'olk contacts list --plain --select name,emailolk send --to ops@co.com --subject "Deploy done" --body "$(date): v1.2.3 deployed"olk send --to boss@co.com --subject "Report" --attach report.pdfolk mail list --json --results-only | jq -r '.[] | select(.isRead == false) | "\(.from): \(.subject)"'olk mail attachments --save --out ./downloads olk calendar availability --emails colleague@co.com --json --results-only | jq '.[] | .items'olk todo list --status notStarted --json --results-only | jq -r '.[].title'olk mail ooo set --message "On vacation until April 17" --start 2026-04-10 --end 2026-04-17olk mail rules list --json --results-only | jq -r '.[] | select(.isEnabled) | .displayName'olk calendar find-times --attendees a@b.com --attendees c@d.com --json --results-only | jq '.[0]'olk people search "engineering" --json --results-only | jq -r '.[].email'olk mail list --focused --unread --json --results-only | jq lengtholk drive ls /Documents --json --results-only | jq '[.[] | select(.size > 10000000)] | sort_by(.size) | reverse'olk drive info --json --results-only | jq '{used: .quotaUsed, total: .quotaTotal}'Notes
OLK_TIMEZONE=America/New_York to display times in your timezone.OLK_ACCOUNT=you@example.com to avoid repeating --account.OLK_TODO_LIST= to avoid repeating --list for todo commands.OLK_DRIVE_ID= to avoid repeating --drive-id for drive commands.OLK_KEYRING_PASSWORD= for headless/non-interactive environments (file-backend keyring).--json --results-only plus jq.list or search first β never guess.2025-06-15 or 2025-06-15T09:00.from:, to:, subject:, hasAttachment:, received>=.--body is omitted from mail send or mail drafts create, body is read from stdin.delete) require --force or will prompt for confirmation.olk auth status first.olk auth login --enterprise.olk auth login) if you authenticated before OneDrive support was added.