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

# Centralized Multi-Repository Setup

> Setup Simili Bot with centralized control across multiple repositories (Pattern B)

# Centralized Multi-Repository Setup

Set up Simili Bot with a central control repository that processes issues across your entire organization. This is **Pattern B**, ideal for unified management.

## Prerequisites

1. Multiple GitHub repositories to manage.
2. Qdrant API Key & URL.
3. Gemini API Key.
4. Elevated GitHub Permissions (PAT or GitHub App).

***

## Setup steps

<Steps>
  <Step title="Create control repository">
    Create a new private repository (e.g., `simili-bot-control`) to host your master configuration and workflows.
  </Step>

  <Step title="Add master configuration">
    Create `.github/simili.yaml` in the control repo:

    ```yaml theme={null}
    qdrant:
      url: "https://your-cluster.qdrant.io:6333"
      api_key: "${QDRANT_API_KEY}"
      collection: "org-issues"

    defaults:
      cross_repo_search: true

    repositories:
      - org: "your-org"
        repo: "backend"
      - org: "your-org"
        repo: "frontend"
    ```
  </Step>

  <Step title="Configure authentication">
    Pattern B requires elevated permissions. Add a Personal Access Token (PAT) with `repo` scope to your control repo secrets as `GITHUB_TOKEN_PAT`.
  </Step>

  <Step title="Organization secrets">
    Add `QDRANT_URL`, `QDRANT_API_KEY`, and `GEMINI_API_KEY` to your organization-level secrets and grant access to the control repository.
  </Step>

  <Step title="Create workflow">
    Create `.github/workflows/simili-bot.yml` in the control repo:

    ```yaml theme={null}
    name: Simili Bot - Scheduled
    on:
      schedule:
        - cron: '*/5 * * * *'
      workflow_dispatch:

    jobs:
      process:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v3
          - uses: similigh/simili-bot@v0.2.0
            with:
              command: "process"
            env:
              GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN_PAT }}
              QDRANT_URL: ${{ secrets.QDRANT_URL }}
              QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }}
              GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
    ```
  </Step>

  <Step title="Submit & test">
    Go to the **Actions** tab in your control repo and manually trigger the workflow to ensure it can reach your target repositories.
  </Step>
</Steps>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="Permission denied error">
    Ensure your PAT has the `repo` scope and is correctly added as a secret in the control repository.
  </Accordion>

  <Accordion title="Issues not being processed">
    Verify that each target repository is correctly listed in the `repositories` section of your master `simili.yaml`.
  </Accordion>
</AccordionGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Permission guide" icon="lock" href="/configuration/permissions" />

  <Card title="Issue routing" icon="share-nodes" href="/guides/issue-routing" />
</CardGroup>
