mit einem Klick
logseq-repl
// Start and coordinate Logseq development REPL workflows for the Desktop renderer `:app`, Electron main-process `:electron`, and `:db-worker-node` runtimes through one unified workflow.
// Start and coordinate Logseq development REPL workflows for the Desktop renderer `:app`, Electron main-process `:electron`, and `:db-worker-node` runtimes through one unified workflow.
Review Logseq code changes, PRs, patches, commit ranges, or implementation plans through one main-agent orchestration workflow that routes read-only subagents across independent review passes, then deduplicates, validates, and reports findings for the web app, desktop app, and Logseq CLI.
Operate the current Logseq command-line interface to inspect or modify graphs, pages, blocks, tasks, tags, and properties; run Datascript queries; show page/block trees; manage graphs; and manage db-worker-node servers. Use when a request involves running `logseq` commands or interpreting CLI output.
Answer user questions about the Logseq repository by researching source code, docs, tests, runtime behavior, and local tools. Use when Codex needs to explain how Logseq works, why behavior happens, where logic lives, how CLI/Desktop/Web flows interact, or what evidence supports an answer, without implementing features or fixing bugs.
Build, debug, or review Logseq plugins with the `@logseq/libs` SDK (TypeScript/JavaScript, iframe/shadow sandboxed). Use when the task involves writing plugin entry code, registering slash/command/UI items, provideUI/provideStyle/provideModel, settings schema, macro renderers, DB-graph properties & tags, Datascript/DSL queries, experimental APIs, theme plugins, or the `logseq/*` CLJS facade generated under this package.
Debug Logseq bugs with the right runtime, concrete before/after evidence, and end-to-end reproduction steps.
Collect, interpret, and troubleshoot db-sync server usage stats (total users/graphs, active users/graphs in N days, created-today metrics) using the `deps/db-sync` scripts and D1 schema. Use when requests involve `show-usage-stats`, server usage reporting, active-entity counting, or Cloudflare D1 cost impact of usage tracking.
| name | logseq-repl |
| description | Start and coordinate Logseq development REPL workflows for the Desktop renderer `:app`, Electron main-process `:electron`, and `:db-worker-node` runtimes through one unified workflow. |
Use this skill when the user needs a Logseq development REPL for:
:app:electron:db-worker-nodeThe workflow uses one shared state directory: <repo>/tmp/logseq-repl/.
Start everything with the default Logseq data root ($LOGSEQ_CLI_ROOT_DIR or ~/logseq):
<logseq-repl-skill-dir>/scripts/start-repl.sh --repo demo
Start everything with an explicit Logseq data root:
<logseq-repl-skill-dir>/scripts/start-repl.sh --repo demo --root-dir ~/logseq
Clean up everything:
<logseq-repl-skill-dir>/scripts/cleanup-repl.sh
Verify all REPL targets after startup:
<logseq-repl-skill-dir>/scripts/verify-repls.sh
start-repl.sh starts:
pnpm watchpnpm dev-electron-appdb-worker-node via node ./static/db-worker-node.js --repo <name> --root-dir <path> --owner-source clistart-repl.sh is a small shell wrapper around start-repl.py. The Python script verifies that :app, :electron, and :db-worker-node runtimes are live, runs verify-repls.sh to connect to each target REPL and print a small result, then prints attach commands. It does not attach an interactive REPL by itself and exits after verification.
cleanup-repl.sh stops all workflow-managed processes without requiring a target selection. It also removes legacy state files from older split workflows and attempts to stop repo-owned listeners on the standard REPL ports.
verify-repls.sh connects to app, electron, and db-worker-node with pnpm exec shadow-cljs cljs-repl, evaluates one target-specific expression in each REPL, and prints the output.
Before starting or attaching:
<logseq-repl-skill-dir>/scripts/cleanup-repl.sh
Then start all runtimes:
<logseq-repl-skill-dir>/scripts/start-repl.sh --repo demo
Use --root-dir <path> if the target graph lives outside $LOGSEQ_CLI_ROOT_DIR or ~/logseq.
Attach only to the target you need:
pnpm exec shadow-cljs cljs-repl app
pnpm exec shadow-cljs cljs-repl electron
pnpm exec shadow-cljs cljs-repl db-worker-node
:app.:electron.:db-worker-node.Runtime reminders:
:app = Electron renderer:electron = Electron main process:db-worker = browser worker:db-worker-node = Node workerKeep these separate:
shadow-cljs server or pnpm watch process exists:app, :electron, or :db-worker-nodeIf runtime count is 0, do not attach yet. Fix runtime startup first.
Check runtime counts:
pnpm exec shadow-cljs clj-eval "(do (require '[shadow.cljs.devtools.api :as api]) (println {:app (count (api/repl-runtimes :app)) :electron (count (api/repl-runtimes :electron)) :db-worker-node (count (api/repl-runtimes :db-worker-node))}))"
Interpretation:
:app > 0 means a Desktop renderer runtime is attached:electron > 0 means an Electron main-process runtime is attached:db-worker-node > 0 means a worker-node runtime is attached0 means not ready, even if watch/build logs look healthyLook here first:
<repo>/tmp/logseq-repl/shared-shadow-watch.log<repo>/tmp/logseq-repl/desktop-electron.log<repo>/tmp/logseq-repl/db-worker-node.logAfter cleanup, verify standard ports if startup still reports conflicts:
lsof -nP -iTCP:8701 -sTCP:LISTEN
lsof -nP -iTCP:3001 -sTCP:LISTEN
lsof -nP -iTCP:3002 -sTCP:LISTEN
lsof -nP -iTCP:9630 -sTCP:LISTEN
lsof -nP -iTCP:9631 -sTCP:LISTEN
Interpretation:
Desktop :app:
cat <<'EOF' | pnpm exec shadow-cljs cljs-repl app
(prn {:runtime :app :document? (some? js/document) :title (.-title js/document)})
:cljs/quit
EOF
Electron :electron:
cat <<'EOF' | pnpm exec shadow-cljs cljs-repl electron
(prn {:runtime :electron :process? (some? js/process) :type (.-type js/process)})
:cljs/quit
EOF
db-worker-node:
cat <<'EOF' | pnpm exec shadow-cljs cljs-repl db-worker-node
(prn {:runtime :db-worker-node :process? (some? js/process) :platform (.-platform js/process)})
:cljs/quit
EOF
(shadow.user/cljs-repl)
(shadow.user/electron-repl)
(shadow.user/worker-node-repl)
Failure triage order:
tmp/logseq-repl/shared-shadow-watch.logtmp/logseq-repl/desktop-electron.logtmp/logseq-repl/db-worker-node.loglsofshadow.cljs.devtools.api/repl-runtimesCommon cases:
No available JS runtime: the build may be ready, but the runtime has not connected. Check runtime counts before retrying attach.:app runtimes: close browser dev app instances so only the Desktop renderer remains.db-worker-node repo mismatch: rerun start-repl.sh --repo <name>; it restarts the worker runtime for the requested repo.When helping a user connect to a REPL:
:app, :electron, :db-worker-node, or a combinationcleanup-repl.shstart-repl.sh --repo <name>cleanup-repl.sh when finished