> For the complete documentation index, see [llms.txt](https://docs.bito.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bito.ai/ai-architect/installation/install-ai-architect-self-hosted/local-git-provider-pre-cloned-repositories-setup-guide.md).

# Local Git Provider (Pre-Cloned Repositories) — Setup Guide

[Bito's AI Architect](/ai-architect/overview.md) can index repositories **without any git credentials**. Instead of connecting to GitHub, GitLab, Bitbucket, or Azure DevOps, you clone your repositories yourself onto the host that runs AI Architect, and copy them in with a single command:

```shellscript
bitoarch import-repos /srv/bito-sources
```

AI Architect stores **no token, no app key, no username, and no git domain** for this provider, and nothing inside the platform ever contacts your git server — every remote is stripped from the copy it keeps.

{% hint style="info" %}
**Use this when:** your git server is unreachable from the AI Architect host (air-gapped or segmented network), your policy does not allow issuing a read token, your git server is not one of the four supported providers, or you want to index a source tree that is not in git at all.
{% endhint %}

Supported on **Docker Compose**, **Standalone**, and **Kubernetes** (single- or multi-node — no extra volume mounts, no `hostPath`, no shared `ReadWriteMany` storage).

***

### Prerequisites

* You can place repository clones on the machine that runs `bitoarch`.
* The clones live under **one parent directory**, with each repository as an **immediate subdirectory** of it.
* Each repository directory name uses only `a-z A-Z 0-9 _ . -` (these become the repository namespace).
* Every file in every repository is **readable by the user running `bitoarch`**.
* Each repository is at or under `CIS_REPO_SIZE_LIMIT` (default **5 GB**).
* The platform is **running** when you import (`bitoarch status`).

**Expected layout:**

```
/srv/bito-sources/
├── backend-api/      ← a git clone
├── web-frontend/     ← a git clone
└── shared-lib/       ← a git clone
```

This imports as three repositories: `local/backend-api`, `local/web-frontend`, and `local/shared-lib`.

***

### 1. Install with the local provider

#### Interactive install

At the git provider prompt, choose **5**:

```
Select Git provider (1) GitLab  (2) GitHub  (3) Bitbucket  (4) Azure DevOps  (5) Local (pre-cloned repos)  [1-5]: 5
```

The installer then **skips** the enterprise-domain question, the PAT/GitHub App choice, and the access-token prompt, and confirms:

```
No git credentials needed. After installation, import your pre-cloned repositories with: bitoarch import-repos <path>
```

Installation finishes with an empty repository list. You add repositories in step 2.

#### Non-interactive install

Pre-seed `~/.bitoarch/install.yaml` — omit `access_token` entirely:

```yaml
bito_api_key: "<your-bito-api-key>"
git:
  provider: local
```

`local` is the only provider for which the installer does not require a git access token.

#### Switching an existing install to local

```shellscript
bitoarch update-git-creds     # choose (5) Local (pre-cloned repos)
```

Any previously stored PAT or GitHub App key is cleared.

{% hint style="warning" %}
Repositories you configured under the **previous** provider are not local imports. Their leftover clones will fail to index until you re-import them. Remove the stale namespaces first (`bitoarch remove-repo <namespace>`), then import as below.
{% endhint %}

***

### 2. Import your repositories

```shellscript
bitoarch import-repos /srv/bito-sources
bitoarch index-repos
```

`import-repos` scans the immediate subdirectories of the path and, for each repository:

1. Checks the directory name is namespace-safe and the tree is fully readable.
2. Checks the size against `CIS_REPO_SIZE_LIMIT` *before* copying anything.
3. Registers it as namespace **`local/<directory-name>`**.
4. Copies it onto the platform's shared clone volume.
5. **Removes every git remote** from the copy, so nothing in the platform can reach your git server.

The copy is atomic: a repository is only swapped into place once it has transferred completely. A failure leaves any previously imported copy untouched.

It finishes with a summary:

```
✓ Import complete: 3 imported, 0 skipped, 0 failed (3 registered)
ℹ Run bitoarch index-repos to index the imported repositories
```

Check progress with `bitoarch index-status`, and confirm the result with `bitoarch index-repo-list` or `bitoarch repo-info backend-api`.

***

### 3. Keep repositories up to date

There is no webhook and no polling — **you** decide when AI Architect sees new commits. Pull in your source clones, then re-run the same command:

```shellscript
cd /srv/bito-sources/backend-api && git pull
bitoarch import-repos /srv/bito-sources
bitoarch index-repos
```

Re-running is the update flow and is safe to repeat:

* A repository whose `HEAD` already matches the imported copy is **skipped** (no copy, no re-index).
* A repository with new commits is re-synced and indexed **incrementally** on the next run.
* A **new** subdirectory is imported and registered automatically.

To automate it, pull and import from cron (or any scheduler) on the AI Architect host:

```shellscript
# Every night at 02:00 — refresh sources, import, index.
0 2 * * * cd /srv/bito-sources && for r in */; do git -C "$r" pull -q; done && bitoarch import-repos /srv/bito-sources && bitoarch index-repos
```

***

### 4. Source trees that are not git repositories

By default a subdirectory without a `.git` directory is skipped:

```
⚠ Skipping 'legacy-app': not a git clone (use --allow-non-git to import plain source trees)
```

To include plain source trees:

```shellscript
bitoarch import-repos /srv/bito-sources --allow-non-git
```

AI Architect synthesizes a git history inside its own copy so the indexing pipeline works normally. Your source directory is never modified. Two caveats:

* Because there is no real commit history, these repositories are **always fully re-indexed** when their contents change (never incrementally).
* An unchanged tree still keeps its identity across re-imports, so re-running the command on unchanged sources does not trigger needless re-indexing.

***

### 5. Removing a repository

```shellscript
bitoarch remove-repo local/backend-api      # deregister; index data stays until purged
bitoarch remove-index local/backend-api     # deregister + purge index data
```

`remove-repo` deliberately **keeps the imported copy** on the platform's volume so a later re-add is fast. Reclaim that disk space yourself if you do not plan to re-add the repository.

***

### What differs from a token-based provider

<table data-search="false"><thead><tr><th>Area</th><th>With local</th></tr></thead><tbody><tr><td>Credentials</td><td>None. Nothing is stored; no token to rotate or expire</td></tr><tr><td>Adding repositories</td><td><code>bitoarch import-repos &#x3C;path></code> — <strong>not</strong> <code>add-repo</code> / <code>add-repos</code> / a repos YAML</td></tr><tr><td><code>bitoarch fetch-repo-list</code></td><td>Not available — there is no remote to enumerate</td></tr><tr><td>Git Insights</td><td>Not available — it analyzes remote history and PRs. Disabled automatically at setup</td></tr><tr><td>New commits</td><td>Picked up only when you re-run <code>import-repos</code>. No webhooks, no polling</td></tr><tr><td>Namespaces</td><td>Always <code>local/&#x3C;directory-name></code> (two segments)</td></tr><tr><td>Network access</td><td>The platform never contacts your git server. All remotes are stripped from the copy</td></tr></tbody></table>

***

### Troubleshooting

<table data-search="false"><thead><tr><th>Message / symptom</th><th>What to do</th></tr></thead><tbody><tr><td><code>import-repos requires the local git provider (current: github)</code></td><td>This install uses a token-based provider. Switch with <code>bitoarch update-git-creds</code> → option 5</td></tr><tr><td><code>No running ai-architect-manager pod found</code> / a <code>docker exec</code> failure</td><td>The platform is not running. Start it with <code>bitoarch start</code>, then re-import</td></tr><tr><td><code>Cannot import 'X': not readable by &#x3C;user></code> / <code>not fully readable</code></td><td>Fix the source permissions, or re-run as a user that can read every file in that repository. The repository is skipped, not partially copied</td></tr><tr><td><code>Skipping 'X': directory name has characters not allowed in a repo namespace</code></td><td>Rename the directory using only <code>a-z A-Z 0-9 _ . -</code></td></tr><tr><td><code>Skipping 'X': not a git clone</code></td><td>Add <code>--allow-non-git</code>, or make the directory a real clone</td></tr><tr><td><code>Skipping 'X': size ... exceeds CIS_REPO_SIZE_LIMIT</code></td><td>Trim the repository, or raise <code>CIS_REPO_SIZE_LIMIT</code> in <code>.env-bitoarch</code> and restart</td></tr><tr><td><code>Could not register local/X -- is cis-config reachable?</code></td><td>Check <code>bitoarch status</code>. Once services are healthy, re-run <code>import-repos</code> — it heals partial runs</td></tr><tr><td><code>'X' is already imported at &#x3C;sha> (skipped)</code></td><td>Expected. The imported copy already matches your source <code>HEAD</code>. Pull new commits first</td></tr><tr><td>Imported, but nothing appears in results</td><td>Indexing has not run yet. <code>bitoarch index-repos</code>, then watch <code>bitoarch index-status</code></td></tr><tr><td><code>fetch-repo-list is not available for the local git provider</code></td><td>Expected. Use <code>bitoarch import-repos</code> instead</td></tr></tbody></table>

Full diagnostics: `bitoarch diagnose` produces a support bundle for <support@bito.ai>.

***

### Related environment variables

| Variable              | Meaning                                                                                          |
| --------------------- | ------------------------------------------------------------------------------------------------ |
| `GIT_PROVIDER`        | Set to `local` for this mode                                                                     |
| `CIS_CLONE_DIR`       | Where imported copies live inside the platform (default `/opt/bito/ai-architect/data/clone-dir`) |
| `CIS_REPO_SIZE_LIMIT` | Max indexable size per repository, in bytes (default `5368709120` = 5 GB)                        |

***

### See also

* [CLI Reference](/ai-architect/installation/install-ai-architect-self-hosted/available-commands.md) — all `bitoarch` commands
* [Standalone Setup Guide](/ai-architect/installation/install-ai-architect-self-hosted/standalone-mode-for-individuals.md)
* [Enterprise Setup Guide](/ai-architect/installation/install-ai-architect-self-hosted.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.bito.ai/ai-architect/installation/install-ai-architect-self-hosted/local-git-provider-pre-cloned-repositories-setup-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
