The single command that writes to your remote journal repository.
doraval journal syncsync is the only command that modifies the GitHub repo. Everything else (add, list, update) is local or read-only.
What it does
Section titled “What it does”- Refreshes your local cache (
~/.doraval/journals/) from the remote (global + current project). This is new behavior —syncalways pulls first. - Reads any staged entries from
~/.doraval/pending/<project>/. - If there are none → refreshes the cache and exits cleanly with a message.
- If there are pending entries:
- Fetches the latest remote version of the project file (with SHA for safe conditional write).
- Appends the new entries.
- Pushes the combined file back to GitHub using the Contents API.
- Clears the local pending directory.
- Re-fetches the final state into the local cache.
Options
Section titled “Options”| Flag | Description |
|---|---|
-p, --project | Project to sync (defaults to current directory mapping) |
-m, --message | Custom commit message |
Safety
Section titled “Safety”- Uses GitHub’s conditional update (SHA) so concurrent writes from other machines are detected and rejected.
- Never writes directly from
add— staging + explicitsyncprevents accidents. - Requires the
ghCLI with appropriate permissions on the journal repo.
When to run it
Section titled “When to run it”- At the end of a focused session after using
journal add. - Any time you want to share decisions with your future self or with agents on other machines.
syncis also a convenient “make sure my cache is fresh + publish if anything is waiting” command.
See journal update for a pure refresh without any publish attempt.
Related
Section titled “Related”- journal add — the main way to create things that
syncwill publish - journal update — just refresh the cache
- journal list
The full architecture (including why only sync writes) is explained in How the Agent Journal Works.