← 返回
未分类

Logseq Bridge

Pure file-based interaction with a local Logseq graph. Read, write, search, and manage Logseq journals and pages via direct `.md` file operations. No plugins...
纯文件方式与本地 Logseq 图谱交互,通过直接操作 `.md` 文件读取、写入、搜索和管理日志与页面,无需插件。
ham-5on ham-5on 来源
未分类 clawhub v2.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 319
下载
💾 0
安装
1
版本
#knowledge-graph#latest#logseq#markdown#notes

概述

Logseq Bridge

Interact with your Logseq graph by directly reading and writing .md files on disk. No plugins, no HTTP APIs — just filesystem access to your Logseq graph directory.


How It Works

Agent → Shell → Read/Write local `.md` files → Logseq reloads on next Cmd/Ctrl+R

Pure file operations. No HTTP APIs, no plugin bridges, no port listeners.


Prerequisites

Your Logseq graph is stored as a local directory structure:

{graph_root}/
├── journals/       ← Daily notes *.md
├── pages/          ← Knowledge pages *.md
├── assets/         ← Images, attachments
├── logseq/         ← Config files
│   └── config.edn
└── .logseq/        ← Index database (auto-maintained)
    └── graphs/
        └── logseq_local_*.transit

What you need:

  1. Logseq installed and opened at least once (so .logseq/ exists)
  2. Read/write access to the graph directory on your filesystem
  3. Know your graph path

Finding Your Graph Path

Method 1: From Logseq UI

Open Logseq → SettingsAdvanced → Look for "Current graph directory"

Method 2: From the transit database file

ls ~/.logseq/graphs/*.transit
# e.g.: logseq_local_E%3A+++Users++MyUser++Logseq.transit

The filename is URL-encoded. Decode it to find your path:

# In WSL/Linux, mount the drive and set the path
export LQ="/mnt/c/Users/MyUser/Logseq"

Core Operations

Set the environment variable first:

export LQ="/path/to/your/logseq/graph"

📝 Write to Today's Journal

DATE=$(date +%Y_%m_%d)
FILE="$LQ/journals/$DATE.md"

cat >> "$FILE" << 'EOF'
- 🦞 Note title
  - Sub-item 1
  - Sub-item 2
EOF

📖 Read a Journal

cat "$LQ/journals/$(date +%Y_%m_%d).md"
# Or a specific date
cat "$LQ/journals/2026_04_25.md"

📄 Read a Knowledge Page

cat "$LQ/pages/Page Name.md"

🔍 Search Notes

# Search all pages
grep -ri "keyword" "$LQ/pages/"

# Search journals
grep -rn "keyword" "$LQ/journals/"

# Search the database index (faster)
strings ~/.logseq/graphs/*.transit | grep -i "keyword" | head -20

📋 Create a New Page

cat > "$LQ/pages/New Page.md" << 'EOF'
title:: New Page
tags:: tag1, tag2

- Page content
  - Sub content
EOF

📊 List Statistics

# Total journals
ls "$LQ/journals/" | wc -l

# Total pages
ls "$LQ/pages/" | wc -l

# Latest 5 journals
ls -t "$LQ/journals/" | head -5

Markdown Format Reference

Write notes in Logseq-compatible Markdown:

SyntaxExampleNote
-----------------------
Bullet list- contentEvery line starts with -
Indent children - child2-space indent
BoldtextStandard Markdown
Wiki link[[Page Name]]Auto-links pages
Tag#tagnameAuto-indexed
Propertykey:: valuePage or block-level property
TODO markerTODO do somethingRenders as task
DONE markerDONE completedRenders as done

Known Issues & Limitations

IssueDescriptionWorkaround
--------------------------------
No real-time refreshLogseq doesn't watch file changesPress Ctrl+Shift+R (or Cmd+Shift+R) to reload
Static text readsReads raw .md, not block treeParse Markdown yourself for structured data
Cloud sync delayGraph on OneDrive/Dropbox may lagWait a few seconds after writing
Special characters in pathsChinese/Unicode charsWrap paths in double quotes

Quick Start

# 1. Find your graph path in Logseq Settings → Advanced

# 2. Set the path
export LQ="/path/to/your/logseq/graph"

# 3. Write a test note
DATE=$(date +%Y_%m_%d)
echo "- 🎉 Logseq Bridge test successful!" >> "$LQ/journals/$DATE.md"

# 4. Reload Logseq (Ctrl+Shift+R or Cmd+Shift+R)

Best Practices

  1. File operations first — stable, zero dependencies
  2. Tell user to reload — Logseq won't auto-detect file changes
  3. Date format — Journal filenames are always YYYY_MM_DD.md
  4. Page naming — The filename IS the page name; Chinese OK
  5. Heredoc — Use << 'EOF' for multi-line content

References

  • Logseq: https://logseq.com
  • Logseq Markdown Guide: https://docs.logseq.com
  • ClawHub: https://clawhub.ai

版本历史

共 1 个版本

  • v2.0.0 当前
    2026-05-07 22:07 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Skill Publisher

ham-5on
准备并发布 OpenClaw AgentSkill 到 ClawHub。适用于技能目录已就绪需发布,或升级已发布的技能...
★ 0 📥 391
knowledge-management

Obsidian

steipete
操作 Obsidian 仓库(纯 Markdown 笔记)并通过 obsidian-cli 自动化。
★ 446 📥 105,044
knowledge-management

Summarize

paudyyin
智能摘要工具,自动为长文本、文档、网页生成摘要,提取要点与关键词,支持自定义摘要长度。
★ 958 📥 519,093