> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ollim.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Google integration

> Connect Google Tasks, Calendar, and Gmail to ollim-bot after the quickstart.

You've completed the [quickstart](/getting-started/quickstart) and the bot is
running. The bot works without this, but Google Tasks, Calendar, and Gmail
integration adds proactive scheduling, email triage, and task management. If
that's why you're here, this is the next step.

<Tip>
  If you ran first-time setup, the bot may have already pointed you here. Setup detects your Google integration status — if credentials are saved but not authorized, it suggests `/google-auth`; if nothing is configured, it links to this page.
</Tip>

## Set up Google OAuth

Google Tasks, Calendar, and Gmail integration requires connecting your Google
account. You'll create a small project in Google Cloud Console (free, no
billing required) and link it to the bot.

<Steps>
  <Step titleSize="h3" title="Create a Google Cloud project">
    Go to the [Google Cloud Console](https://console.cloud.google.com/) and
    sign in with the Google account you want the bot to access.

    1. Click the project dropdown at the top of the page
    2. Click **New Project**
    3. Enter a name (e.g. `ollim-bot`) and click **Create**
    4. After creation, click the project dropdown again, find your new project
       in the list, and double-click it to switch to it — the dropdown at the
       top should now show your new project name

    <Note>
      Google Cloud Console is free for this use case — you will not be charged.
    </Note>

    <Warning>
      All following steps must be done inside this project. If the project name
      at the top of the page doesn't match, click the dropdown and switch to it
      before continuing.
    </Warning>
  </Step>

  <Step titleSize="h3" title="Configure the consent screen">
    Open the navigation menu (the three-line icon in the top-left corner) and
    click **APIs & Services**. In the left sidebar, click **OAuth consent
    screen**. This opens the **Google Auth Platform** section.

    1. Click **Get started**
    2. Enter an app name (e.g. `ollim-bot`) and select your email from the
       **User support email** dropdown, then click **Next**
    3. Under **Audience**, select **External** and click **Next**
    4. Enter your email address in the **Email addresses** field and press
       **Enter** to confirm it, then click **Next**
    5. Check the box to agree to the Google API Services User Data Policy,
       click **Continue**, then click **Create**

    You should see "OAuth configuration created!" at the bottom of the page.
  </Step>

  <Step titleSize="h3" title="Add yourself as a test user">
    In the **Google Auth Platform** sidebar on the left, click **Audience**.

    1. Scroll down to the **Test users** section
    2. Click **Add users**
    3. Enter your Google email address and press **Enter**
    4. Click **Save**

    <Warning>
      If you skip adding yourself as a test user, the "Connect with /google-auth"
      step will fail with "Access blocked: This app's request is invalid."
    </Warning>
  </Step>

  <Step titleSize="h3" title="Enable APIs">
    Open the navigation menu (three-line icon, top-left) and click
    **APIs & Services**. In the left sidebar, click **Library**. Search for
    and enable each of these three APIs:

    | API to search for   | Used for                             |
    | ------------------- | ------------------------------------ |
    | Google Tasks API    | Managing your task lists             |
    | Google Calendar API | Reading and creating calendar events |
    | Gmail API           | Reading emails (read-only)           |

    **Verify:** After enabling all three, click **Enabled APIs & services** in
    the left sidebar. You should see all three listed.
  </Step>

  <Step titleSize="h3" title="Create OAuth credentials">
    In the **APIs & Services** sidebar, click **Credentials**.

    1. Click **Create Credentials** at the top, then select **OAuth client ID**
    2. For **Application type**, select **Desktop app** (not "Web
       application")
    3. Give it a name (e.g. `ollim-bot`) and click **Create**
    4. In the popup that appears, click **Download JSON**

    A file named `client_secret_[...].json` downloads to your computer.

    <Warning>
      Download the JSON file **before** clicking **OK** — you won't be able to
      download it again after closing this dialog.
    </Warning>

    <Warning>
      The application type **must** be **Desktop app**. If you select "Web
      application", the downloaded file will have a `"web"` key instead of
      `"installed"`, and the bot will not be able to use it.
    </Warning>
  </Step>

  <Step titleSize="h3" title="Save the credentials file">
    Move the downloaded file to `~/.ollim-bot/state/credentials.json`. Open
    a terminal and run:

    <Tabs>
      <Tab title="Linux / macOS">
        ```bash theme={null}
        mkdir -p ~/.ollim-bot/state
        mv ~/Downloads/client_secret_*.json ~/.ollim-bot/state/credentials.json
        ```
      </Tab>

      <Tab title="Windows (PowerShell)">
        ```powershell theme={null}
        New-Item -ItemType Directory -Force -Path "$HOME\.ollim-bot\state"
        Move-Item "$HOME\Downloads\client_secret_*.json" "$HOME\.ollim-bot\state\credentials.json"
        ```
      </Tab>
    </Tabs>

    **Verify:** Check the file is in the right place:

    <Tabs>
      <Tab title="Linux / macOS">
        ```bash theme={null}
        cat ~/.ollim-bot/state/credentials.json
        ```
      </Tab>

      <Tab title="Windows (PowerShell)">
        ```powershell theme={null}
        Get-Content "$HOME\.ollim-bot\state\credentials.json"
        ```
      </Tab>
    </Tabs>

    You should see JSON starting with `{"installed": {`. If it starts with
    `{"web": {`, you selected the wrong application type in "Create OAuth
    credentials" — go back and create a new credential with **Desktop app**.
  </Step>

  <Step titleSize="h3" title="Connect with /google-auth">
    Open Discord and go to your DM with the bot (the bot must be running).
    Click the message box, type `/google-auth` — a slash command menu appears
    above the text box — select **google-auth** from the list and press
    **Enter**.

    The bot responds with a sign-in link. Click it — your browser opens a
    Google consent page. Select your Google account, click **Continue**
    through the permissions screens, and authentication completes
    automatically.

    When it works, the bot sends **"google connected."** in the DM.

    **Verify:** Ask the bot something like "list my tasks" or "what's on my
    calendar today?" to confirm the connection is working.

    <Note>
      **Running the bot on a different computer than your browser?** Open the
      sign-in link on any device, complete the consent flow, then copy the URL
      your browser redirected to (it starts with `http://127.0.0.1:`) and paste
      it back into the Discord DM. The auth flow has a 5-minute timeout.
    </Note>
  </Step>
</Steps>

If Google stops working (e.g. after a password change), the bot notices
automatically and asks you to run `/google-auth` again.

## Troubleshooting

<Accordion title="I don't see /google-auth in Discord">
  Slash commands only appear when the bot is online and has synced its commands
  with Discord. Check these in order:

  1. **Is the bot running?** Start it if it isn't — slash commands won't show up
     for an offline bot.
  2. **Are you in the right place?** Open a DM with the bot, not a server
     channel. Click the bot's name in the member list and click **Message**.
  3. **Did commands sync?** After the bot's first startup (or after being added
     to a new server), slash commands can take up to an hour to appear. Restart
     the bot and wait a few minutes.
  4. **Still nothing?** Try typing `/` in the message box — if no command menu
     appears at all, Discord may need a restart.
</Accordion>

<Accordion title="Timestamps are in the wrong timezone">
  ollim-bot auto-detects your system timezone. If timestamps are wrong, set it
  explicitly in the `.env` file in the folder where you cloned ollim-bot (the
  same folder where you run the bot):

  ```bash title=".env" theme={null}
  OLLIM_TIMEZONE=America/New_York
  ```

  Use a name from the
  [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
  — for example, `Europe/London`, `Asia/Tokyo`, or `US/Pacific`. This affects
  scheduling, Google Calendar, Gmail, session history, and the system prompt.
</Accordion>

## Next steps

<Columns cols={2}>
  <Card title="How ollim-bot works" icon="gears" href="/architecture/how-it-works">
    Understand the agent loop, session persistence, fork model, and context flow.
  </Card>

  <Card title="Conversations" icon="comments" href="/core-usage/conversations">
    Learn how DM conversations, context, and streaming work.
  </Card>

  <Card title="Configuration reference" icon="sliders" href="/configuration/reference">
    All environment variables, runtime settings, and their defaults.
  </Card>

  <Card title="Data directory" icon="folder-tree" href="/configuration/data-directory">
    Layout of \~/.ollim-bot/ — auto-tracked with git for versioned backups.
  </Card>
</Columns>
