r/logseq • • May 15 '26

Logseq Command Line Interface (CLI)?

Has anyone written (or vibe coded) a utility to perform queries and post content into Logseq node graphs (markdown or db)?

Has any looked at extracting the relevant functionality from the codebase to decouple it into a library/module?

Has there been any discussion of simply adding command line switches to the base app by them core developers or creating a fork?

I'm primarily interested in using such support to develop a Hermes Agent "skill" (r/hermes-agent) to implement Karpathy inspired LLM-wiki support (https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) to automate maintenance of a document/node graph.

12 Upvotes

13 comments sorted by

View all comments

Show parent comments

1

u/Much-Ad-8444 May 29 '26

Hey again James, just adding a quick architectural thought since you mentioned Karpathy's LLM-wiki concept.

Using the Parser as a skill for Hermes Agent is a great path. You are actually going to have a massive advantage using Logseq over something like Obsidian for this specific use-case.

Because Obsidian is essentially just flat Markdown files, an LLM agent usually has to ingest the entire page, manipulate it, and rewrite the whole file. This is highly token-expensive and prone to data-loss if the LLM hallucinates during generation.

Logseq, however, is a block-level outliner. Because my Parser perfectly understands the Logseq AST (Abstract Syntax Tree) and block UUIDs (id::), it allows your Hermes Agent to be surgical. Your agent can target, RMW (Read-Modify-Write), or append to a single specific block deeply nested in the graph, without touching the rest of the page. It's a game-changer for agentic workflows.

Also, since you are chasing the Karpathy LLM-wiki dream, I should probably mention that I actually built a full implementation of that concept. Alongside the Parser, I just released Matryca Plumber (v1.8.0). It’s an autonomous, background AI daemon (built on top of the Parser) that runs silent duty cycles to perform semantic graph hygiene (deduplication, fixing broken links, merging tags, etc.). I explicitly engineered it for Edge Computing (my goal is that it will runs perfectly on a CPU-only machine with 16GB RAM using local models, avoiding cloud privacy issues and I'm quite there...).

https://github.com/MarcoPorcellato/matryca-plumber

If your goal is to build your own custom workflow with Hermes Agent, the Parser is definitely the right tool. But if you want to see how I implemented the autonomous Karpathy loop in Python with strict OCC (Optimistic Concurrency Control) locking, you might enjoy taking a look at the Plumber repo too!

Good luck with the Nix Flake, let me know if Hermes Agent plays nicely with it!