Livestream: The 5 Levels of AI Development Maturity

Announcing Visual Copilot - Figma to production in half the time

Builder.io
Builder.io
Contact sales

Livestream: The 5 Levels of AI Development Maturity

Announcing Visual Copilot - Figma to production in half the time

enterprise plans

Many complex applications use multiple repositories, each interconnected with the others. However, Builder Projects require you to choose a single repository as the Project's entry point.

By connecting multiple repositories to a single Project, Builder's AI can update features across them.

Multi-repo support provides you with the ability to make coordinated changes across repositories. Create multiple PRs, commit to different repos, and run apps independently in separate terminals.

Pair these benefits with custom workspace instructions to make setup even more powerful. Teach our AI how the repos relate to each other, what each one is responsible for, and any relevant workflow context.

This leads to smarter, more accurate changes within your codebase.

To add additional repositories to a Builder Project:

  1. Go to your Builder Projects page.
  2. Click the three-dot menu on your selected Project.
  3. Navigate to the Agents tab.
  4. Under the Additional Repositories heading, click the Add Repository button.
  5. Choose a repository to add from the dropdown list.
  6. Toggle on the Allow Write Access toggle.
  7. Click Save.

When working on your Project, Builder can now edit the repositories associated with this Project.

Now, whenever you Create a pull request, you have the option to create pull requests to multiple attached repositories.

By default, Builder only visually previews the main repository used to create the Project initially. This works well for many applications, where additional repositories may be focused on data delivery or particular services.

However, if your application has multiple repositories that deliver visual interfaces, you must take additional steps.

  1. First, download the Builder.io Desktop App. Multiple repository preview only works when run by the Desktop App.
  1. Next, update your Dependency Install Script. Your install script should assume your main Project repository as the root directory, and run installation commands for all other repositories. For example:
npm install && cd ../additional-repo && npm install
  1. Finally, update your Dev Command. Use a tool to run all your repositories simultaneously, such as the concurrently package.
npx concurrently \
    --names "main,additional" --prefix name --kill-others \
    "npm start" \
    "cd ../additional-repo && npm start"

Builder can now preview each repository individually. Use the location bar within the Visual Editor to adjust the URL and visit other parts of your application.

Environment variables can be added to Projects within the Project settings menu. However, if your additional repositories require separate environment variables, update your Dev Command script to expose and use them.

npx concurrently \
    --names "main,additional" --prefix name --kill-others \
    "npm start" \
    "cd ../additional-repo && MY_ENV=$MY_ENV && npm start"
Was this article helpful?