Target audience: Team leads and developers sharing work items across a team Time to complete: 15-20 minutes Prerequisites: Worklog installed (Tutorial 1), Git configured with a remote repository
By the end of this tutorial you will be able to:
- Share work items with teammates using
wl sync - Understand the JSONL sync model and conflict resolution
- Mirror work items to GitHub Issues
- Import changes from GitHub back into Worklog
Worklog stores data in a local SQLite database for fast reads and writes. To share data with your team, Worklog exports to a JSONL file and pushes it to a dedicated Git ref (refs/worklog/data by default). This ref is separate from your normal branches, so syncing never creates pull requests or clutters your commit history.
The flow looks like this:
You: local DB --> JSONL --> git push (refs/worklog/data)
|
Team: git pull (refs/worklog/data) --> merge --> local DB
For this tutorial, simulate two team members by creating two clones of the same repository:
# Alice's workspace
git clone https://github.com/your-org/your-project.git alice-workspace
cd alice-workspace
wl init# Bob's workspace (in a separate terminal)
git clone https://github.com/your-org/your-project.git bob-workspace
cd bob-workspace
wl initBoth workspaces now have independent local databases pointing at the same remote.
In Alice's workspace:
# Create some work items
wl create -t "Design the API schema" -p high -a "Alice"
wl create -t "Write integration tests" -p medium -a "Bob"
# Push to the shared ref
wl syncThe sync command:
- Pulls any existing data from the remote ref
- Merges it with local changes
- Pushes the combined result back
Alice should see output confirming the push succeeded.
In Bob's workspace:
wl syncBob's local database now contains Alice's work items. Verify:
wl listBoth items should appear. Bob can now update his assigned item:
wl update <id> -s in-progress --stage in_progress
wl syncBack in Alice's workspace:
wl sync
wl show <id>The item Bob updated should now show in-progress in Alice's workspace.
When Alice and Bob edit different items, sync merges cleanly. When they edit the same item, Worklog resolves conflicts by keeping the most recently updated version (last-write-wins on a per-item basis).
Example of a conflict scenario:
# Alice updates the title
wl update <id> -t "Design the REST API schema"
# Bob updates the same item's priority (before syncing)
wl update <id> -p critical
# Alice syncs first
wl sync
# Bob syncs -- Worklog merges both changes
wl syncAfter both sync, the item will have Bob's priority (critical) and Alice's title (Design the REST API schema) because each field's latest timestamp wins.
Sync behavior is configured in .worklog/config.yaml:
# Auto-sync after every local write (off by default)
autoSync: false
# Git remote to sync with
syncRemote: origin
# Git ref for the JSONL data (default avoids GitHub PR noise)
syncBranch: refs/worklog/dataTo enable auto-sync so changes are pushed immediately:
# Edit .worklog/config.yaml and set autoSync: trueUse wl sync --dry-run to preview what would be synced without making changes.
Worklog can mirror work items to GitHub Issues for visibility outside the CLI:
wl github pushThis creates or updates GitHub Issues for each work item, adding labels like wl:status:open, wl:priority:high, and wl:type:feature. Parent/child relationships are preserved using GitHub sub-issues.
wl github importThis pulls updates from GitHub Issues back into Worklog. If someone changes an issue title or closes it on GitHub, those changes are reflected locally after import.
wl github import --since 2025-01-15T00:00:00ZSet the target repository in .worklog/config.yaml:
githubRepo: your-org/your-project
githubLabelPrefix: "wl:"
githubImportCreateNew: trueWhen githubImportCreateNew is true, wl github import will create new Worklog items for GitHub Issues that don't already have a Worklog marker.
# Start of day: pull latest from your team
wl sync
# Work normally: create, update, comment
wl update <id> -s in-progress --stage in_progress
wl comment add <id> -c "Started implementation" -a "Your Name"
# End of day: push your changes
wl sync
# Optionally update GitHub Issues
wl github push| Problem | Solution |
|---|---|
wl sync shows no updates |
Check that both clones point at the same remote with git remote -v |
| Push fails with permission error | Verify you have push access to the remote repository |
| GitHub push fails | Ensure gh CLI is installed and authenticated (gh auth status) |
| Stale data after sync | Run wl sync again -- the first run may only pull, and a second run pushes local changes |
| Action | Command |
|---|---|
| Sync with team | wl sync |
| Preview sync | wl sync --dry-run |
| Push to GitHub | wl github push |
| Import from GitHub | wl github import |
| Import recent only | wl github import --since <ISO date> |
- Building a CLI Plugin -- extend Worklog with custom commands
- Planning and Tracking an Epic -- organize complex features
- Data Syncing Reference -- full sync documentation