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

# External data sources

> Connect Google Drive, Notion, Dropbox, OneDrive, Box, SharePoint, Confluence, and GitHub through the SiteGPT CLI.

External data-source commands connect a chatbot to third-party systems and ingest selected documents into SiteGPT knowledge.

```bash theme={null}
sitegpt knowledge sources --help
```

`knowledge connections` is accepted as an alias for `knowledge sources`.

## Supported connectors

```text theme={null}
NOTION, GOOGLE_DRIVE, DROPBOX, ONEDRIVE, BOX, SHAREPOINT, CONFLUENCE, GITHUB
```

## Source lifecycle

<Steps>
  <Step title="Create a source connection">
    ```bash theme={null}
    sitegpt knowledge sources create --chatbot <chatbot-id> --connector GOOGLE_DRIVE --name "Drive docs"
    ```
  </Step>

  <Step title="Authorize or select files">
    OAuth/picker connectors return an authorization URL. Open it, approve access, and select files when the provider shows a picker.
  </Step>

  <Step title="List selected source documents">
    ```bash theme={null}
    sitegpt knowledge sources documents --chatbot <chatbot-id> <source-id>
    ```
  </Step>

  <Step title="Ingest selected documents">
    ```bash theme={null}
    sitegpt knowledge sources ingest --chatbot <chatbot-id> <source-id>
    ```
  </Step>
</Steps>

## List sources

```bash theme={null}
sitegpt knowledge sources list --chatbot <chatbot-id>
sitegpt knowledge sources list --chatbot <chatbot-id> --connector GOOGLE_DRIVE
sitegpt knowledge sources list --chatbot <chatbot-id> --status ACTIVE
sitegpt knowledge sources list --chatbot <chatbot-id> --json
```

Status values:

```text theme={null}
PENDING, ACTIVE, FAILED, REVOKED
```

## Create sources

OAuth/picker sources:

```bash theme={null}
sitegpt knowledge sources create --chatbot <chatbot-id> --connector GOOGLE_DRIVE --name "Drive docs"
sitegpt knowledge sources create --chatbot <chatbot-id> --connector NOTION --name "Notion docs"
sitegpt knowledge sources create --chatbot <chatbot-id> --connector DROPBOX --name "Dropbox docs"
sitegpt knowledge sources create --chatbot <chatbot-id> --connector ONEDRIVE --name "OneDrive docs"
sitegpt knowledge sources create --chatbot <chatbot-id> --connector BOX --name "Box docs"
sitegpt knowledge sources create --chatbot <chatbot-id> --connector SHAREPOINT --name "SharePoint docs"
```

Confluence:

```bash theme={null}
sitegpt knowledge sources create \
  --chatbot <chatbot-id> \
  --connector CONFLUENCE \
  --domain site.atlassian.net \
  --name "Confluence docs"
```

GitHub:

```bash theme={null}
sitegpt knowledge sources create \
  --chatbot <chatbot-id> \
  --connector GITHUB \
  --name "Docs repo" \
  --owner <owner> \
  --api-key <github-token>
```

Create options:

| Option                        | Description                                        |
| ----------------------------- | -------------------------------------------------- |
| `--connector <connector>`     | Required connector type.                           |
| `--name <name>`               | Friendly connection name.                          |
| `--owner <owner>`             | GitHub owner. Required for GitHub create.          |
| `--api-key <token>`           | GitHub personal access token.                      |
| `--domain <domain>`           | Confluence domain. Required for Confluence create. |
| `--label <label>`             | Optional provider-visible label metadata.          |
| `--client-redirect-url <url>` | Optional URL to redirect to after OAuth/picker.    |
| `--metadata <json>`           | Extra metadata object.                             |

`sources add` is an alias for `sources create`.

## Get and update a source

```bash theme={null}
sitegpt knowledge sources get --chatbot <chatbot-id> <source-id>
sitegpt knowledge sources update --chatbot <chatbot-id> <source-id> --name "New name"
sitegpt knowledge sources update --chatbot <chatbot-id> <source-id> --api-key <new-github-token>
sitegpt knowledge sources update --chatbot <chatbot-id> <source-id> --client-redirect-url https://example.com/done
sitegpt knowledge sources update --chatbot <chatbot-id> <source-id> --clear-client-redirect-url
```

## Authorize or select more files

Use `authorize` for first-time OAuth approval, reauthorization, or selecting more files for an existing picker connection:

```bash theme={null}
sitegpt knowledge sources authorize --chatbot <chatbot-id> <source-id>
sitegpt knowledge sources authorize --chatbot <chatbot-id> <source-id> --client-redirect-url https://example.com/complete
```

Aliases:

* `reauthorize`
* `select-files`
* `picker`

<Tip>
  To add more files to an existing Google Drive, Dropbox, OneDrive, Box, or SharePoint connection, run `authorize` for the existing source. Do not create a duplicate connection unless you want a separate connection.
</Tip>

## List source documents

```bash theme={null}
sitegpt knowledge sources documents --chatbot <chatbot-id> <source-id>
sitegpt knowledge sources documents --chatbot <chatbot-id> <source-id> --limit 100
sitegpt knowledge sources documents --chatbot <chatbot-id> <source-id> --cursor <cursor>
```

Alias:

```bash theme={null}
sitegpt knowledge sources docs --chatbot <chatbot-id> <source-id>
```

## Ingest source documents

```bash theme={null}
sitegpt knowledge sources ingest --chatbot <chatbot-id> <source-id>
sitegpt knowledge sources ingest --chatbot <chatbot-id> <source-id> --sync WEEKLY
```

Ingest options:

| Option               | Description                                                                       |
| -------------------- | --------------------------------------------------------------------------------- |
| `--sync <frequency>` | Auto-sync ingested source content. Values: `NEVER`, `DAILY`, `WEEKLY`, `MONTHLY`. |
| `--external-id <id>` | Ingest a selected external document ID. Repeatable.                               |
| `--document <id>`    | Alias-style document selector for external IDs. Repeatable.                       |
| `--page <id>`        | Confluence/Notion page selector. Repeatable.                                      |
| `--metadata <json>`  | Extra metadata object.                                                            |

## GitHub helpers

List repositories:

```bash theme={null}
sitegpt knowledge sources github repos --chatbot <chatbot-id> --source <source-id>
sitegpt knowledge sources github repositories --chatbot <chatbot-id> --source <source-id> --page 1 --per-page 100
```

List files:

```bash theme={null}
sitegpt knowledge sources github files \
  --chatbot <chatbot-id> \
  --source <source-id> \
  --owner <owner> \
  --repo <repo> \
  --branch <branch>
```

Ingest repository content:

```bash theme={null}
sitegpt knowledge sources ingest \
  --chatbot <chatbot-id> \
  <source-id> \
  --repo <repo> \
  --branch <branch> \
  --pattern "docs/**"
```

`--pattern` is repeatable.

## Confluence helpers

List spaces:

```bash theme={null}
sitegpt knowledge sources confluence spaces --chatbot <chatbot-id> --source <source-id>
sitegpt knowledge sources confluence spaces --chatbot <chatbot-id> --source <source-id> --limit 50
```

List pages in a space:

```bash theme={null}
sitegpt knowledge sources confluence pages \
  --chatbot <chatbot-id> \
  --source <source-id> \
  --space <space-id>
```

Ingest pages:

```bash theme={null}
sitegpt knowledge sources ingest --chatbot <chatbot-id> <source-id> --page <page-id>
```

## Notion flow difference

Notion selection happens inside Notion OAuth. After authorization, selected pages/databases are discovered during ingest.

That means this can be normal for Notion:

```bash theme={null}
sitegpt knowledge sources documents --chatbot <chatbot-id> <notion-source-id>
# No documents shown yet
sitegpt knowledge sources ingest --chatbot <chatbot-id> <notion-source-id>
```

If no pages were selected during OAuth, rerun authorization:

```bash theme={null}
sitegpt knowledge sources authorize --chatbot <chatbot-id> <notion-source-id>
```

## Revoke a source

```bash theme={null}
sitegpt knowledge sources revoke --chatbot <chatbot-id> <source-id> --yes
```

Alias:

```bash theme={null}
sitegpt knowledge sources delete --chatbot <chatbot-id> <source-id> --yes
```

Revoking disconnects the source. It does not automatically delete already ingested knowledge documents.

## Full reference

* [External data sources](/cli/command-reference#external-data-sources)
* [GitHub source helpers](/cli/command-reference#github-source-helpers)
* [Confluence source helpers](/cli/command-reference#confluence-source-helpers)
