Repository Management

Connect GitHub or GitLab repositories so the bot can browse code, edit dbt models, and open pull requests on your behalf.


Connecting a Repository

  1. Go to Admin → Repositories
  2. Click Add Repository
  3. Choose the provider (GitHub or GitLab)
  4. Authenticate via OAuth or paste a personal access token
  5. Select the repository from the list
  6. Set the type: dbt, docs, or custom
  7. Enable read and/or write access

Authentication Methods

GitHub OAuth

Requires a GitHub OAuth app registered in your organization. Set GITHUB_CLIENT_ID andGITHUB_CLIENT_SECRET in .env. The redirect URI should be:

https://your-domain.com/admin/api/repositories/oauth/github/callback

GitLab OAuth

Register an application in GitLab (Settings → Applications). Set GITLAB_CLIENT_ID andGITLAB_CLIENT_SECRET in .env. For self-managed GitLab, also set GITLAB_BASE_URL.

Personal Access Token

For GitLab, you can alternatively use a PAT. Click Connect with Token in the repositories page and paste the token. Note that PATs can expire.

Repository Types

TypePurpose
dbtdbt project — used by dbt tools for model editing
docsDocumentation repository
customGeneric code repository

Read vs Write Access

  • Read-enabled — the bot can browse files and understand your codebase
  • Write-enabled — the bot can create branches, commit changes, and open PRs

For dbt model editing, at least one repository must be write-enabled.

How It Works

  • Each user gets a separate working directory (git clone) to prevent conflicts
  • The working directory auto-syncs (git pull) when accessed
  • OAuth tokens are encrypted in the database using REPO_ENCRYPTION_KEY
  • Inactive working directories are automatically cleaned up

Important Notes

  • Set REPO_ENCRYPTION_KEY in .env — without it, OAuth tokens are lost on restart
  • GitHub OAuth requests full repo scope for read and write access
  • All users share the same instance-wide OAuth connection