Guide

Manage Outlook Calendar from the CLI

Create, list, update, and delete Microsoft 365 calendar events from your terminal. No Azure AD app registration, no Graph API boilerplate. The Nylas CLI handles OAuth2 and calendar CRUD with single-line commands. Works with Gmail, Outlook, Exchange, Yahoo, iCloud, and IMAP.

By Caleb Geene

The problem with Microsoft Graph API

You want to check your Outlook calendar from the terminal. Maybe create a meeting, check a coworker's availability, or pipe event data into a script. Microsoft's official path: register an Azure AD application, configure API permissions, handle OAuth2 token exchange, then call Graph API endpoints with Bearer tokens.

That's 4 steps before you run your first query. According to Microsoft's own quickstart docs, the Azure AD app registration process takes 10-15 minutes, and that's before you write any code.

Graph API vs. Nylas CLI

TaskMicrosoft Graph APINylas CLI
Initial setupRegister Azure AD app, configure permissions, get tenant IDbrew install nylas/nylas-cli/nylas && nylas init
AuthenticationImplement OAuth2 PKCE flow, handle token refreshnylas auth login (browser-based OAuth2)
List eventsGET /me/events with Bearer token and query paramsnylas calendar events list
Create eventPOST /me/events with JSON bodynylas calendar events create --title "..."
Check availabilityPOST /me/calendar/getSchedule with JSON bodynylas calendar availability
Provider lock-inMicrosoft onlyWorks with Google, Yahoo, iCloud, Exchange, IMAP too
Time to first API call15-30 minutesUnder 2 minutes

1. Install the Nylas CLI

Pick whichever method fits your setup:

# macOS / Linux (Homebrew)
brew install nylas/nylas-cli/nylas

# macOS / Linux / WSL (shell script)
curl -fsSL https://cli.nylas.com/install.sh | bash

# Windows (PowerShell)
irm https://cli.nylas.com/install.ps1 | iex

# Any platform with Go installed
go install github.com/nylas/cli/cmd/nylas@latest

2. Authenticate with Outlook

Run the init wizard. It creates a Nylas account, picks an application, generates an API key, and walks you through connecting your Microsoft 365 account:

nylas init

If you already have an API key and grant, authenticate directly:

nylas auth login

This opens a browser window for Microsoft's OAuth2 consent screen. Once you approve, the CLI stores your credentials locally. No tokens to copy-paste, no .env files to manage.

3. List calendar events

# Your next 7 days of events (default)
nylas calendar events list

# Next 30 days
nylas calendar events list --days 30

# Show timezone info alongside each event
nylas calendar events list --show-tz

# Convert times to a specific timezone
nylas calendar events list --timezone America/Chicago

Example output

$ nylas calendar events list --days 7

Sprint Planning
  When: Mon, Mar 30, 2026, 10:00 AM - 11:00 AM
  Location: Teams Meeting
  Guests: 8 participant(s)
  ID: event_abc123

1:1 with Manager
  When: Tue, Mar 31, 2026, 2:00 PM - 2:30 PM
  Guests: 2 participant(s)
  ID: event_def456

Found 6 event(s)

4. Create events

# Basic meeting
nylas calendar events create \
  --title "Product Review" \
  --start "2026-04-01 14:00" \
  --end "2026-04-01 15:00"

# With participants (sends invites automatically)
nylas calendar events create \
  --title "Design Sync" \
  --start "2026-04-02 10:00" \
  --end "2026-04-02 10:30" \
  --participant alice@company.com \
  --participant bob@company.com

# All-day event
nylas calendar events create \
  --title "Company Holiday" \
  --start "2026-04-10" \
  --all-day

# With location
nylas calendar events create \
  --title "Client Lunch" \
  --start "2026-04-03 12:00" \
  --end "2026-04-03 13:30" \
  --location "123 Main St, Building C"

5. Update and delete events

# Reschedule an event
nylas calendar events update event_abc123 \
  --start "2026-04-01 15:00" \
  --end "2026-04-01 16:00"

# Change the title
nylas calendar events update event_abc123 \
  --title "Product Review (Rescheduled)"

# Delete an event
nylas calendar events delete event_abc123

6. Check availability

Free/busy checks work across your connected calendars. No need to parse iCal feeds or call the Graph API's getSchedule endpoint:

# Your availability for the next 7 days
nylas calendar availability

# Check specific time range
nylas calendar availability \
  --start "2026-04-01T09:00:00" \
  --end "2026-04-01T17:00:00"

7. Find mutual meeting times

The find-time command checks availability across multiple participants and suggests open slots:

# Find a 30-minute slot with two coworkers
nylas calendar find-time \
  --participants alice@company.com,bob@company.com \
  --duration 30m

# Find time within business hours only
nylas calendar find-time \
  --participants alice@company.com \
  --duration 1h \
  --start "2026-04-01T09:00:00" \
  --end "2026-04-04T17:00:00"

Example output

$ nylas calendar find-time --participants alice@company.com,bob@company.com --duration 30m

Available slots:

1. Tue, Apr 1, 2026, 11:00 AM - 11:30 AM
   All participants free

2. Tue, Apr 1, 2026, 3:00 PM - 3:30 PM
   All participants free

3. Wed, Apr 2, 2026, 10:00 AM - 10:30 AM
   All participants free

Found 3 slot(s)

8. JSON output for scripting

Every command supports --json for machine-readable output. Pipe it into jq, feed it to a script, or send it to an API:

# List events as JSON
nylas calendar events list --json

# Count today's meetings
nylas calendar events list --days 1 --json | jq length

# Extract titles and times
nylas calendar events list --json | jq '.[] | {title: .title, start: .when.start_time}'

# Morning briefing script
#!/bin/bash
count=$(nylas calendar events list --days 1 --json | jq length)
echo "You have $count meetings today."
if [ "$count" -gt 6 ]; then
  echo "Heavy meeting day. Block focus time."
fi

9. Outlook-specific tips

Shared calendars

Microsoft 365 organizations often use shared calendars for teams, projects, and rooms. List all calendars your account can access:

# See all calendars (personal + shared + delegated)
nylas calendar list

# Target a specific shared calendar
nylas calendar events list --calendar-id cal_shared_team_xyz

Room booking

Room resources in Exchange/M365 appear as calendars. Book a room by adding it as a participant or targeting its calendar directly:

# Add a room resource as participant
nylas calendar events create \
  --title "All-Hands" \
  --start "2026-04-05 10:00" \
  --end "2026-04-05 11:00" \
  --participant conference-room-a@company.com

Teams meeting links

When you create an event with participants on a Microsoft 365 account, conferencing details can be included. Check the JSON output for the meeting link:

nylas calendar events create \
  --title "Weekly Standup" \
  --start "2026-04-07 09:00" \
  --end "2026-04-07 09:30" \
  --participant dev-team@company.com \
  --json | jq '.conferencing'

Next steps