notebrain-cli

command module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 5 Imported by: 0

README

NoteBrain CLI

NoteBrain is a high-performance Go CLI tool designed to index an Obsidian vault into a local ChromaDB vector database. It enables powerful semantic search, backlink traversal, graph connections, hidden connections, shared tags discovery, and graph-boosted semantic queries across your personal knowledge base.

Release

Features

  • Blazing Fast Ingestion: Uses Go concurrency and local ONNX embedding models to index your Markdown files rapidly.
  • Embedded ChromaDB: Stores vectors directly on disk using chroma-go v2 (no external database server required).
  • Semantic Search: Find notes by meaning, not just keywords.
  • Goldmark AST-Aware Chunking: Intelligently chunks markdown sections according to header hierarchies instead of arbitrary character splits, preserving code blocks and structural metadata.
  • Advanced Filtering: Use --section, --has-code, and --has-tasks to filter searches precisely by document structures.
  • OSC 8 Terminal Hyperlinks: Automatically renders clickable obsidian://open links right in your CLI for seamlessly opening matched chunks inside Obsidian (supported terminals only).
  • Graph Traversal: Explores your Obsidian wikilinks graph ([[Note]]).
  • Hidden Connections: Discovers notes that are semantically identical but not explicitly linked.
  • Graph-Boosted Search: Combines semantic search scores with structural graph proximities.

Configuration (.env)

You can manage global variables to streamline NoteBrain usage via a .env file. Copy .env.example to .env in the project root:

# The absolute path to your Obsidian vault on disk (used by 'ingest')
OBSIDIAN_VAULT_PATH="/path/to/Second Brain 2.0"

# The name of your Obsidian vault (used by 'search' for obsidian:// URIs)
OBSIDIAN_VAULT_NAME="Second Brain 2.0"

# Set to 1 to globally disable OSC 8 terminal hyperlinks in output
# NO_HYPERLINKS=1

Quick Start

  1. Install NoteBrain (see Installation).
  2. Ingest your vault:
    notebrain ingest --vault "/path/to/your/Obsidian Vault"
    
  3. Search your thoughts:
    notebrain search "how do message brokers work?" --limit 5
    

Architecture

flowchart TD
    A[Obsidian Vault] -->|Markdown Files| B(Parser Engine)
    B -->|Chunks & Frontmatter| C{Ingestion Pipeline}
    B -->|Wikilinks| C
    
    C -->|SHA-256 Hash Check| D[ChromaDB Local Vector Store]
    C -->|ONNX Embeddings| D
    
    E[CLI Commands] -->|Query| D
    D -->|Semantic Search| E
    D -->|BFS Graph Traversal| E

Documentation

Comprehensive documentation is available in the wiki/ directory:

CLI Command Reference

Full auto-generated documentation for the CLI commands:

License

MIT License

Documentation

Overview

Copyright © 2026 nmdra

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis
cmd
tui
Package config holds all configuration for notebrain-cli.
Package config holds all configuration for notebrain-cli.
internal
parser
Package parser provides Markdown parsing, slugification, and text chunking for notebrain-cli.
Package parser provides Markdown parsing, slugification, and text chunking for notebrain-cli.
tui

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL