Skip to main content
Pulls the latest contract from Bazable Cloud and overwrites the local bazable.config.json.
sync overwrites your local bazable.config.json. Commit any local contract changes first, or push them with bazable push.

Usage

Options

number
Fetch a specific contract version instead of the latest.
string
Use a specific access token (headless mode, no browser authentication). Useful in CI.

Prerequisites

  • Your bazable.config.json must contain a cloudProjectId (set automatically by the first bazable push).
  • You must be authenticated. If you are not logged in, the command starts the device-code flow automatically. In CI, use --token to authenticate headlessly.

What it does

1

Check authentication

If no stored token exists (and no --token is provided), starts the device-code flow.
2

Fetch the contract

Retrieves the contract data from the cloud. Gets the latest version by default, or the specified --version.
3

Overwrite the local contract

Your local bazable.config.json is replaced with the fetched version. All endpoints, schemas, base URLs, and the projectName are updated.
4

Handle missing versions

If the requested version does not exist, a clear error is shown.

Examples

For a live development loop, use bazable watch instead of running sync manually. It opens a real-time WebSocket to the cloud and auto-applies contract updates the moment they are pushed.