A tiny Python CLI that reads Logseq's SQLite graph (db.sqlite), decodes the Transit data inside, and prints any page (regular or journal) as a plain-text outline. It also resolves raw UUID links ([[692cf4c0-…]]) to their human-friendly titles.
- Works with the current Logseq
db.sqliteformat (Transit-encoded datoms stored in thekvstable). - Accepts either a page name (
Travels,Library,Peru) or a journal date (2025-12-03). - Defaults to today's journal page when no argument is passed.
- Replaces UUID-based links with the referenced block/page title for easier reading.
- Python 3.11+ (any version supported by
transit-python). transit-python==0.8.302(already declared inrequirements.txt).- Logseq graph folder containing
db.sqlite,db.sqlite-shm, anddb.sqlite-wal(copy/symlink the SQLite files next to the CLI).
# create / reuse a virtualenv with uv (recommended)
uv venv
source .venv/bin/activate
uv pip install -r requirements.txtIf you prefer vanilla pip:
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt# default: today's journal page
uv run logseq_page_cli.py
# specific journal date
uv run logseq_page_cli.py 2025-12-03
# regular page or tag
uv run logseq_page_cli.py Travels
uv run logseq_page_cli.py "Library"The script prints a header such as Journal page: 2025-12-03 [entity 16815] followed by an indented list of blocks. If the entire page is empty, you’ll see (no blocks recorded for this page).
- The CLI is read-only; it never writes to the database.
- Because Logseq stores every “fact” as a datom, the script rebuilds all entities in memory. For very large graphs this can take a few seconds.
- If you add new notes and do not see them in the output, ensure Logseq has synced changes to
db.sqlite(e.g., by closing Logseq or forcing a save). - This script is created by Codex CLI.
MIT. Do whatever makes your graph happier.