Freeing myself from Roam Research (via LogSeq)

Freeing myself from Roam Research (via LogSeq)

This is a quick note about how I switched from paying $165 per year for an app to paying nothing to get essentially the same functionality. tl;dr: Switch from Roam to LogSeq and use Github to sync.

Why I like Roam

Roam Research is a great tool for ad-hoc notetaking. The creators call it a “a note-taking tool for networked thought.”

I used Roam Research for a year and really enjoyed how it turned my unstructured thoughts into structure.

I particularly like that Roam automatically syncs between desktop and mobile (though the mobile app is terrible).

However, I don’t like the price of Roam ($165 per year), especially as a student. So when, my annual renewal came up a couple of days ago, I cancelled and began looking for other options.

A daily note in Roam Research
A daily note in Roam Research

LogSeq to the rescue

After some searching, I found LogSeq. LogSeq is essentially a local-first, open-source version of Roam. It has both desktop and mobile apps.

And, as you can see below, LogSeq can import Roam data (see this tutorial for step-by-step instructions).

The same daily note as above, but this time in LogSeq.
The same daily note as above, but this time in LogSeq.

The challenge is that LogSeq does not automatically sync between the desktop and mobile apps. The official suggestion is to use iCloud Drive, but that did not work for me nor other people.

A forum post pointed to this tutorial on syncing to Github, so I decided to try that. It worked!

LogSeq and Github

I’ll put here an abbreviated version of the tutorial with some of my customizations.

  1. I created a new Git repository inside the storage location of my LogSeq graph and created a private Github repository (assumes you have the Github command line installed)
  2. git init
    gh repo create logseq_storage --private --source=. --remote=origin
  3. For desktop:
    1. I created a branch called sync to do the sync instead of main. This is so I don’t end up with a bunch of autosave commits for LogSeq on my Github profile.
    2. git checkout -b sync
    3. I use the pre-commit(which pulls the repo) and post-commit hooks from the tutorial, but changed the post-commit to push the sync branch instead of main.
    4. # In post-commit
      git push origin sync
    5. I turned on the “Git auto commit” setting in the LogSeq app
    6. image
  4. Mobile (iOS): I used the Working Copy app and Apple shortcuts to automatically sync with GitHub. Just follow this section of the tutorial, but make sure you’re on the sync branch in Working Copy.
  5. Github Actions: I wrote a Github actions workflow to automatically create and merge a PR once a week from sync -> main. I use a squash commit when I merge the PR, so this gives me a clean set of commits to go back to if I ever need a backup. The action is below.
  6. on:
        # Run once a week
        - cron: '0 0 * * 1'
        runs-on: ubuntu-latest
        - name: Checkout repository
          uses: actions/checkout@v2
            ref: main
        - name: Reset promotion branch
          run: |
            git fetch origin sync:sync
            git reset --hard sync
        - name: Create Pull Request
          id: cpr
          uses: peter-evans/create-pull-request@v4
            body: "Repository last updated at ${{ github.event.repository.updated_at }}."
            title: "Weekly backup"
            branch: weekly-update
        - name: Merge Pull Request
          if: ${{ steps.cpr.outputs.pull-request-number }}
          uses: juliangruber/merge-pull-request-action@v1
            github-token: ${{ secrets.GITHUB_TOKEN }}
            number: ${{ steps.cpr.outputs.pull-request-number }}
            method: squash
            repo: marcosfelt/logseq_storage

I hope this helps if you ever want to switch to LogSeq and thus save some money!