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

# Bootstrap from Codebase

This workflow covers **bulk context extraction** from your entire codebase. Your coding agent reads through your project and curates knowledge in multiple passes, automatically organizing everything into the context tree.

For onboarding individual files (1-3 documents), see [Onboard Existing Context](/common-workflows/onboard-context).

## Prerequisites

* ByteRover CLI installed
* Project initialized (run `brv` to start the REPL and initialize your project)
* A codebase with existing patterns, conventions, or documentation worth capturing

## Step 1: Curate from Your Codebase

<Tabs>
  <Tab title="Via Coding Agent">
    **Copy this prompt and paste it into your coding agent's chat (e.g., Cursor, Claude Code, etc.):**

    ```markdown theme={null}
    > curate all important context from this codebase using brv curate; focus on:

    1. Code Style and Quality
    2. Styling and Design
    3. Naming Conventions
    4. Project Structure and Dependencies

    ByteRover should intelligently organize into appropriate domains and topics
    ```

    Your coding agent will read through your codebase and run `brv curate` multiple times to capture the knowledge. ByteRover automatically organizes everything into the context tree.
  </Tab>

  <Tab title="Commands">
    Curate from key documentation files using the `-f` flag:

    ```bash theme={null}
    brv curate "Project architecture and conventions" -f README.md -f ARCHITECTURE.md -f CONTRIBUTING.md
    ```

    Or curate from specific source files:

    ```bash theme={null}
    brv curate "API patterns and authentication flow" -f src/api/routes.ts -f src/auth/middleware.ts
    ```

    You can reference up to 5 files per curation. For larger codebases, run multiple curations:

    ```bash theme={null}
    brv curate "Database models and schema" -f prisma/schema.prisma -f src/models/user.ts
    brv curate "Testing patterns" -f tests/setup.ts -f tests/helpers.ts
    brv curate "Frontend component conventions" -f src/components/Button.tsx -f src/styles/theme.ts
    ```

    Or curate an entire directory using the `-d` flag:

    ```bash theme={null}
    brv curate -d src/
    ```

    ByteRover packs the folder into a structured representation and analyzes all supported files (code, config, docs, PDFs, Office files). See [How Curation Works](/context-tree/curation-engine) for full details on folder packing.
  </Tab>

  <Tab title="Manual REPL">
    Curate from key documentation files using the `@` syntax:

    ```bash theme={null}
    # In the REPL:
    /curate "Project architecture and conventions" @README.md @ARCHITECTURE.md @CONTRIBUTING.md
    ```

    Or curate from specific source files:

    ```bash theme={null}
    # In the REPL:
    /curate "API patterns and authentication flow" @src/api/routes.ts @src/auth/middleware.ts
    ```

    You can reference up to 5 files per curation. For larger codebases, run multiple curations:

    ```bash theme={null}
    /curate "Database models and schema" @prisma/schema.prisma @src/models/user.ts
    /curate "Testing patterns" @tests/setup.ts @tests/helpers.ts
    /curate "Frontend component conventions" @src/components/Button.tsx @src/styles/theme.ts
    ```

    Or curate an entire directory using the `@` syntax with a trailing slash:

    ```bash theme={null}
    /curate @src/
    ```

    ByteRover packs the folder into a structured representation and analyzes all supported files (code, config, docs, PDFs, Office files). See [How Curation Works](/context-tree/curation-engine) for full details on folder packing.
  </Tab>
</Tabs>

## Step 2: Review Changes

Verify what was added:

<Tabs>
  <Tab title="Commands">
    ```bash theme={null}
    brv vc status
    ```
  </Tab>

  <Tab title="Manual REPL">
    ```bash theme={null}
    # In the REPL:
    /vc status
    ```
  </Tab>
</Tabs>

This shows your context tree changes (added, modified, and deleted files).
Your context is already stored locally and ready to query.

## Step 3: Query to Verify

Test that your context is retrievable.

<Tabs>
  <Tab title="Via Coding Agent">
    **Copy this prompt and paste it into your coding agent's chat:**

    ```markdown theme={null}
    > use brv query to retrieve context related to (your intention)
    ```

    Your coding agent will execute `brv query` with your query and return the relevant context.
  </Tab>

  <Tab title="Commands">
    ```bash theme={null}
    brv query "how is authentication implemented"
    ```
  </Tab>

  <Tab title="Manual REPL">
    Run the `/query` command directly:

    ```bash theme={null}
    # In the REPL:
    /query how is authentication implemented
    ```
  </Tab>
</Tabs>

ByteRover will search intelligently, follow relations between topics, and synthesize an answer from your context tree.

## What Happened Behind the Scenes

1. **Autonomous Analysis**: ByteRover analyzed your codebase content and detected relevant domains (code\_style, testing, structure, api, etc.) using semantic understanding.

2. **Intelligent Organization**: Content was organized hierarchically into the context tree at `.brv/context-tree/`, with appropriate domain and topic structure.

3. **Relation Mapping**: ByteRover identified connections between related topics and created explicit `@domain/topic` relations to build a navigable knowledge graph.

4. **Duplicate Prevention**: Before creating new topics, ByteRover searched for existing related knowledge to prevent duplication and update existing topics when appropriate.

5. **Facts Extraction**: ByteRover extracted structured facts from your content -- categorized as `personal`, `project`, `preference`, `convention`, `team`, `environment`, or `other` -- and stored them in the `## Facts` section of each knowledge file.
   See [How Curation Works](/context-tree/curation-engine) for details.

## Customizing Your Bootstrap

You can customize how ByteRover processes your codebase:

**Focus on specific areas:**

```markdown theme={null}
> curate context about testing patterns and conventions from this codebase using brv curate
```

**Break into smaller pieces:**

```markdown theme={null}
> curate context from this codebase, break it into small focused pieces
```

**Summarize before storing:**

```markdown theme={null}
> curate context from this codebase, summarize it before adding
```

For more customization options, see [Curate Context with Intelligence](/common-workflows/curate-context).

## Cloud Sync (Optional)

<Note>
  Push/pull requires a cloud account. See [Local vs Cloud](/local-vs-cloud) for setup.
</Note>

To share your bootstrapped context with teammates, stage, commit, and push:

<Tabs>
  <Tab title="CLI">
    ```bash theme={null}
    brv vc add .
    brv vc commit -m "bootstrap project context"
    brv vc push
    ```
  </Tab>

  <Tab title="TUI">
    ```
    /vc add .
    /vc commit -m "bootstrap project context"
    /vc push
    ```
  </Tab>
</Tabs>

## Next Steps

* [Onboard Existing Context](/common-workflows/onboard-context) - For individual files (1-3 docs)
* [Query the Context Tree](/common-workflows/query-context) - Effective query patterns and tips
* [Curate Context with Intelligence](/common-workflows/curate-context) - Interactive vs autonomous modes, advanced options
