with one click
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.
| 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[HINT] Download the complete skill directory including SKILL.md and all related files