This document describes the two syncing workflows and how Worklog uses its local database. Together they enable shared Worklog files across a team and optional community engagement via GitHub Issues:
- Git-backed JSONL syncing (canonical data ref)
- GitHub Issues mirroring (optional)
Both workflows can be used independently. The Git-backed workflow is the canonical source of truth for Worklog data.
wl sync # Sync local changes to the canonical JSONL ref
wl gh push # OPTIONAL: Mirror Worklog items to GitHub Issues
wl gh import # OPTIONAL: Pull GitHub Issue updates back into WorklogWorklog keeps a local SQLite database as the runtime source of truth so reads and writes are fast and resilient even when git or GitHub are unavailable. The JSONL file is the sync boundary (import/export format) and is regenerated from the database after writes or merges. When this document says "syncing" it refers to keeping the JSONL snapshot aligned with the database and the canonical git ref, while "GitHub sync" refers to mirroring that same JSONL-backed data into GitHub Issues.
Worklog stores work items and comments in .worklog/worklog-data.jsonl (the most recent local snapshot). The authoritative, shared copy lives on a Git ref (by default refs/worklog/data) to avoid normal PR noise. Until you run wl sync, your local JSONL reflects only local changes and is not the team-wide source of truth. In fact, it is ignored by Git and is only ever shared with the team via the sync command.
wl sync- Pulls the remote JSONL ref
- Merges with local data (conflict resolution)
- Writes local DB + JSONL
- Pushes the updated JSONL ref
- Update local items (
wl create,wl update, etc.) - Run
wl syncto publish changes - Teammates run
wl syncto pull the canonical updates
If autoSync is enabled, Worklog runs wl sync in the background after each local write (debounced). This keeps the canonical ref up to date without manual sync.
Auto-sync is off by default to avoid unexpected git operations during local edits and to let teams choose when to publish shared data.
Set in .worklog/config.yaml (local) or .worklog/config.defaults.yaml (team defaults):
autoSync(boolean, default false)- Auto-push changes to the canonical Git ref after local writes
syncRemote(string, defaultorigin)- Git remote used for sync
syncBranch(string, defaultrefs/worklog/data)- Git ref used for the canonical JSONL file
- If
wl syncshows no updates but you expected changes, confirm your local JSONL is up to date and the correct ref is used. - If you want to preview a sync without changes, use
wl sync --dry-run.
Worklog can mirror items to GitHub Issues and import updates back. This GitHub sync reads from the local JSONL/database and updates Issues; it is separate from the git-backed JSONL sync above.
-
wl github push(alias:wl gh push)- Pushes local Worklog items to GitHub Issues
- Adds/updates issue titles, bodies, and labels
- Ensures a
<!-- worklog:id=... -->marker in the body - Links parent/child items using GitHub sub-issues (when enabled)
-
wl github import(alias:wl gh import)- Imports changes from GitHub Issues into Worklog
- Updates existing Worklog items with GitHub changes
- Optionally creates new Worklog items for unmarked issues
- Pulls parent/child relationships from GitHub sub-issues
Worklog uses wl:status:<status> labels to represent status. Only one status label is kept on an issue at a time.
Worklog syncs work item fields to GitHub as labels with the configured prefix (default wl:):
- Status:
wl:status:<status>(e.g.,wl:status:open,wl:status:in-progress) - Priority:
wl:priority:<priority>(e.g.,wl:priority:high,wl:priority:medium) - Risk:
wl:risk:<level>(e.g.,wl:risk:High,wl:risk:Medium,wl:risk:Low,wl:risk:Severe) - Effort:
wl:effort:<level>(e.g.,wl:effort:XS,wl:effort:S,wl:effort:M,wl:effort:L,wl:effort:XL) - Stage:
wl:stage:<stage>(if set) - Issue Type:
wl:type:<issueType>(if set) - Tags:
wl:tag:<tag>for each tag
- Worklog uses GitHub's sub-issue relationships to keep parent/child structure in sync.
- On
wl gh push, parent/child links are created or verified via the GitHub GraphQL API. - On
wl gh import, parent/child links are read from GitHub and mapped to WorklogparentIdvalues.
- Worklog does not create new items from closed issues.
- If an existing mapped GitHub issue is closed, Worklog marks the corresponding item as
completed.
Set in .worklog/config.yaml (local) or .worklog/config.defaults.yaml (team defaults):
githubRepo(string, e.g.owner/name)- Repo used for GitHub mirroring
githubLabelPrefix(string, defaultwl:)- Prefix for Worklog labels
githubImportCreateNew(boolean, default true)- When true,
wl github importcreates Worklog items from unmarked issues
- When true,
- Ensure canonical JSONL is up to date:
wl sync - Push to GitHub Issues:
wl gh push - Later, import GitHub updates:
wl gh import
- If
wl gh pushreports errors, re-run with--jsonfor detailed failures. - If the GitHub CLI is older, label creation uses
gh apiorgh issue label create.
# Sync Worklog JSONL with git
wl sync
# Push Worklog items to GitHub Issues
wl gh push
# Import GitHub Issue updates
wl gh import
# Import only issues updated since a timestamp
wl gh import --since 2024-01-01T00:00:00Z