Skip to main content
smolbren’s JSON-first design makes it a natural tool for shell scripts, automation pipelines, and AI agent tool calls. There is no interactive mode, no pager, no colour codes — every command is a pure function that reads your vault and writes machine-readable output.

JSON stdout contract

Every successful command prints exactly one line of JSON to stdout and exits 0, except the explicit docs --agent and get --format text modes.
When a command fails, smolbren prints a JSON error object to stderr and exits with a non-zero code:
The code field is a stable machine-readable string (see Exit codes below). Scripts should check both the exit code and stderr — never rely on parsing the error message text, which may change between versions.

Composing with jq

Because stdout is always valid JSON, you can pipe directly into jq with no intermediate parsing step. Extract IDs from a search:
Reshape graph query results into objects:
Get a note’s body text:
Collect all outgoing edges of a note as a plain list:
Get all backlinks and filter to a specific edge type:

Shell script example

The following script gathers rich context for a given note: it fetches the note’s metadata, resolves one level of outgoing links, and prints a compact context block suitable for inclusion in an LLM prompt.
Running it:

Install the agent skill

smolbren ships a ready-made Agent Skill that teaches coding agents the full CLI workflow: the JSON output contract, exit codes, the explore-the-ontology-before-Cypher pattern, note-id semantics, and common gotchas. Install it with the skills CLI:
The skills CLI detects the coding agents on your machine (Claude Code, Cursor, and others) and installs the skill into each one. To regenerate an installed skill from the exact binary in use, run:
The checked-in skill and docs --agent output are byte-for-byte identical in CI, so agent documentation cannot silently drift from the release that emitted it.

AI agent integration

smolbren works as a tool definition in agent frameworks (LangChain, OpenAI function calling, Anthropic tool use, custom scaffolding, etc.). Register the CLI commands you need as individual tools. Recommended tool surface: Below is a conceptual tool definition in generic JSON schema format, suitable for adaptation to any framework:
When the agent receives a tool result it can immediately pipe it through further tool calls — for example, running search_vault to find candidate IDs, then query_graph to traverse their relationships, then get_note with --body to load the full text of the most relevant result.

Exit codes for error handling

Scripts should check the exit code before attempting to parse stdout. smolbren uses a fixed set of non-overlapping codes: Example defensive pattern:
For a complete reference, see the Exit Codes page.
Run smolbren index at the start of any script or agent session that will perform searches or queries. The incremental indexer finishes in milliseconds when nothing has changed, so it is safe to call unconditionally — and it guarantees your results reflect the current state of the vault.