Overview
Thelua sync command detects differences (drift) between your server-deployed configuration and local code, helping you keep them in sync.
The sync command helps prevent accidental overwrites when someone updates the agent from the admin dashboard while youβre working locally.
What Gets Synced
| Component | Description |
|---|---|
| Name | Agent name defined in LuaAgent({ name: "..." }) |
| Persona | Agent persona defined in LuaAgent({ persona: "..." }) |
How It Works
- Fetches server state - Gets the latest published persona and agent name from the server
- Compares with local - Checks your
src/index.tsLuaAgent configuration - Shows colored diff - Displays exactly what changed
- Prompts for action - Update local from server or keep local
Usage
Interactive Sync
- π΄ Red (
-) = Line exists on server but not in local code - π’ Green (
+) = Line exists in local code but not on server - Gray = Unchanged lines (abbreviated if many)
During Compile
Sync is automatically checked duringlua compile:
Options
Compile Integration
| Flag | Description |
|---|---|
--no-sync | Skip drift detection during compile |
--force-sync | Automatically update local from server if drift detected |
Examples
Common Scenarios
Scenario 1: Someone Updated Persona in Dashboard
Youβre developing locally, and a colleague updated the persona from the admin dashboard.Scenario 2: Forgot to Push Changes
You made changes locally but forgot to push before reverting your code.Scenario 3: CI/CD Pipeline
In your deployment pipeline, you might want to ensure no drift:Best Practices
Run sync before starting work
Run sync before starting work
Always run
lua sync when starting a new session to catch any changes made by teammates or from the dashboard.Use --force-sync for fresh pulls
Use --force-sync for fresh pulls
When you want to ensure you have the latest server state:This automatically updates your local code without prompting.
Use --no-sync in CI/CD
Use --no-sync in CI/CD
In automated pipelines where you want your code to be the source of truth:
Commit after syncing
Commit after syncing
After syncing from server, commit the changes to preserve them:
How Server Versions Work
The sync command compares against the latest published persona version, not the currently active one:| Version Type | Description | Used for Sync? |
|---|---|---|
| Draft | Created but not deployed | β No |
| Published | Has been deployed at least once | β Yes (latest) |
| Current | Currently active in production | β No |
Error Handling
No drift detected
No drift detected
Network error
Network error
If the server is unreachable, sync will silently continue to avoid blocking your workflow.
No persona on server
No persona on server
If no persona has been pushed to the server yet, sync will report no drift.

