Skip to main content
This guide will take you from installation to your first successful morning routine execution.

Prerequisites

Before starting, ensure you have:
Python 3.9 or higher installed
A Google account with Calendar access
Git installed (if cloning the repository)
If you haven’t installed the project yet, see the installation guide.

Step 1: Set up environment file

1

Create the secrets directory

mkdir -p resources/secrets
2

Copy the example environment file

cp .env.example resources/secrets/.env
3

Open the .env file in your editor

The file contains placeholders for all configuration values:
# Google OAuth credentials (required)
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REFRESH_TOKEN=  # Generated by setup_oauth.py

# Optional: Asana integration
ASANA_ACCESS_TOKEN=
ASANA_WORKSPACE_GID=
ASANA_PROJECT_GID=
ASANA_USER_NAME=

# Optional: Calendar selection
CALENDAR_NAME=
Never commit the .env file to version control. It’s already in .gitignore to prevent accidental exposure of credentials.

Step 2: Get Google OAuth credentials

1

Create a Google Cloud project

  1. Go to Google Cloud Console
  2. Click Create Project
  3. Enter a project name (e.g., “Morning Brain Starter”)
  4. Click Create
2

Enable required APIs

Enable these APIs in your project:
  • Google Calendar API (required)
  • Gmail API (optional, for email sync)
  • Google Docs API (optional, for transcription import)
  • Google Meet API (optional, for automatic transcription activation)
Navigate to APIs & Services → Library and search for each API.
3

Create OAuth 2.0 credentials

  1. Go to APIs & Services → Credentials
  2. Click Create Credentials → OAuth client ID
  3. Configure consent screen if prompted
  4. Select Desktop app as application type
  5. Enter a name (e.g., “Morning Routine Desktop”)
  6. Click Create
  7. Copy the Client ID and Client Secret
4

Add credentials to .env

Paste the Client ID and Client Secret into your resources/secrets/.env file:
GOOGLE_CLIENT_ID=123456789-abcdefg.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-your-secret-here
The refresh token will be generated automatically in the next step. You don’t need to create it manually.

Step 3: Run OAuth setup

The setup_oauth.py script handles the OAuth flow and generates your refresh token.
1

Run the setup script

python3 scripts/setup_oauth.py
Or if you’re using the virtual environment:
.venv/bin/python scripts/setup_oauth.py
2

Authorize in your browser

  1. A browser window will open automatically
  2. Sign in with your Google account
  3. Review the permissions requested
  4. Click Allow
The script requests these scopes:
  • calendar.readonly - View your calendar events
  • calendar.events - Modify events (for Meet links and responses)
  • gmail.readonly - Read your email (optional)
  • documents.readonly - Read Google Docs (for transcriptions)
  • meetings.space.settings - Control Meet settings (for auto-transcription)
3

Verify token generation

After authorization, you should see:
✅ OAuth setup complete!
Refresh token saved to resources/secrets/.env
Your .env file now contains the GOOGLE_REFRESH_TOKEN.

Step 4: Run your first morning routine

1

Execute the main command

python3 run_morning.py
Or with the virtual environment:
.venv/bin/python run_morning.py
2

Review the output

The routine executes 7 steps:
  1. Calendar sync - Today’s events + recent meetings
  2. Asana sync - Move yesterday’s incomplete tasks to today (if configured)
  3. Asana list - Show today’s tasks in priority order (if configured)
  4. Email sync - Fetch recent emails for context (if configured)
  5. Transcription import - Download meeting transcripts from yesterday
  6. Completed tasks - Add finished tasks to client bitácoras (if configured)
  7. Bitácora generation - Update client meeting logs

Example output

=== Morning routine ===

[Paso 1] Calendario (hoy + Meet + transcripciones)
  CLI: .venv/bin/python scripts/calendar_lite.py --today --add-meet --add-meet-my-events-only --add-transcription-reminder

📅 Today's events:
- 10:00 AM - Team Standup (acme)
- 2:00 PM - Client Review - Rocinante Project

📅 Recent events (last 7 days):
- Mar 2 - Weekly Planning
- Mar 1 - Tycho Contract Negotiation

[Paso 2] Asana (mover tareas de ayer a hoy)
  CLI: .venv/bin/python scripts/asana_lite.py --move-yesterday-to-today

✅ Moved 3 tasks from yesterday to today

[Paso 3] Asana (listar tareas de hoy)
  CLI: .venv/bin/python scripts/asana_lite.py

📋 Today's tasks (5):
1. [acme] Review contract renewal
2. [acme] Update technical documentation
3. [rocinante] Deploy hotfix to production
4. [tycho] Finalize Q1 roadmap
5. [Internal] Expense reports

[Paso 4-7] Email, transcriptions, and bitácoras...
Steps 2, 3, and 6 are skipped automatically if Asana is not configured. The routine works with just Google Calendar.

What happens during the routine?

  • Fetches today’s calendar events
  • Retrieves recent events (last 7 days by default)
  • Adds Google Meet links to events without them
  • Enables transcription on Meet events (or adds reminder)
  • Matches events to clients based on config/clients.yaml
  • Moves incomplete tasks from yesterday to today’s section
  • Lists today’s tasks sorted by day-of-week priority
  • Uses config/asana_order.yaml for client prioritization
  • Fetches recent emails from configured Gmail labels
  • Provides context for client communications
  • Can use demo mode with fake emails
  • Searches for Google Docs transcriptions from yesterday
  • Imports transcripts and associates with calendar events
  • Stores in context/clients/[client]/projects/[project]/meetings/
  • Finds tasks completed yesterday
  • Appends to relevant client bitácoras
  • Helps track what was accomplished per client
  • Updates context/clients/[client]/bitacora.md files
  • Adds meeting summaries in reverse chronological order
  • Creates new client directories if needed

Running individual steps

You can run any step independently using the CLI commands shown in the output:
# Just calendar
python3 scripts/calendar_lite.py --today

# Just Asana tasks
python3 scripts/asana_lite.py

# Just email sync
python3 scripts/email_lite.py

# Or run a specific step from the main routine
python3 run_morning.py --step 1
See the Commands reference for all available options.

Next steps

Configure clients

Set up client bitácoras and project matching

Add Asana integration

Connect Asana for task management

Enable Gmail sync

Sync emails for additional context

Explore commands

Learn about individual CLI commands

Troubleshooting

The script prints a URL you can copy and paste manually:
Visit this URL to authorize: https://accounts.google.com/o/oauth2/auth?...
Ensure your OAuth credentials have the correct scopes. Re-run:
python3 scripts/setup_oauth.py --regenerate
  • Check that CALENDAR_NAME matches your calendar exactly (case-sensitive)
  • Verify the calendar has events in the specified date range
  • Try: python3 scripts/calendar_lite.py --which-calendar to see which calendar is active
Ensure you’ve installed dependencies:
pip install -r requirements.txt
For more issues, see the troubleshooting guide.

Build docs developers (and LLMs) love