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

# connect

> Connect a SaaS app (Gmail, Calendar, Drive, GitHub, Notion) through Pipedream, then sync it

```bash theme={null}
duckbrain connect gmail     # prints a one-time Connect link — open it, sign in, consent
duckbrain sync gmail        # then pull it into the lake
duckbrain connect           # no app: lists the connectable apps
```

App sources authenticate through **Pipedream Connect** (managed OAuth), so no API keys
touch this machine. `connect` mints a link; **you** open it once and consent. The agent
cannot complete the consent for you — it can only hand you the link.

After consenting, `duckbrain sync <app>` pulls the history in, and the app becomes a
first-class source like any other:

```bash theme={null}
duckbrain search "invoice" --source gmail --since 30d
```

## Prerequisites

Pipedream Connect credentials must be stored first — `PIPEDREAM_CLIENT_ID`,
`PIPEDREAM_CLIENT_SECRET`, `PIPEDREAM_PROJECT_ID`:

```bash theme={null}
duckbrain init --sources pipedream    # prompts (hidden) and stores them 0600
duckbrain secrets add PIPEDREAM_CLIENT_ID   # or one at a time
```

If they're missing, `connect` says so and tells you which keys to set rather than
guessing or failing silently.

## Apps without a Pipedream connector

Some sources have no managed OAuth app. Those route through the **broker**: `connect`
prints a hosted key-entry form instead, and the key is stored in Pipedream — never on
this machine. See the Pipedream source guide for wiring the broker.
