sync
Build your driver and hot-swap its Lua into the running instance on a controller: fast, with no full reload. Ideal for tight edit-test loops while developing.
Usage
driverforge sync [options]
sync builds first (respecting -c/--configuration, including the
configuration's defaults
from the project config), then ships the bundled
Lua to the Anvil Agent, which swaps it into the
already-loaded driver. What you sync is always your current source: there is no
stale artifact to forget about. Because it skips the install-and-reload cycle a
full deploy does, it's much faster, but it only applies when
the driver's structure hasn't changed. A sync never changes the driver's
version.
Prerequisites
- The project is initialised (
driverforge init) - You're signed in (
driverforge login) - A target controller is selected (
driverforge device select) - The Anvil Agent is installed and running on the controller
- The driver is already installed on the controller;
deployit once first so there's a running instance to hot-swap into
When sync applies (and when it doesn't)
Sync only hot-swaps when driver.xml is structurally unchanged since the
running build (same actions, properties, commands, connections, etc.). If you've
changed any of that, a full reload is required and sync will offer to run a
deploy for you (or do it directly with --deploy). The
escalation runs the full deploy flow, rebuild and
version bump included.
Keep these in mind:
- Load-time init doesn't re-run. Sync re-runs top-level Lua but not
OnDriverInit/OnDriverLateInit, so keep load-time initialization idempotent if you rely on it during development. - Encrypted drivers can't be hot-swapped. The Anvil Agent can't update an
encrypted driver's contents in place. Build unencrypted during development to
take advantage of hot reloading with
sync; to update an encrypted driver, usedeploy, which installs the new version and reloads it in full. (An encrypted build passed tosyncfalls back to a deploy automatically.)
Options
| Option | Description |
|---|---|
--device | Controller to sync to (name, hostname, or id); overrides the selected one |
--select | Re-select the target controller first |
--configuration, -c | Build configuration to build and sync |
--deploy | Do a full deploy instead of a hot-swap |
Examples
Build and hot-swap onto the selected controller:
driverforge sync
Build and sync the release configuration:
driverforge sync -c release
Force a full deploy instead:
driverforge sync --deploy
Global flags
Every driverforge command also accepts these global flags: --verbose/-v, --project-dir, --no-tui, --no-update-check, and --help/-h. See the overview for details.