jq, shell pipelines, and AI agent tool calls without any pre-processing.
Success output
On success, one line of compact JSON is printed to stdout and the process exits with code0.
- List commands (
search,links,backlinks,types,edges,vault list) return a JSON array, one element per result. - Single-item commands (
get,index,vault add,vault remove) return a JSON object.
smolbren search "zettelkasten" might emit:
smolbren get 202401-zettelkasten returns a single object:
Fields that are absent or inapplicable are included as
null rather than being omitted. This keeps output shapes stable across notes so downstream code can rely on a consistent schema.Error output
When a command fails, the error is written to stderr as a single line of compact JSON with two fields —error (a human-readable message) and code (a stable machine-readable identifier):
Error codes
| Code | Meaning |
|---|---|
internal | An unexpected internal error occurred. Check the error field for details. |
vault_not_found | No vault with the given name is registered in config, or no default vault has been set and --vault was not provided. |
note_not_found | The note ID passed to get, links, or backlinks does not exist in the index. |
index_missing | The vault is registered but has never been indexed — run smolbren index first. |
code field is guaranteed to be one of these four values. Use it (rather than the error string) for programmatic branching; the human-readable message may change between releases.
Parsing with jq
Because every command emits valid JSON on a single line,jq works with no special flags:
All JSON is compact — no indentation or line breaks. Pipe through
jq . to get human-readable formatted output when inspecting results at the terminal: