Livestream: Make AI Match Your System

Announcing Visual Copilot - Figma to production in half the time

Builder.io
Builder.io

Livestream: Make AI Match Your System

Announcing Visual Copilot - Figma to production in half the time

Builder CLI's pull and push commands sync your local environment with Builder's remote environment. These commands enable developers to use local coding tools alongside Builder's powerful interactive Visual Editor.

Complete the following steps in preparation for using the pull and push commands:

  1. Create a Project connected to a repository. This can be done by following the instructions within Projects from repositories.
  2. Create a new branch on Builder within your Project. For more details, visit Create and duplicate branches.
  3. Go to the Code tab within your Build Project branch.
  4. At the bottom of the file system, click the Push to Remote button. This creates a new branch within your remote repository, connected to your Project's branch.

The video below demonstrates where to find the Push to Remote button. Note that the Push to Remote button is only active on a Project branch once changes have been made.

The Push to Remote button needs to be pushed only once per branch.

After making edits within the Builder Visual Editor, you may wish to sync those changes locally on your own machine. To do so, pull those changes down with the following command:

# Non-Windows
npx builder.io@latest pull <BRANCH-ID>

# Windows
npx "@builder.io/dev-tools@latest" pull <BRANCH-ID>

These commands can be found within the Code tab of the Visual Editor, at the bottom of the file section.

Alternatively, find the branch ID within the URL.

https://builder.io/app/projects/:projectId/:branchId

When you run this command:

  • A new branch is created on your local machine
  • Code changes made within the Visual Editor are copied to the local version of your code

The following arguments can also be optionally passed to the command:

FlagDescription

--project <PROJECT-ID>

Overrides the configured Project with the given Project ID.

--dry-run

Use this flag to see how the command would run without making any changes.

After making edits locally, use the push command to sync your local committed code changes with your Builder Project's branch.

# Non-Windows
npx builder.io@latest push

# Windows
npx "@builder.io/dev-tools@latest" push

When you run this command:

  • Local code changes are pushed to the branch within your remote repository
  • Local code changes are synced with your Builder Project's branch

Note: Only your committed changes are synced. If you do not see changes within Builder, confirm your local changes have been committed.

The following arguments can also be optionally passed to the command:

FlagDescription

--project <PROJECT-ID>

Overrides the configured Project with the given Project ID.

--dry-run

Use this flag to see how the command would run without making any changes.

Was this article helpful?