Skip to main content
Continuously syncs a remote contract (or cloud project) and auto-fixes your code the moment it changes. When run against a linked cloud project, bazable watch opens a real-time WebSocket connection to Bazable Cloud and reacts instantly to contract_updated events. If the WebSocket cannot connect, drops, or is disabled with --no-ws, it automatically falls back to HTTP polling.

Usage

Options

number
default:60
Polling interval in seconds. Only used when WebSocket is disabled or fails.
boolean
Show changes without applying them.
boolean
Automatically apply all changes.
boolean
Disable WebSocket real-time sync and use polling instead.

Examples

How real-time sync works

  1. bazable watch reads cloudProjectId and cloud.apiBaseUrl from bazable.config.json.
  2. It derives the WebSocket URL by swapping http for ws (or https for wss) and appending /ws?projectId=[projectId].
  3. When bazable push uploads a new contract version, the server broadcasts:
  4. On receipt, bazable watch immediately runs bazable inspect --fix — no waiting for the next poll interval.
  5. If the socket closes or errors, the client falls back to polling at --interval seconds.
Real-time sync requires a linked cloud project. Run bazable push once to link the project and populate cloudProjectId. Use --no-ws in environments where outbound WebSocket connections are blocked (some corporate proxies, restricted CI runners).
Prefer bazable watch over manual bazable sync when you want your local code to stay in lockstep with the backend contract as it evolves.