Source: https://cli.nylas.com/guides/calendar-ai-assistant-cli

# AI Calendar Assistant from the Terminal

An AI calendar assistant turns plain-English requests into booked meetings, protects deep-work hours, flags conflicts before they land, and reads meeting context out of email threads. This guide wires all four with nylas calendar ai and nylas calendar schedule ai.

Written by [Hazik](https://cli.nylas.com/authors/hazik) Director of Product Management

Reviewed by [Qasim Muhammad](https://cli.nylas.com/authors/qasim-muhammad)

Updated June 9, 2026

> **TL;DR:** Type a meeting request in plain English to `nylas calendar schedule ai`, protect deep work with `calendar ai focus-time`, catch overlaps with `conflicts check`, and read a thread with `analyze-thread`. The four chain into one assistant script — it's at the bottom.

## How do I schedule a meeting with natural language?

The `nylas calendar schedule ai` command parses a plain-English request, reads each participant's timezone, checks availability, and returns up to 3 ranked time options by default. You describe the meeting the way you'd say it out loud, and the assistant turns that into bookable slots instead of a manual availability sweep.

The query string carries the duration, the attendee, and the rough window all at once. Add `--yes` to auto-create the top suggestion, or `--max-options` to widen the list past the default 3. Picking the AI provider is a single flag.

```bash
# Natural-language request, returns ranked options
nylas calendar schedule ai \
  "30-minute meeting with john@example.com next Tuesday afternoon"

# Auto-book the top suggestion and pick the provider
nylas calendar schedule ai --yes --provider claude \
  "45-minute design review with design@company.com Thursday morning"
```

Pass `--privacy` to route the request through a local Ollama model instead of a hosted provider, so the meeting text never leaves your machine. The `--provider` flag accepts ollama, claude, openai, or groq, so you can match the model to the task. The assistant resolves “next Tuesday afternoon” against the requester's timezone and the attendee's, so a slot that reads as 2:00 PM locally is the same instant on both calendars. Adding `--timezone` overrides the auto-detected zone when you book on someone else's behalf.

## How do I protect focus time automatically?

The `nylas calendar ai focus-time` command studies your calendar history, finds your peak productivity windows, and blocks deep-work sessions on the calendar so meetings can't fill them. The default target is 14 focus hours per week, and the assistant places the blocks where your accept-rate data says you work best.

Run it with `--analyze` first to see the pattern it found, then `--create` to write the blocks. Turning on `--auto-decline` sends a decline to any invite that lands inside a focus block, while `--allow-override` (on by default) lets genuinely urgent meetings through.

```bash
# See where your focus windows are before blocking anything
nylas calendar ai focus-time --analyze

# Create the blocks and auto-decline conflicting invites
nylas calendar ai focus-time --enable --create \
  --target-hours 16 --auto-decline
```

Raising `--target-hours` from the default 14 to 16 reserves two extra hours of protected time each week. The blocks are real calendar events, so colleagues see you as busy when they check availability. Because the placement comes from your own accept-and-decline history rather than a fixed template, the assistant puts morning blocks on the days you historically protect mornings and shifts them later on the days you don't. Re-running `--analyze` after a few weeks shows whether the pattern has drifted enough to rebuild the blocks.

## How do I catch scheduling conflicts before they land?

The `nylas calendar ai conflicts check` command tests a proposed meeting against your existing schedule before you send the invite. It separates hard conflicts (overlapping meetings) from soft ones (back-to-back stacking, focus-time interruptions, meeting overload) and scores alternative times so you pick the least disruptive slot.

Supply the title, an RFC 3339 start time, and a duration in minutes; the default duration is 60. Add `--auto-resolve` to have the assistant move the meeting to the best-scoring alternative without a second command.

```bash
# Check a proposed meeting for hard and soft conflicts
nylas calendar ai conflicts check \
  --title "Product Review" \
  --start "2026-06-16T14:00:00Z" \
  --duration 60 \
  --participants team@company.com

# Let the assistant pick the best alternative automatically
nylas calendar ai conflicts check \
  --title "Team Sync" --start "2026-06-17T10:00:00Z" \
  --duration 30 --auto-resolve
```

A back-to-back stack is a soft conflict the assistant flags even when no two events literally overlap, because zero buffer between meetings is a known productivity drain. The score lets you compare a 9:00 slot against a 2:00 slot on the same metric, so the alternative it recommends isn't just the next open gap but the one that disturbs your day least. Supply an explicit `--end` in RFC 3339 when the meeting length isn't a round number of minutes; otherwise the 60-minute default applies and the duration flag drives the slot.

## How do I pull meeting context out of an email thread?

The `nylas calendar ai analyze-thread` command reads an email thread and extracts the meeting buried inside it: the primary purpose, the action items, who is required versus optional, a suggested duration, and a recommended time. One `--thread` ID turns a 20-message back-and-forth into a structured meeting brief.

Add `--agenda` to auto-generate an agenda from the discussion, `--time` to include suggested slots, and `--create-meeting` to book the event straight from the analysis. Grab the thread ID from `nylas email threads`.

```bash
# Turn a thread into a meeting brief with an agenda and time options
nylas calendar ai analyze-thread \
  --thread thread_abc123 --agenda --time

# Analyze and create the meeting in one step
nylas calendar ai analyze-thread \
  --thread thread_abc123 --create-meeting --provider claude
```

The priority level comes from the tone of the thread, so a tense escalation surfaces as high priority while a casual check-in does not. That signal feeds the duration suggestion, since urgent threads tend to warrant a longer block than routine ones.

## How do I chain it into one assistant script?

The full assistant ties the four commands together: read the thread for context, then run the suggested time through a conflict check with `--auto-resolve`, which reschedules into the best open slot when an overlap exists rather than failing. The script below uses `--json` on each step so the output is machine-readable.

```bash
#!/usr/bin/env bash
set -euo pipefail
THREAD="thread_abc123"
TEAM="team@company.com"

# 1. Extract meeting context and a suggested time from the thread
BRIEF=$(nylas calendar ai analyze-thread --thread "$THREAD" --time --json)
TITLE=$(echo "$BRIEF" | jq -r '.title // "Follow-up meeting"')

# 2. Check the proposed slot for conflicts before booking
nylas calendar ai conflicts check \
  --title "$TITLE" \
  --start "2026-06-18T15:00:00Z" \
  --duration 30 \
  --participants "$TEAM" --auto-resolve

# 3. Re-protect focus time after the new booking
nylas calendar ai focus-time --enable --create --target-hours 14
```

Run the assistant on a daily cron and it keeps focus blocks fresh as new meetings land. Because `--auto-resolve` moves a conflicted meeting to the best-scoring alternative, the script books a usable slot in one pass instead of failing and waiting for input.

## Next steps

- [Automate meeting notes](https://cli.nylas.com/guides/automate-meeting-notes) — capture and route notes once the assistant books the meeting
- [Find a meeting time](https://cli.nylas.com/guides/find-meeting-time-cli) — the availability sweep behind natural-language scheduling
- [Detect calendar conflicts](https://cli.nylas.com/guides/detect-calendar-conflicts-cli) — the manual conflict check the AI layer builds on
- [Manage virtual calendars](https://cli.nylas.com/guides/manage-virtual-calendars-cli) — give the assistant a dedicated calendar to write blocks to
- [Set calendar working hours](https://cli.nylas.com/guides/set-calendar-working-hours-cli) — bound the windows focus-time and scheduling consider
- [Command reference](https://cli.nylas.com/docs/commands) — every flag, subcommand, and example
- [RFC 3339 — date and time format](https://datatracker.ietf.org/doc/html/rfc3339) — the timestamp format the conflict checker expects
- [Google Calendar API: freebusy.query](https://developers.google.com/calendar/api/v3/reference/freebusy/query) — the free/busy lookup behind Google availability
- [Microsoft Graph: getSchedule](https://learn.microsoft.com/en-us/graph/api/calendar-getschedule) — the equivalent availability call for Outlook and Microsoft 365
- [Ollama](https://ollama.com/) — the local LLM runtime the --privacy flag routes through
